Henry Olive
Members-
Content Count
284 -
Joined
-
Last visited
Everything posted by Henry Olive
-
Thank you so much Virgo
-
Thank you so much Haentschman, Dany Serge, thank you so much for the time you spent for me.
-
I wish everyone a healthy day. Is there a way get sum of total fields from different tables ? Something like below (SELECT SUM(TOTAL) FROM TABLE1) + (SELECT SUM(TOTAL) FROM TABLE2) + (SELECT SUM(TOTAL) FROM TABLE3) For Example 3 Field's Total Sum RESULT = 12,000.- Thank You
-
Firebird - Sum of total fields from different tables ?
Henry Olive replied to Henry Olive's topic in Databases
Perfect, Thank You SO MUCH Vandrovnik -
I just learnt that ( In this forum ) there is no support FB 4.0 in Delphi so i'm thinking to move to FB 3.0
-
Thank you so much Serge, Vandrovnick Serge, i'm so sorry, you are right, i should have written more info UPRICE = NUMERIC(18,5) QTY =NUMERIC(18,2) I'm trying to execute the sql in FlameRobin ( not yet in Delphi ) with ROUND i get same err.msg. w/o Parenthesis i get same err.msg. I'll try to change DataTypeCompatibility = 3.0 in Firebrid.Conf tonight Again Thank you so much for the time you spent for me.
-
Thank you SO MUCH Serge, Vandrovnik SUBSTRING solves my problem
-
Thank you so much Serge firebird.conf file says below message NOTE: THE EXTERNAL FUNCTION ENGINE FEATURE COULD BE USED TO COMPROMISE # THE SERVER/HOST AS WELL AS DATABASE SECURITY!! # IT IS STRONGLY RECOMMENDED THAT THIS SETTING REMAINS NONE! Any advice to use SUBSTR function ? Thank You
-
I wish everyone a healthy day. I'm trying to move from Interbase to Firebird I cant create below IB Procedure in Firebird ( I made copy in IB-IBConsole and Paste in FB-FlameRobin ) (The proc works well in IB) I'm getting, SQL error code = -104 Unexpected end of command - line 26, column 3 (*Which is SUSPEND*) What is wrong ? Thank You CREATE PROCEDURE "CUSTITEMMOVEMENT" ( "CUSTNO" INTEGER ) RETURNS ( "RNO" INTEGER, "TNAME" VARCHAR(5), "TDATE" DATE, "DOCNO" VARCHAR(12), "QTY" NUMERIC(18, 2), "NETPRICE" NUMERIC(18, 4), "ITEMNO" VARCHAR(20), "ITEMNAME" VARCHAR(40) ) AS BEGIN FOR SELECT IM.RNO,IM.TNAME,IM.TDATE,IM.DOCNO,IM.QTY, IM.NETPRICE,IM.ITEMNO, IT.ITEMNAME FROM ITEMMOVEMENTS IM JOIN ITEMS IT ON IT.ITEMNO=IM.ITEMNO WHERE (IM.CUSTNO= :"CUSTNO") ORDER BY IM.TDATE, IM.DOCNO INTO :"RNO",:"TNAME",:"TDATE",:"DOCNO",:"QTY",:"NETPRICE",:"ITEMNO",:"ITEMNAME" DO SUSPEND; /* Line 26 is here */ END ;
-
Thank you so much Ruslan, Serge Ruslan, with your suggestion i got same error. Serge, Your suggestion is OK now i can create SP. again Thank you
-
I wish everyone a healthy day. I'm planning to move from Interbase to Firebird What is the best admin tool for Firebird ( Free or not Free ) Thank You
-
I wish everyone a healthy day UPDATE TABLE1 T1 SET T1.FIELD1=(SELECT SUM(T2.FIELD1) FROM TABLE2 T2 WHERE T1.ID=T2.ID), T1.FIELD2=(SELECT SUM(T2.FIELD2) FROM TABLE2 T2 WHERE T1.ID=T2.ID) WHERE EXISTS (SELECT 1 FROM TABLE1 T1 WHERE T1.ID= T2.ID); This query works w/o any error but doesnt change the values, what is wrong ? Thank You
-
Thank you so much Mvanrijnen, Danny
-
Oops, Thank you so much Lars
-
Thank you so much everybody answered
-
I wish everyone a heathy day. I have a Memo.Text, if this memo.text starts with SELECT then I'll open myquery like below MyQuery.OPEN if this memo.text starts INSERT or UPDATE or DELETE or CREATE or ALTER then I'll make ExecSql like below MyQuery.EXECSQL; I wrote below code if Pos('SELECT', UpperCase(Trim(Memo1.Text))) > 0 then MyQuery.Open else MyQuery.ExecSql; but if a procedure has FOR SELECT then naturally i'm getting error msg. because the query looks for EXECSQL but finds OPEN Any advice ? Thank You
-
Thank you so much FrostBrutal, Lajos, Remy
-
Thank you so much aehimself, Uwe, Frost.Brutal, Stano, haentschman I'll use this SQL routine in my development not for user. I Think for me the most important thing is if memo1.text starts with SELECT or not if it starts with SELECT then i know it is a Regular Query ( Query.OPEN ) other wise i'll need to use EXECSQL so if it is CTE query or ALTER or CREATE, or DELETE ...... then i'll use EXECSQL My Code will be like below Str := UpperCase(SplitString(Memo1.Text, ' ')[0]); if Str ='SELECT' then Query1.Open else Query1.ExecSql;
-
Thank you so much aehimself. I think i need to find the FIRST WORD of the memo1.text The other words are not important. Because all commands starts with SELECT, CREATE,ALTER,INSERT,DELETE,UPDATE.... May be i should have asked the question like below How can i get THE FIRST WORD of a memo1.text ? Thank you again.
-
Thank you so much David, Lars David i'm so sorry instead off OPEN i mistakely wrote EXECSQL
-
I wish everyone a healthy day. Table-1 (PK = CustNo & ItemNo) CUSTNO...ITEMNO...PRICE 1....................AA..............100 1....................BB...............150 2....................AA..............100 2....................CC..............200 I want to Insert Table-1's all record into a new Table-2 and i dont have any Generator for LINENO. Is it possible to add LINENO field a counter number by Insert Sql ? ( The result for Table-2 should be like below ) Table-2 ( PK=CustNo & LineNo ) CUSTNO...LINENO...ITEMNO...PRICE 1...........................1............AA.............100 1...........................2............BB..............150 2...........................1............AA.............100 2...........................2............CC.............200 Thank You
-
I wish everyone a healthy day. MyDBGrid Looks Like Below ( I used Grouping in Client DataSet ) LINENO...ASSYNO....ITEMNO ------------------------------- 1..................ASSY1...........Item1 2..........................................Item2 3..........................................Item3 Now i need to get which LineNo's MAINASSY is empty ? According to above sample LineNo1'S mainassy is not empty but LineNo2 and LineNo3 are empty I need something like in OnDrawColumnCell event if DBGrid1.Columns[1].Text = '' then ..... Thank You
-
Thank you so much for your kind reply Dany I solved my problem with below code If Table1.FieldByName('ASSYNO').Text <> '' then .... *In case of you use GROUPING in a ClientDataset* with FieldByName(...).TEXT, you can check if there is a value in Dataset but No Text in DBGrid's dataset's same field Again thank you so much.
-
Thank you so much Lajos Field.Value cant be null or Empty because in Dataset it has a value , but it is empty in DBGrid cause of CDS Grouping The field's ONGETTEXT event there is below code if gbFirst in BOM.GetGroupState (1) then Text := Sender.AsString else Text := ''; Dataset Looks like below ASSYNO.....ITEMNO --------------------- Assy1..............ItemNo1 Assy1..............ItemNo2 Assy1..............ItemNo3 But DBGrid looks like (Cause of Grouping) ASSYNO.....ITEMNO --------------------- Assy1..............ItemNo1 ..........................ItemNo2 ..........................ItemNo3 I need Empty Columns that is Line2 and Line3