Questions tagged as 'sql'

2
answers

My if is not working as expected

$mt = $conn->query("SELECT entry_type FROM myTable")->fetchAll(); foreach ($mt as $FB) { if ($FB['entry_type'] == 'pagina'){ echo '<meta property="og:type" content="website">'; } else{ echo '<meta property="og:type" cont...
asked by 25.09.2018 / 23:21
0
answers

Variable is not filled in procedure

Good morning. I'm running the procedure below, which validates whether the load should run or not, and if it is not possible to run, it returns an error message stating why it did not run: declare @dtAtual date, @dtCarga date,...
asked by 27.09.2018 / 16:54
2
answers

Logic to validate free time in agenda

Good evening! I've been stuck for a couple of days in the following situation, I'm not able to parameterize or create an expression that validates interval between dates, which works like this: In other words, if you already have a s...
asked by 17.11.2017 / 01:25
0
answers

How to validate the result of a Case

Validating the result of a Case I'm getting the interval between two dates in days, I want to validate if the result is greater than 120 days, is it a better way I'm doing? DECLARE @DataInicioVigencia datetime; -- ='2018-11-30T00:00:00'; D...
asked by 03.09.2018 / 23:25
1
answer

pass external parameters to sqlcmd via batch

I used it in oracle so I would like to know if you have any similar method for sqlserver (sqlcmd) . Batch sqlplus.exe system/123@localhost/xe @..\CRIA_TABELAS.sql "%last_bill%" .sql file SELECT * FROM TB_VENDAS_&1...
asked by 06.09.2018 / 14:18
1
answer

How to do a query in SQL that brings a count of some results

Next, I'm developing a query in SQL and the purpose of this query is to count the records that reached the value below 99.7% (I have the data for that already calculated and transformed in seconds) but it is not working, and has returned an erro...
asked by 22.09.2018 / 23:22
1
answer

Add row from table B to table A based on conditions

I have two tables of data, they are: table A and table B. I want to join the rows of table B with A under the following conditions: If a line occurs in B and not in A, add it to A. If a row occurs more in B than occurs in A, add it to A until...
asked by 12.09.2018 / 21:12
1
answer

SQL - IN within a SUB SELECT with NOT IN - ORACLE

I wanted to make my INSERT dynamic, which does not require me to change the ids manually. I have this script that returns all PRODUCTS that do not have a relationship with the table EST_PROD_PRECO_CUSTO_EMPRESA SELECT prod.ID_PRODUTO AS "ID...
asked by 12.09.2018 / 20:46
0
answers

Panel to hide elements PHP user page

Good evening, I'm doing a management system for the company and now there has appeared an unanticipated requirement that I need to adjust. Within the administrative page of each client there are buttons that are actually images that when clickin...
asked by 23.08.2018 / 04:18
2
answers

SQL Syntax Error Exception: ORA-00928: SELECT keyword not found

I'm getting this message when trying to run a Stored Procedure created in Oracle:    java.sql.SQLSyntaxErrorException: ORA-00928: SELECT keyword does not   found       at oracle.jdbc.driver.T4CTTIoer.processError (T4CTTIoer.java:447) at   ...
asked by 17.09.2018 / 12:33