Posts by Leaonardo Maciel • 334 points
21 posts
-
0
votes2
answers8408
viewsA: How to concatenate the results of a RELATION into a SELECT?
without the database structure gets a little complicated to help you, but anyway try to accomplish this way. select processo.numero , Concat(descricao_parcela.nome,', ', outro_campo) as…
-
0
votes1
answer61
viewsA: How to calculate timestamp in SQL
do not know which DBMS you use I work a lot with Sqlserver 2014 and to perform this procedure of intevalo perform as follows SELECT * FROM users WHERE status >=…
-
1
votes1
answer135
viewsA: Function does not find text in Tedit
I tested and found a problem in its coding in the for part, the components always start at 0 (zero) and not at 1 (one), maybe if the additional dose_text were the first one it would not fall in the…
delphianswered Leaonardo Maciel 334 -
1
votes2
answers67
viewsA: Error making Checkbox Visible
create one where it will go through all components if it is checkbox activate it as follows: for i := 0 to ComponentCount - 1 do begin if Components[i] is TCheckBox then…
-
1
votes1
answer350
viewsA: Change one Lookupcombobox according to another
I have never worked with lookupcombobox but try to do it this way. In the onexit event of the first combo do the following validation if DBLookupComboBox1.listField = 'Brasileira' then begin…
delphianswered Leaonardo Maciel 334 -
0
votes2
answers895
viewsA: Dbcombobox saving Dice
the most correct way would be to click on a button after all the changes or the registration is done where you can perform as follows. query.append; // inclui um novo registro no banco de dados…
delphianswered Leaonardo Maciel 334 -
0
votes3
answers381
viewsA: Loop to make edits invisible
I usually work this way for i := 0 to ComponentCount - 1 do // percore todos os componentes do form begin if Components[I] is TEdit then // se for TEdit begin if (TEdit(Components[i]).name =…
-
0
votes2
answers1166
viewsA: How to create SQLITE BLOB fields with Delphi
to pick up the field type use: query.FieldList.Fields[nro_campo].DataType and Delphi does not return the data type as we are used to (String / varchar, integer, float, etc). You will have to check…
-
2
votes1
answer106
viewsA: How to resolve problems uploading Tidftp to Object-Pascal?
in the Transfertype property which of the two options you selected? Just select ftascii when it is some text file, pas, something like that. Others work with ftBinary, . exe, photos, etc.…
-
2
votes2
answers366
viewsA: Active = False before starting a Delphi application
since college I learned to perform this type of procedure in the Onshow event instead of Oncreate. and another tip that I always use is to leave a standard Datamodule on the server saved and another…
-
1
votes2
answers1129
viewsA: Checklistbox - Select only one record
No, the checklistbox has already been developed to select more than one record. If you need to work with this component and want only one record to be selected you can perform a validation as…
delphianswered Leaonardo Maciel 334 -
0
votes2
answers2571
viewsA: How to improve clientdataset query performance with many records?
the best way would be to optimize the SQL command by placing the smallest possible number of junctions (left or Inner Join). In summary seeking good programming practices and SQL commands. If you…
-
0
votes1
answer879
viewsQ: how to use SQL Server Expressions/Functions in a Tfdquery filter in Delphi
I have the following situation, I need to check if the time of a given task is no longer filled in the system and for this by performing an SQL command in SQL Server 2014 works, as in the example…
-
2
votes2
answers1012
viewsA: Function with return using 'case when'
right to use the case when would be as follows. select case when status = 0 then 'Pedido Ativo' else 'Pedido Inativo' end as Status from pedido where idPedido = @cod) but in this case you have two…
-
1
votes2
answers2827
viewsA: How to know if there is a line selected in Dbgrid?
Yes, it would be if it is painted, but the first record already comes selected. when I want to verify I do so if query.FieldByName(campo_id).AsInteger >= 1 then // procedimento para realizar…
-
-1
votes2
answers435
viewsA: Convert SQL syntax from Firebird database to Postgres database at runtime
I’m putting as an answer because I don’t have enough reputation to comment hehehe put to Victor’s question: "In the WHERE clause of the Firebird UPDATE you have AND FD_SEC = 'LOC' and in Postgre you…
-
0
votes2
answers156
viewsA: Login screen acting incoherent
in the following procedure: procedure TFMLogin.lbl_cadastroClick(Sender: TObject); begin UDM.ADODSLogin.open; UDM.ADODSLogin.Insert; FMCad_Login.showmodal; end; check if your Adodslogin SQL is with…
-
0
votes2
answers2042
viewsA: Remove penultimate character from a string
try to use as follows var tamanho : integer; begin if trim(edit1.text) <> '' then // valida se o edit esta preenchido begin tamanho := Length(edit1.Text); // pega o tamanho da variavel if…
-
2
votes2
answers458
viewsA: Firedac: Getfieldnames without quotation marks
guy I have a data migration system developed and use getfildName to pick up the fields of a particular tambela as follows. fdconnection.GetFieldNames(NomeDoBanco,'',Tabela,'',StringList); And from…
-
1
votes2
answers135
viewsA: Reading Incorrect txt File
I had a similar problem, but I use another way and I recommend you use the split procedure procedure Split(const Delimiter: Char;Input: string; const Strings: TStrings); begin…
delphianswered Leaonardo Maciel 334 -
1
votes2
answers2040
viewsA: Firedac Refresh or Refreshrecord
Try to check if in the event after refresh or before refresh or another event does not call back the inclusion procedure of this record. I particularly work as follows: In the fdquery leave a select…