SQLitening Support Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the SQLitening support forums!

Pages: [1] 2 3 ... 10
 1 
 on: April 24, 2018, 02:14:15 PM 
Started by D. Wilson - Last post by cj
Quote
Currently I am using a log file and posting to the remote server then the local server. It works great and I have a log of all the activity of database transactions.

Current method:
1. Create log file entry
2. Update remote server
3. Update local server

Suggestion:
1. Update local server
2. if successful
      Update SuccessTable(statement,time,' ')
3    Update remote server
4    if successful Update SuccessTable (statement,time,'success')

No processing of log file ever needed on local machine
If a transaction fails on remote server the log file entry is not marked as successful
If the remote server is not available there is no wait for it to process or time-out
Later it would be easy to select * from SuccessTable where status <>  'success' to update remote server

 2 
 on: April 23, 2018, 10:46:44 PM 
Started by D. Wilson - Last post by D. Wilson
Currently I am using a log file and posting to the remote server then the local server. It works great and I have a log of all the activity of database transactions.

I am always open to alternative methods.


 3 
 on: April 23, 2018, 08:49:53 AM 
Started by D. Wilson - Last post by cj
I looked at the site you provided and it looks interesting.
I would have to see it in action before using there service.

1. What is wrong with the way you are doing it now?
Is it too slow or not in real-time which is needed?

2. Are the remote locations keeping separate databases or do they share data?
I keep asking questions because any client can update 1 or more locations at the same time when they are online.

3. Is security being handled by transmitting using AES256 with a MAC?

If all you need is a little server program to read data in any format, I have that.

I can only guess you want an identical copy of 1 or more databases that is not used in real-time.
If used in real-time, I'd have to see how litesync.io does it by patching or updating using SQLite.

I'm looking at there open source code and it doesn't show anything other than sending data.

If all transactions have a unique key or timestamp we can be sure each transaction is applied.
There is even a free cloud service that updates only changes using patching, but that may not be what is wanted.
Still need to know if the data is always in use and by how many different locations.

Quote
I would like to replication a sqlite database at multiple locations.
I have looked online and there are several solutions. However they want all traffic routed through their server.
I like Litesync.io it is bidirectional and offers an 'Airplane' mode.


I want to keep the functionally of the sqlitening server.

Any insights would be greatly appreciated.
Replicate a database from each location to a single location?
If so, keep a different databases on one server and update from each client.
It server is not available processing would be done using a log file.

If this is just a backup then a backup service where you share the password.

http://zonealarm.idrive.com/online-backup-features.htm

There is a limited version with ZoneAlarm.  It might be possible for you to keep
your databases in synch using a cloud service where each location uses a different filename.

Another way is to use rsync xdelta bsdiff  or rtpatch and transmit


 4 
 on: April 22, 2018, 02:04:05 AM 
Started by Fim - Last post by Fim
Thank you for all the tips and advice. Because it's a bit difficult with division with zero, I've decided to go another way. I will ensure that term PRISKVANT is always greater than zero.
/Fim

 5 
 on: April 19, 2018, 05:10:07 PM 
Started by D. Wilson - Last post by D. Wilson
Ideally real time. Currently I have a log file that I process.

look at litesync.io  it looks like it would fit the bill however the way it connects to the database doesn't look like it would work.

 6 
 on: April 19, 2018, 04:40:21 PM 
Started by D. Wilson - Last post by cj
Do you want to copy 1 file (the database) from one server to another server all at once?
Do you want to tranactions from one server to another server after each transaction in real-time?
Do you want to copy the database (1 file) on each computer to the same computer at each location (just backup.)



 7 
 on: April 19, 2018, 04:00:38 PM 
Started by D. Wilson - Last post by D. Wilson
I would like to replication a sqlite database at multiple locations.
I have looked online and there are several solutions. However they want all traffic routed through their server.
I like Litesync.io it is bidirectional and offers an 'Airplane' mode.

I want to keep the functionally of the sqlitening server.

Any insights would be greatly appreciated.

 8 
 on: April 17, 2018, 08:51:13 AM 
Started by Fim - Last post by cj
I had checked "Show WYSIWYG editor on post page" a few days ago.
It is now unchecked in Modify Profile, Look and Layout.

I have gone back and removed fonts and sizes from previous post.
When Jean-Pierre reported it, I looked, but didn't see anything strange here.   I'm now on another machine.

Thanks to both of you for reporting it.   

 9 
 on: April 17, 2018, 07:24:40 AM 
Started by Fim - Last post by Bern Ertl
Nice work cj.  Not sure why your posts are now adjusting the font size to size=2, but I was able to read your post in the message editor after hitting the quote button.

 10 
 on: April 16, 2018, 12:46:28 PM 
Started by Fim - Last post by cj
Quote
SELECT BES_KVANT * PRIS / PRISKVANT FROM IRA
Works as i should, but..
For some records PRISKVANT  is zero.
In that case I will use 1 instead.
But how to put an if-statment in that SELECT-command?
Like  SELECT BES_KVANT * PRIS / (if PRISKVANT = 0 then 1 else PRISKVANT) FROM IRA
Pls, don't say RTM, i have tried.
/Fim   
Different results so FIM has to decide.

Bern appears to handle everything as problem was stated.
His routine will skip invalid input and handles NULL the same as 0.
If negative numbers are allowed his routine can be modified from  > 0  to <> 0.
Each result is correct in its own way of reading the question.

It was not stated in the question if negative,null or real numbers are possible or what to do with a string if it creeps into the mix.
Also shows how a UNION and CAST could be used.

I checked "Show WYSIWYG editor on post page" a few days ago.  It is now unchecked.
Getting rid of invalid font and size statements.


Posted the type of all input then followed it by the answer from each solution and combined into a MSGBOX at the end.
Code: [Select]
'Real added to create table to make it more interesting
'Allowed negative numbers, strings and NULL into input
'Shows logical results using case and cast
GLOBAL gs AS STRING
#INCLUDE "sqlitening.inc"
FUNCTION PBMAIN () AS LONG  'fim3.bas
 LOCAL sql AS STRING
 slopen "sample.db3","C"
 slexe "drop table if exists ira"
 slexe "create table if not exists ira(bes_kvant integer,pris integer,priskvant real)"
 slexe "insert into ira values(1,10,0)"      '1,10
 slexe "insert into ira values(2,20,'Z')"    '2,40
 slexe "insert into ira values(3,30,3.1)"      '3,30
 slexe "insert into ira values(4,40,-4)"     '4,-40
 slexe "insert into ira values(5,50,null)"   '5,250
 gs = CHR$(13,"logical results",13)
 sql =  "select rowid, case "       +_
     "  when cast(priskvant as integer) > 0  then 'greater 0'"  +_
      " when priskvant isnull then 'null'" +_
      " when priskvant < 0    then 'less 0'"     +_
      " when priskvant = 0    then 'zero'"       +_
      " else  'string'"            + _
      " end" +_
      " from ira"
 doit sql


 gs+= CHR$(13,"case and cast",13)
 sql =  "select rowid, case "       +_
     "  when cast(priskvant as integer) > 0  then bes_kvant * pris /priskvant"  +_
      " when priskvant < 0                   then bes_kvant * pris /priskvant"  +_                                  +_
      " else bes_kvant * pris"                   + _
      " end" +_
      " from ira"
 doit sql


 gs+=CHR$(13,"cast union",13)
 sql =  " select rowid, bes_kvant * pris" +_
       " from ira" +_
       " where cast(priskvant as integer) = 0" +_
       " union" +_
       " select rowid, bes_kvant * pris / priskvant" +_
       " from ira" +_
       " where cast(priskvant as integer) > 0" +_
       " union" +_
       " select rowid, bes_kvant * pris / priskvant" +_
       " from ira" +_
       " where cast(priskvant as integer) < 0" +_
       " union" +_
       " select rowid, bes_kvant * pris" +_
       " from ira" +_
       " where priskvant isnull"
 doit sql


 gs+=CHR$(13,"skips null",13)
 sql =  " select rowid, bes_kvant * pris" +_
       " from ira" +_
       " where cast(priskvant as integer) = 0" +_
       " union" +_
       " select rowid, bes_kvant * pris / priskvant" +_
       " from ira" +_
       " where cast(priskvant as integer) > 0 or priskvant < 0"
 doit sql


bern:
 gs+= CHR$(13,"bern",13)
 sql = "SELECT rowid,BES_KVANT * PRIS / (CASE WHEN PRISKVANT > 0 THEN PRISKVANT ELSE 1 END) FROM IRA"
 doit sql


paul:
 gs+= CHR$(13,"paul squires",13)
 sql ="SELECT rowid,BES_KVANT * PRIS / NULLIF(PRISKVANT,0) FROM IRA
 doit sql


jean_paul:
 gs+= CHR$(13,"jean-paul",13)
 sql = "SELECT rowid,CASE PRISKVANT WHEN 0 THEN 1 ELSE BES_KVANT * PRIS / PRISKVANT END FROM IRA"
 doit sql


 ? gs
END FUNCTION

SUB doit(sql AS STRING)
 slsel sql
 DO WHILE slGetRow
  gs+= slf(1) + "," + slf(2) + $CR
 LOOP
END SUB'

Pages: [1] 2 3 ... 10