• Welcome, Guest. Please login.
 
July 07, 2020, 02:42:15 am

News:

Welcome to the SQLitening support forums!


Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Bern Ertl

16
Quote from: Fredrick Ughimi on July 20, 2019, 08:13:27 pm...
What is the difference SQLiteningProcsA and SQLiteningProcsB?
...

It doesn't matter. 

SQLiteningProcsA
SQLiteningProcsB
SQLiteningProcsC
SQLiteningProcsD
SQLiteningProcsE
SQLiteningProcsF
...
SQLiteningProcsZ


You can use any of them.  SQLitening allows you to organize your server side code libraries into separate files with this naming convention, but there is no difference as to which you use.  It's just for you to organize your code.

I mainly use SQLiteningProcsT and SQLiteningProcsP for my server code.  The "T" library contains server code that is loaded, used and unloaded (ie. "Temporary").  The "P" library contains code that is loaded and stays loaded until the app closes (ie. "Permanent").
17
I believe that you can get the list in one single SQL SELECT statement.  Something like this should work (untested):

WITH Bills(Name,TotalBill) AS (SELECT Surname, Total(Amount) + Total( Quantity * SellingPrice - Discount)
   FROM tblServicesBill
   LEFT OUTER JOIN tblPharmacyBill ON tblServicesBill.Surname = tblPharmacyBill.Surname
   GROUP BY Surname
SELECT Name FROM Bills
   LEFT OUTER JOIN tblPayments ON Bills.Name = tblPayments.Surname
   WHERE TotalBill > Total( tblPayments.Amount)
   GROUP BY Surname
18
I am using SQLitening in conjunction with a grid control (Farpoint's Spread).  I usually add a hidden column or two for each row to save the rowID (and possibly other data) when populating the grid control with data.  When any of the data is edited, it's easy to look up the corresponding rowID and update the database.



19
You've got Questions? We've got Answers! / Re: Audit Trail
September 12, 2018, 09:34:28 am
Yeah, I created a system that allows me to log every SQL statement being executed in a transaction table.  See here:

https://www.sqlitening.planetsquires.com/index.php?topic=3539.msg18054;topicseen#msg18054
20
I just went through this for a few vBulletin forums that I own over the last three days.  Not fun.

I had http://sqlitening.planetsquires.com/support/index.php bookmarked and was getting all kinds of error messages for the last few times I tried to access the forum.  Might be a good idea to either put a simple "hey, we've moved to this URI" page there or set a redirect from that old address to the new index/home page.
21
Fredrick, is SQLitening logging connections to the SQLientingServer.LOG file?  Have you inspected it to verify what connections are being logged?  Is it possible that your application is opening more than one connection (ie. in a threaded function)?
22
Thanks cj.  I missed the single quotes.  That's what I get for replying when I was in a hurry. 
23
slEXE "insert into t1 values(" + sSubject + ") on conflict(c1) do nothing"
24
Based upon Fim's OP, I understood that he wanted to pull a single temperature value from a specific row, but have SQL compare the value to a min and max value (that is known in the code, not the database) and return the comparison results.

If the intention is to pull the MIN and MAX values from a range of rows, there is definitely a more efficient way to do it using SQLite's MIN() and MAX() functions.
25
I think you can use CASE WHEN to do it.  Something like this:

"SELECT (CASE WHEN TEMP < " + FORMAT$( TEMP_MIN) + " THEN TEMP ELSE " + FORMAT$( TEMP_MIN) + " END) AS MinTemp,
            (CASE WHEN TEMP > " + FORMAT$( TEMP_MAX) + " THEN TEMP ELSE " + FORMAT$( TEMP_MAX) + " END) AS MaxTemp
   FROM TEMPERATUR ...
26
Glad it solved the issue.  I've had similar issues in the past so I've gotten into the habit of assigning column aliases now (to expression results) even when I'm not referencing columns by name.
27
I'm not at my programming rig, so I haven't tested your code, but have you tried:

slselAry "select strftime('%Y',c1) AS Col1,strftime('%m',c1) AS Col2,strftime('%d',c1) AS Col3," +_
                 "strftime('%H',c1) AS Col4,strftime('%M',c1) AS Col5,strftime('%S',c1) AS Col6 from t1",sArray()
28
SQLite might work on Apache/Linux, but SQLiteningServer.EXE is a windows service application.  It needs Windows OS.
29
Thanks for the alert.  This new feature looks pretty powerful.
30
Could you post the SQL statement that is being used to update the table that "clears the picture"?