Posts by Lucas de Souza Cruz • 391 points
17 posts
-
2
votes1
answer1036
viewsA: Remove Duplicates from Two SQL Columns
Follows: SELECT CASE WHEN A = B THEN 'Coluna A igual a B' ELSE 'Coluna A diferente da B' END AS COMPARATIVO_01 FROM TABELA The SELECT above will return all table data (as I have not used the WHERE),…
-
3
votes3
answers860
viewsA: make a select by grouping by year
Follows: SELECT COUNT(*) AS QTD_CLIENTES_CADASTRADOS, EXTRACT(YEAR FROM DATACADASTRO) AS ANO FROM TABELA WHERE EXTRACT(YEAR FROM DATACADASTRO) IN (2016, 2017, 2018) GROUP BY EXTRACT(YEAR FROM…
-
0
votes1
answer117
viewsA: Listview and Aniindicator
I made the code below test and everything worked out, try to use the procedure Application.ProcessMessages during the loop of data loading in the TListView Follows: procedure TesteAniIndicator; var…
-
0
votes1
answer68
viewsA: Error while running script
Apparently you tried to make a conversion of varchar for date which resulted in an invalid date, as per example 30-02-2018. Check predicates and conversions performed in your header SQL involving…
-
4
votes1
answer739
viewsQ: Returning week number of the month
In January this year (2018) I have 5 weeks in the same, being them: 1 week: 1 to 7; 2 week: 8 to 14; 3 week: 15 to 21; 4 week: 22 to 28 and 5 week: 29 to 31 (or 29 to 04 February). When using the…
-
0
votes3
answers422
viewsA: Update in the same table
From what I understand, there’s a clasp missing WHERE in his UPDATE for you to make the desired change, as a suggestion, use a predicate with the date: UPDATE TBL_AULA SET CAMPO_A_ALTERAR =…
sqlanswered Lucas de Souza Cruz 391 -
1
votes1
answer1170
viewsA: Duplicate key in mysql
In a brief research I detected that, the functioning of INSERT Mysql is similar to Postgresql: when there is a ID specified, the database does not update the entered record number, therefore, by…
mysqlanswered Lucas de Souza Cruz 391 -
4
votes4
answers1103
viewsA: SELECT with two results
You can try to force a casein the clause ORDER BY, I already did and would look something like this: SELECT * FROM PESSOA WHERE NOME = 'MARIA' OR NOME != 'MARIA' ORDER BY CASE WHEN ((NOME = 'MARIA')…
-
1
votes1
answer1091
viewsQ: Performing UPDATE on ORACLE using FROM
How to do UPDATE in Oracle records without using a clause IN to change data in bulk? Thus: UPDATE TABELA1 SET DADO = DADO FROM TABELA2 WHERE TABELA1.CODIGO = TABELA2.CODIGO; Currently he me force to…
-
1
votes1
answer352
viewsA: Word as the basis for a report in Delphi that has Detail
I will explain following the logic of reasoning as if we were developing from scratch an impression in Word. First: Have a report template in Word, maybe you put it as a resource of the application…
-
0
votes1
answer3507
viewsA: How and where to create files on Android with Delphi
procedure TForm1.Button1Click(Sender: TObject); var TextFile: TStringList; FileName: string; begin try TextFile := TStringList.Create; try {$IFDEF ANDROID}// if the operative system is Android…
-
0
votes3
answers357
viewsA: How to add parameters in Tdfquerry
There are two ways to do this: One is static, informing on the property Params of date set. The other is through the same line of code, through the command…
-
4
votes2
answers444
viewsA: What are the advantages and disadvantages of creating a Windows service
Just complementing what Maniero said: Maintenance level: Maintaining a service (from my point of view) is as simple as a VCL application. Since service usually runs on one machine only, upgrade…
delphianswered Lucas de Souza Cruz 391 -
0
votes1
answer330
viewsA: Delete master-detail record Tcxgrid
I found the solution: On the estate DataController of Grid Detalhe, there is an option called KeyFieldNames, it should be related to the "ID" field being deleted. Tested and worked 100% right.…
-
2
votes2
answers1468
viewsA: How to use Firebird WITH LOCK with Delphi Firedac
I found in that Firebird documentation, the correct way to use this command. The documentation talks about some precautions when using this command. From what I read in the documentation, it returns…
-
0
votes1
answer330
viewsQ: Delete master-detail record Tcxgrid
Good morning, you guys! Here’s what it is: I set up a grid (Tcxgrid) to have a master (header) and a detail (items) to display grouped information as needed. However, this grid gives the user the…
-
3
votes1
answer3941
viewsQ: Difference between Winexec and Shellexecute
Good morning, you guys! I have a personal question I haven’t found yet, so I come here. What’s the difference between WinExec and ShellExecute at Delphi? I ask this question because recently I had a…