Questions tagged as 'sql'

0
answers

JSON table and SQL Server via PHP

I need a simple filter of values of the column received by JSON and only show the lines that contain this value, json is generated by a php that does a query in SQL. $(document).ready(function () { $('#retrieve-resources').click(functi...
asked by 01.02.2018 / 19:23
0
answers

How to find in SQL what is the primary key of the table?

I'm learning SQL, and I ran into the following problem: I need to know which of the columns is the primary key of the table. Is there a command I can use in SELECT to get a return this information? I've already seen the topic: # It d...
asked by 01.02.2018 / 00:22
1
answer

constraint on a primary key - SQL

I am having a problem understanding what the intent of this code below is when placing a constraint to create a primary key for a foreign key. CREATE TABLE Customer( IdCustomer integer PRIMARY KEY NOT NULL IDENTITY(1,1), NmCustomer v...
asked by 31.01.2018 / 18:38
1
answer

Insert using parameters in the C # application for the Oracle database error: ORA-01036: invalid variable name / number [closed]

I noticed that you have a lot of questions about this error but none solved my case the connection works normally, there is the method Insert (): public bool Insert(ArrayList arrAlunos) { vsql = "insert into ALUNOS_("...
asked by 31.01.2018 / 17:46
0
answers

INSERT IF NOT SQL (PROCEDURE)

I need to create a SQL procedure that does what's down here! -- procura cadastro SELECT id_cadastro FROM c1datasource.tb_cadastro where cpf_cnpj = '12344'; -- se não achou, insere INSERT INTO 'c1datasource'.'tb_cadastro' ('nome', 'cep', 'cpf_...
asked by 01.02.2018 / 15:26
3
answers

Create trigger with update setting field through a function

I want to use a trigger to update the field of a table whenever there is an insert in this table. The problem I'm having in the trigger is that the update does not work, it follows the trigger: CREATE TRIGGER descNF ON tabela1 AFTER...
asked by 07.02.2018 / 01:25
1
answer

SQL / PHP Query

I am trying to query the database in 2 tables and pull the data to page with a condition would be this if the id_noticia of a table is equal to the id of the other when clicking on the image or name goes redirects to the page of the news accordi...
asked by 29.01.2018 / 18:17
1
answer

Error converting date and time Query SQL Server

Well, I'm trying to run the query below, however, the following error is occurring. "Failed to convert string date and / or time.". I have already done some other conversions, but without success. select MesID,Mes,Ano, cast(SUM(DateDiff(MI...
asked by 29.01.2018 / 18:46
0
answers

Delay in executing a file

I have a cents auction script, and there is a PHP file that is responsible for entering the customer's bid when the button is clicked. That is, when the customer clicks the button to bid, it triggers this file and inserts the bid into the pro...
asked by 26.01.2018 / 02:13
0
answers

MySQL Upgrade / MariaDB

Well, I currently use version 10.1 of MariaDB on my server with cPanel. I thought about upgrading to version 10.2 to see if I get a little performance. However, the following warning is displayed for me:    MariaDB enables "strict mode" by...
asked by 26.01.2018 / 01:30