Questions tagged as 'procedure'

1
answer

Procedure pl / sql

Talk to the galley blz? Hi, I'm new to PL / SQL and I'm creating my first procedure because I need to load two tables (Insert or Change) I'm using Merge. But when I try to execute my procedure I already get the following error    PLS - 000103...
asked by 14.10.2015 / 17:30
0
answers

Error Code: 1452. Can not add or update child row: a foreign key constraint fails

I would like to ask a question, or just show me the way. There is a table called Questionnaire from it I get the records in a procedure and organize the data in it. Here is my code: CREATE DEFINER='myroot'@'%' PROCEDURE 'SP_OrganizaEnvio...
asked by 16.11.2015 / 14:58
2
answers

Date string-to-date procedure

I'm creating a procedure, which receives a string '2015-09-11', verifies that it is indeed a Monday, if not, it picks up that date and plays Monday of the week itself. But my concept with sql is pretty weak, my base is this way. DROP PROCE...
asked by 11.09.2015 / 15:39
2
answers

Why use WHERE 1 = 1 in a SQL query?

During the maintenance of a legacy system I noticed the following procedure : DECLARE @sql AS varchar(MAX); DECLARE @param as varchar(50); SET @sql = 'SELECT * FROM Destinatario where 1 = 1'; IF(@param IS NOT NULL) SET @sql = (@sql + '...
asked by 10.04.2014 / 18:53
1
answer

How to Pass Values to Procedure Parameters - PL / SQL

I asked the management company of our system to change the code of some of the neighborhoods of the system, it made that change, now I need to change the code of other districts that are in the system, I know that change is delicate and that the...
asked by 09.04.2014 / 17:19
1
answer

Use the values of an array variable of a procedure in the main routine of the algorithm

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 nome do joga...
asked by 28.07.2018 / 01:10
1
answer

How to create this procedure

I have these two tables in the bank cadcha (Cadastro de chamadas) cadram(Cadastroderamal) Allconnectionsmadetoacertaincompanywillbesavedinthistablecadcha.Thedestinationextensionfieldistheextensionthatansweredormadethisconnection.Ialsohavea...
asked by 17.12.2015 / 16:11
2
answers

Count Script - SQLServer

I have the Telefone table, which records the phones you called. I need to make a script that shows the 'quantity' of the phones they called. if a phone calls more than once does not count. I need to do it via Microsoft SQL SERVER Manageme...
asked by 02.05.2016 / 14:13
1
answer

How to use the current date in a procedure?

Good evening guys. I need help. For you to understand, I'm trying to run a system procedure that asks me for some variables that I can pass them in a fixed way, but one is date. in case the date needs to be of the current day, as I want to sched...
asked by 03.04.2015 / 03:13
1
answer

How to use 'limit' within a MYSQL procedure

Are you talking about beauty? Next, I'm setting up a procedure, where I enter as a parameter the number of rows it will return and if it is 0 or it is blank, it returns all possible rows, however in my logic it is giving syntax error and then...
asked by 15.05.2018 / 22:54