Questions tagged as 'stored-procedures'

1
answer

SQL query to return only if upper case

I would like to make a query in a column and that the return would be only the capitalized words that match the searched criteria (user input), regardless of whether the criteria was typed in uppercase or lowercase. CREATE PROCEDURE uspConsult...
asked by 26.03.2017 / 22:23
2
answers

I need to relate two tables in order to bring me a result within the conditions I want

I'm using SQLSERVER Condition (What the result should return me) · Creation of the agenda. It is necessary to create the flow for creation of agenda and blocking to reserve the vacancies; When crossing data from two tables I need to alloca...
asked by 13.05.2018 / 02:28
1
answer

How to call a "Stored Procedure" oracle c #

I have the following procedure in my bank: I'mtryingtocallmystoreprocedurein.netlikethis:publicintCountEvent(intresourceId,inteventCounterDefinitionId,DateTimestartDate,DateTimestopDate){intret=0;using(OracleConnectionconn=newOracleConnect...
asked by 05.10.2017 / 22:59
1
answer

Add year in my sql search clause

I've set up a procedure that does a search for the number of hours pointed per month of each company official. The procedure works fine, but I noticed that it ends up searching from years past and I would like to add another clause YEAR in this...
asked by 13.09.2017 / 20:37
1
answer

Create a procedure in PostGreSql

I have created a database in PostGreSql of Equipment Allocation where one or many Equipment can be Allocated by one or many Sectors. That is, I have 3 tables in this relation: One is the Table Sector with columns (CODE AND NAME): CREATE TABLE...
asked by 04.09.2017 / 21:01
1
answer

I can not do a function that returns a Semester of a Date in PostgreSQL

I'm trying to do a conversion that returns a semester of a date, but this error appeared here CREATE or REPLACE FUNCTION semestre ( data timestamp ) RETURNS INTEGER AS $$ BEGIN IF data <= 6 THEN return 1; ELSE return...
asked by 16.06.2017 / 14:38
1
answer

How to return output varchar of a procedure in C #?

Error appearing:    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 to int. public stati...
asked by 20.01.2017 / 21:06
2
answers

EntityFramework StoredProcedure retrieve parameter output

How to retrieve the Output parameter of a storedProcedure? SP Example: create PROCEDURE StoreProcedure_Name @ParametterWithNummvalue varchar(50) = null, @In_Parameter varchar(50), @Out_Parameter varchar(10) out AS set...
asked by 29.03.2016 / 03:47
1
answer

Rounding SQL Values in PRINT Command

Good afternoon. An internet exercise asks you to calculate how much time a given investment can pay a debt, both growing at an interest rate per month. Notice the procedure created declare @divida real = 10000 declare @aplicacao real = 1...
asked by 14.01.2016 / 18:42
3
answers

Filters records via datetime and fetch them between a start date and end date

I have the balance table, which always when executing a procedure, is generated a new record in the same, being able to have several record the same day ... However, when I make an appointment, I want to bring only the last record of each da...
asked by 19.06.2015 / 19:57