Questions tagged as 'sql'

3
answers

How to obtain the tickets that were opened in the month of May?

I'm working with a database that contains all tickets registered in the otrs of the company where I work. I want to do a query where I return all tickets that were open in May. The problem is that a ticket can be opened and closed...
asked by 16.12.2015 / 12:02
1
answer

Simple example of how to generate an XML file in Oracle

One would have a simple example of a PLSQL Procedure (or documentation location) to generate an XML file based on a Schema (xsd), the data would be generated from an SQL query. In fact files from the RPS of ANS (National Health Agency BR).     
asked by 03.02.2016 / 21:31
2
answers

Pass parameter of type ROWTYPE with the EXECUTE command

I am developing a function in Postgres that aims to retrieve for each record of a query the result value of a scan contained in a set of functions. Of these functions only one will return the correct value. These functions have a common prefix '...
asked by 21.01.2016 / 19:14
1
answer

How to update a datagridview automatically?

I've created an application that will display the data of a given view in a datagridview control. The whole application is ready: loading the data, the button to update and also the events load and activated . Technologie...
asked by 24.05.2016 / 22:24
2
answers

Limit size of VARCHAR2 field in Oracle

I have a column with type VARCHAR2 (4000 CHAR) and I am testing the size limit of the VARCHAR2 field in Oracle. I thought there was a limit of 4000 bytes in the field, even specifying the value 4000 in characters, because that...
asked by 08.07.2016 / 20:26
4
answers

What SQL statement to show the maximum number of active connections to the MySQL database?

What SQL command returns the number of active connections to the database?     
asked by 04.09.2015 / 19:48
3
answers

Why is ':' used in queries?

I was seeing a script in php and I noticed that every time an SQL query was written, this "operator" was used. A part of the code $sql = "INSERT INTO categorias (nome) VALUES(:nome)"; $stmt = DB::prepare($sql); $stmt->bindParam("nome", $...
asked by 25.07.2014 / 17:55
2
answers

Why does max or min return the expected value?

I need to get the highest and lowest value of a certain field to be able to make a filter, only SELECT MAX nor MIN does not work. As you can see in the image below, I need this amount of users Table name: prt_license SELECT MAX(use...
asked by 19.06.2017 / 20:54
2
answers

Problem with quotation marks when doing INSERT SQL

I'm doing a CRUD with PDO, but the prepare () method query only works with "double quotes" Ex (this works): "INSERT INTO '_user' ('firstname') VALUES ('blabla')" That's not how it works: "INSERT INTO '_user' ('firstname') VALUES ('blab...
asked by 15.09.2014 / 20:39
3
answers

How do I adjust my date in my query?

$result_usuario = "SELECT * FROM vendas WHERE DATE(date_created) = '$data' AND tipo_venda = '$tipo_vendas' AND tipo = '$tipo_pagamento' ORDER BY 'id'"; I have this query, but it does not work right because the input that populates t...
asked by 12.12.2018 / 19:57