Re: [sqlite] Datatype for prices (1,500)

2016-12-02 Thread Werner Kleiner
@Darren,

my "problem" is, that the both trailing zeros 00 after 1.5 are
missing in sqlite
In MySQL the price is stored as 1.500

I do not undestand exact what you mean with multiply the number?

If I multiply 1.5 x 1 with PHP before storing in sqlite then I get 15000?

best regards
Werner

2016-12-01 11:46 GMT+01:00 Darren Duncan <dar...@darrenduncan.net>:
> Look, you want to store the same level of detail that a decimal(7,4) does?
>
> Easy, you just multiply the conceptual number by 10,000 and it represents
> hundredths of a cent, the exact same precision you are using in MySQL.
>
> Your examples would then be stored as 20 or 8 respectively.  And every other
> possible value you could store in the MySQL you can now store in SQLite,
> consistently.
>
> -- Darren Duncan
>
> On 2016-12-01 12:08 AM, Werner Kleiner wrote:
>>
>> As I can see storing prices is a topic with different ways and
>> different solutions.
>>
>> The advice to store prices in Cent or Integer:
>> Yes you can do: but how will you sore hundredth cents amounts or tenth
>> cent prices?
>> I have prices like 0,0020 or 0,0008 Euro
>>
>> I think I have to manipulate the prices for viewing in the app with PHP.
>> Fact is: we can have to DBs MySQL and SQlite. MySQL with decimal(7,4)
>> stores a price 1.500 from a textfield exact so.
>> If you want to show the price again in the app, there is nothing to do.
>> But switching to SQLite the price is viewed as 1.5 (and stored)
>> I know this is no error of SQLite. But I have now to differ between
>> Sqlite and MySQL and have to optimize the SELECT and adding 00
>> programmatically to view correct if using Sqlite.
>>
>> My original post was if there is a way for both DBs with same
>> behavior, but it seems not.
>>
>> Thanks to all for help.
>
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Datatype for prices (1,500)

2016-12-01 Thread Werner Kleiner
As I can see storing prices is a topic with different ways and
different solutions.

The advice to store prices in Cent or Integer:
Yes you can do: but how will you sore hundredth cents amounts or tenth
cent prices?
I have prices like 0,0020 or 0,0008 Euro

I think I have to manipulate the prices for viewing in the app with PHP.
Fact is: we can have to DBs MySQL and SQlite. MySQL with decimal(7,4)
stores a price 1.500 from a textfield exact so.
If you want to show the price again in the app, there is nothing to do.
But switching to SQLite the price is viewed as 1.5 (and stored)
I know this is no error of SQLite. But I have now to differ between
Sqlite and MySQL and have to optimize the SELECT and adding 00
programmatically to view correct if using Sqlite.

My original post was if there is a way for both DBs with same
behavior, but it seems not.

Thanks to all for help.

Werner





2016-12-01 2:53 GMT+01:00 Keith Medcalf :
>
> Wattage problem based on incoherent understanding of how floating point 
> numbers are stored.
>
> Not an actual problem if you do your comparisons properly:
>
> SQLite version 3.16.0 2016-11-30 05:08:59
> Enter ".help" for usage hints.
> Connected to a transient in-memory database.
> Use ".open FILENAME" to reopen on a persistent database.
> sqlite> CREATE TABLE transactions (amount REAL);
> sqlite> INSERT INTO transactions VALUES (0.1),(0.1),(0.1);
> sqlite> INSERT INTO transactions VALUES (-0.3);
> sqlite> SELECT CASE WHEN (SELECT feq(0, sum(amount)) FROM transactions)
>...> THEN 'zero'
>...> ELSE 'not zero'
>...>END;
> zero
> sqlite>
> sqlite> SELECT sum(amount) FROM transactions;
> 2.77555756156289e-17
> sqlite>
>
> Note that if you do not have a function that does floating-point comparisons 
> properly, you can always do something like this:
>
> sqlite> CREATE TABLE transactions (amount REAL);
> sqlite> INSERT INTO transactions VALUES (0.1),(0.1),(0.1);
> sqlite> INSERT INTO transactions VALUES (-0.3);
> sqlite> SELECT CASE WHEN (SELECT sum(amount) FROM transactions) < 0.005
>...> THEN 'zero'
>...> ELSE 'not zero'
>...>END;
> zero
> sqlite>
> sqlite> SELECT sum(amount) FROM transactions;
> 2.77555756156289e-17
>
> The representational limit of 0 is:
>
> sqlite> select ulp(0);
> 1.11022302462516e-16
>
> which is this far from the sum(amount)
>
> sqlite> select ulps(0, sum(amount)) from transactions;
> -0.25
>
> Note that the IEEE754 value of sum(amount) is less than 1 ulp from 0.0 (1/4 
> ULP in my case, 1/2 ULP in your case).
>
>
>> -Original Message-
>> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org]
>> On Behalf Of Simon Slavin
>> Sent: Wednesday, 30 November, 2016 18:27
>> To: SQLite mailing list
>> Subject: Re: [sqlite] Datatype for prices (1,500)
>>
>>
>> On 30 Nov 2016, at 10:43pm, Keith Medcalf  wrote:
>>
>> >> You were given a good recommendation save everything in "cents". Which
>> >> might also be a good solution depending on the underlying language you
>> >> use. as you can't store money in a float!
>> >
>> > And why can you not store money in a float?
>>
>> Because this:
>>
>> SQLite version 3.14.0 2016-07-26 15:17:14
>> Enter ".help" for usage hints.
>> sqlite> CREATE TABLE transactions (amount REAL);
>> sqlite> INSERT INTO transactions VALUES (0.1),(0.1),(0.1);
>> sqlite> INSERT INTO transactions VALUES (-0.3);
>> sqlite> SELECT CASE WHEN (SELECT sum(amount) FROM transactions) = 0
>> THEN 'zero'
>> ELSE 'not zero'
>>END;
>> not zero
>> sqlite> SELECT sum(amount) FROM transactions;
>> 5.55111512312578e-17
>> sqlite>
>>
>> Please note that this is not just a problem with SQLite.  One can
>> demonstrate the equivalent problem in many programming languages and
>> databases.
>>
>> Simon.
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Datatype for prices (1,500)

2016-11-30 Thread Werner Kleiner
@Simon

<:
> << All you need to store in the database table is the number. How it is
> formatted for viewing or printing is controlled by the user interface.
>
> yes thats right, but it would be nice to have same behavior between
> MySQL and sqlite
> I think to use a char datatype is not a good solution.
>
> 2016-11-30 16:27 GMT+01:00 Rich Shepard :
>> On Wed, 30 Nov 2016, Igor Tandetnik wrote:
>>
>>> Store it as an integer, in $.0001 units. So $1.500 would be represented
>>> simply as an integer 1500.
>>
>>
>>   All you need to store in the database table is the number. How it is
>> formatted for viewing or printing is controlled by the user interface.
>>
>> Rich
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Datatype for prices (1,500)

2016-11-30 Thread Werner Kleiner
<< All you need to store in the database table is the number. How it is
formatted for viewing or printing is controlled by the user interface.

yes thats right, but it would be nice to have same behavior between
MySQL and sqlite
I think to use a char datatype is not a good solution.

2016-11-30 16:27 GMT+01:00 Rich Shepard :
> On Wed, 30 Nov 2016, Igor Tandetnik wrote:
>
>> Store it as an integer, in $.0001 units. So $1.500 would be represented
>> simply as an integer 1500.
>
>
>   All you need to store in the database table is the number. How it is
> formatted for viewing or printing is controlled by the user interface.
>
> Rich
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Datatype for prices (1,500)

2016-11-30 Thread Werner Kleiner
<<:
> On 30 Nov 2016 at 14:42, Werner Kleiner <sqlitetes...@gmail.com> wrote:
>
>> Hello,
>> there is a small application which uses MYSQL db and can also switch to 
>> sqlite
>> In MySQL a table "prices" has a column "basicprice" which is decimal(7,4)
>> I can store a price in form 1.500 there.
>> Same table and same columns in sqlite with datatype float(7,4) stores
>> this value like
>> 1.5
>> It would be nice if there is a way to store in the same way as in
>> MySQL with filling zeros.
>>
>> Is this not possible with sqlite?
>> I also tried type decimal(7,4)
>> Only with 1,500 the zeros are there, but I do not want to store a
>> comma in the db
>
> No such thing as decimal(7,4) in SQLite.
>
> Have a look at:
>
> http://www.sqlite.org/datatype3.html
>
>
> --
> Cheers  --  Tim
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Datatype for prices (1,500)

2016-11-30 Thread Werner Kleiner
Hello,
there is a small application which uses MYSQL db and can also switch to sqlite
In MySQL a table "prices" has a column "basicprice" which is decimal(7,4)
I can store a price in form 1.500 there.
Same table and same columns in sqlite with datatype float(7,4) stores
this value like
1.5
It would be nice if there is a way to store in the same way as in
MySQL with filling zeros.

Is this not possible with sqlite?
I also tried type decimal(7,4)
Only with 1,500 the zeros are there, but I do not want to store a
comma in the db

thank you
regards
Werner
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Warning automatic index on

2016-10-24 Thread Werner Kleiner
The result is:

2015-05-04 19:13:25 850c11866686a7b39d7b163fb60898c11283688e

2016-10-24 14:28 GMT+02:00 Richard Hipp <d...@sqlite.org>:
> Please post the result of the following query:
>
> SELECT sqlite_source_id();
>
> On 10/24/16, Werner Kleiner <sqlitetes...@gmail.com> wrote:
>> I have dropped the double index
>> DROP INDEX 'InternalName';
>> Then executed the SQL Select statement which caused the sqlite warning.
>> But same warning, nothing changed.
>>
>> Then I added a new index CREATE INDEX idx_installid ON ...
>>
>>
>> Now the sqlite warning is gone away. :-)
>>
>> The SQL statement has a JOIN like;
>> ..
>> LEFT JOIN
>> is_mytable H ON H.InstallD = I.InstallD
>>
>> perhaps this was the problem?
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Warning automatic index on

2016-10-24 Thread Werner Kleiner
I have dropped the double index
DROP INDEX 'InternalName';
Then executed the SQL Select statement which caused the sqlite warning.
But same warning, nothing changed.

Then I added a new index CREATE INDEX idx_installid ON ...


Now the sqlite warning is gone away. :-)

The SQL statement has a JOIN like;
..
LEFT JOIN
is_mytable H ON H.InstallD = I.InstallD

perhaps this was the problem?
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Warning automatic index on

2016-10-24 Thread Werner Kleiner
Hello,

In an error log there is a message like:
SQlite warning (284) automatic index on is_mytable(internalvalue)

What does this mean?
Can sqlite not use the index correct?
How can we check or optimize the index?
What do I have to do to cancel the message?

Here is the Table DDL:

-- Table: is_mytable
CREATE TABLE "is_mytable" (
"mytableid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL  ,
"compcid" INT  NULL DEFAULT 0 ,
"installid" INT  NOT NULL DEFAULT 276 ,
"internalvalue" VARCHAR(250)  NOT NULL  COLLATE NOCASE,
"namekey" VARCHAR(250)  NOT NULL DEFAULT 'Document' COLLATE NOCASE,
"textid" INT  NOT NULL  ,"defaultvalue" INT  NOT NULL DEFAULT 0 );

-- Index: InternalName
CREATE INDEX 'InternalName' ON 'is_mytable' (`internalvalue` DESC);

-- Index: OpenUI
CREATE INDEX 'OpenUI' ON 'is_mytable' (`namekey` DESC);

-- Index: idx_mytable_compcid
CREATE INDEX 'idx_mytable_compcid' ON 'is_mytable' (`compcid` DESC);

-- Index: idx_mytable_internalvalue
CREATE INDEX idx_mytable_internalvalue ON is_mytable (internalvalue);

regards
Werner
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Sqlite db version questions

2016-10-11 Thread Werner Kleiner
Hello,
I am a little bit confused about the sqlite db version numbers.

1. On Windows 7 I have created a new db with command
sqlite3.exe test.db3
The sqlite3.exe is from date 2013-05-20 and the version number shows 3.7.17

2. Same computer but now I create a db with sqlite3.exe from 2016-09-12
 sqlite3.exe test1.db3
 The version number now shows 3.14.2

3. I open both db (test.db3 and test1.db3) with sqlitestudio 3.0.6 and do a:
Select sqlite_version(),
Now for both dbs the version number shows 3.8.10

So from what depends the version number? From the tool or program
which opens the db?

If I create a new db like in step 2 where I have version 3.14.2 and I
open it with an old
tool or program, then I cannot use the newer functions and fixes of
the new version?

Can someone please give me a little bit clearness?
thanks
Werner
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database malformed after 6000 Inserts?

2016-10-04 Thread Werner Kleiner
Thanks for help.
Hopefully I give you the correct answer, because a collegue has
written the C# program.
We had no problems with inserts in the past, but now if we have
records about 6000 inserts we get the errors.

The OS is Server 2012, there are no pragma settings (but collegue has
also used with pragma settings)
It is a single thread with "synchronize full"
We use the System.Data.SQLite.dll with version 1.0.89.0 from 12.12.2013

hope this is what you mean

2016-10-04 13:48 GMT+02:00 Jim Borden <jim.bor...@couchbase.com>:
> I had a problem similar to this before. What is the threading model for 
> access to the database and how is the native library compiled and configured?
>
> Jim Borden
> (Sent from a mobile device)
>
>> On 4 Oct 2016, at 19:12, Werner Kleiner <sqlitetes...@gmail.com> wrote:
>>
>> Hello,
>> a program written in C# makes inserts from an SQL script into a sqlite db.
>> We now saw that the database will be malformed after 6000 records.
>>
>> Is there a limitation with huge inserts?
>> What could be the problem?
>>
>> regards
>> Werner
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Database malformed after 6000 Inserts?

2016-10-04 Thread Werner Kleiner
Hello,
a program written in C# makes inserts from an SQL script into a sqlite db.
We now saw that the database will be malformed after 6000 records.

Is there a limitation with huge inserts?
What could be the problem?

regards
Werner
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Database is locked

2016-01-15 Thread Werner Kleiner
Hello Richard,
I am not a SQLITE expert.
As I understand WAL it is especially made for transactions?
But our application do not have transactions, just normal SQL queries like
Select, Insert and Updates.

So does WAL makes sense for that?



2016-01-14 14:20 GMT+01:00 Richard Hipp :

> On 1/14/16, Werner Kleiner  wrote:
> > Hello
> > I have written a small Wep application with PHP (PDO Apache,). This web
> app
> > uses a sqlite db3 database. Also there is a Windows application which
> uses
> > the same database file.
> > Now we heard one time that there war a problem and in a log file we saw
> the
> > error code
> > "Database is locked"
> > My question now is:
> > Could this be a problem when Apache or PHP uses same database and also a
> > windows application?
> > For example if PHP writes to table "users" and windows application reads
> > from "users" at same time?
>
> Set WAL-mode to work around that.  https://www.sqlite.org/wal.html
>
> Also set a busy timeout using "PRAGMA busy_timeout=1;" or similar
> (https://www.sqlite.org/pragma.html#pragma_busy_timeout).
>
> --
> D. Richard Hipp
> drh at sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


[sqlite] Database is locked

2016-01-15 Thread Werner Kleiner
Thanks a lot Simon. Now I understand a little bit better.
Last question: (hopefully :-) )

Takes your suggestion with PDO setAttribute(PDO:: ATTR_TIMEOUT,  the same
effect as Richards with PRAGMA busy_timeout?
For example I do a:

$dbConnection =$db->query('PRAGMA busy_timeout=6') ;

instead of

$dbConnection->setAttribute(PDO:: ATTR_TIMEOUT, 60);

is this the same?

Werner



2016-01-14 16:00 GMT+01:00 Simon Slavin :

>
> On 14 Jan 2016, at 1:42pm, Werner Kleiner  wrote:
>
> > The windows application is written in C# and uses the
> sqlite.systemData.dll.
>
> I'm sure someone here can tell you how to set a timeout in that.
>
> > What does the timeout mean in detail for sqlite ?
> > Is this time (in your example 5 minutes) for each SQL query which is
> > executed?
>
> SQLite contains its own backoff-and-retry procedure for use when the
> database is locked.  By default the timeout value is 0 which means SQLite
> never gets to use it.  But instead you can set a timout value.
>
> Then if SQLite tries the command and finds that the database is locked it
> will sleep a while, try again, sleep a little longer, try again, sleep even
> longer, try again ...  and it will keep doing this until the timeout value
> has been reached.  Only if it is still failing at that time will SQLite
> return SQLITE_BUSY or SQLITE_LOCKED.  At that point the error is final, and
> there's no need to implement your own system for backoff-and-retry.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


[sqlite] Database is locked

2016-01-14 Thread Werner Kleiner
Hello Simon,
thank you for help.
The windows application is written in C# and uses the sqlite.systemData.dll.

What does the timeout mean in detail for sqlite ?
Is this time (in your example 5 minutes) for each SQL query which is
executed?

2016-01-14 14:25 GMT+01:00 Simon Slavin :

>
> On 14 Jan 2016, at 10:57am, Werner Kleiner  wrote:
>
> > I have written a small Wep application with PHP (PDO Apache,). This web
> app
> > uses a sqlite db3 database. Also there is a Windows application which
> uses
> > the same database file.
> > Now we heard one time that there war a problem and in a log file we saw
> the
> > error code
> > "Database is locked"
> > My question now is:
> > Could this be a problem when Apache or PHP uses same database and also a
> > windows application?
>
> Yes.  In both applications you should set a timeout.  The way it is done
> in Windows depends on the language but for PHP PDO use you should set
> PDO::ATTR_TIMEOUT using
>
> <http://php.net/manual/en/pdo.setattribute.php>
>
> Example code:
>
> $dbConnection->setAttribute(PDO:: ATTR_TIMEOUT, 5*60);  // five minutes
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


[sqlite] Database is locked

2016-01-14 Thread Werner Kleiner
Hello
I have written a small Wep application with PHP (PDO Apache,). This web app
uses a sqlite db3 database. Also there is a Windows application which uses
the same database file.
Now we heard one time that there war a problem and in a log file we saw the
error code
"Database is locked"
My question now is:
Could this be a problem when Apache or PHP uses same database and also a
windows application?
For example if PHP writes to table "users" and windows application reads
from "users" at same time?
Or what else can cause this error?

best regards
Werner


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Werner Kleiner


What we use is this:

System.Data.SQLite
System.Data.SQLite Download Page

http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

And this is not part of SQLite?



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/SQLite-Datareader-problems-with-Int-tp75670p75686.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Werner Kleiner
Simon Slavin-3 wrote
>  There is no need to do anything special.  f you use 'Int' in SQLite it
> will be interpreted as 'INTEGER' anyway.  

Yes, but back to my datareader problem it seems that the Datareader differs
between a column which is 'INTEGER' or 'Int'. 
Especially we had a problem with a Int column and value of 13 digits
(1396856032225). The datareader reads the column as a integer 32 value and
breaks or returns wrong values. (or we do something wrong :-) )




--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/SQLite-Datareader-problems-with-Int-tp75670p75684.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Werner Kleiner
What I mean is: The original MySQL DB has columns with int(10). And the
converting tool converts all these columns in SQLite to Int 
I can change the conversion so that all columns would be INTEGER in SQLite.
As I understand for SQLite it is equal if the column is declared as Int or
INTEGER?



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/SQLite-Datareader-problems-with-Int-tp75670p75674.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] General error: 11 malformed database schema - near "'NOCASE'":

2014-05-09 Thread Werner Kleiner
Strange thing is: 
If I connect to this db with PHPLiteadmin it tells me "No Table in Database"
But if I connect on Windows with e.g. Sqlitestudio all is fine.

???



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/General-error-11-malformed-database-schema-near-NOCASE-tp75572p75579.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Storing amount?

2014-05-08 Thread Werner Kleiner
Hmm, but would it not be better to store the value 5 as
5.0 , which would be correct for the decimal point
instead of
5000.0 ?



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Storing-amount-tp75527p75539.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Storing amount?

2014-05-08 Thread Werner Kleiner
>SQLite does not understand column types like "numeric(10,0)".  It has only
two number types: INTEGER and >REAL.

So if the column is datatype REAL and you will store amount 5, SQLite
results in 5000.0 ?
Why not 5.0 ?

And if the columns datatype is REAL, you need a helper tool or script which
adds the ".0" at the end of the amount at PHP server side, if the 
textfield only allows numbers for salary. ?
(if you want to store the correct value)

regards
Werner



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Storing-amount-tp75527p75533.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Storing amount?

2014-05-08 Thread Werner Kleiner
Hello Simon,
thanks for help.

I use the PDO library.
The typeOf results in "real"

If I change the "swsalary" column to "numeric(10,0) it results in integer
and then the value of
5 ist stored correct without . (dot).

So is it better to take datatype "numeric" for storing amounts without dots
or floating points?
(In the textfield I have forbitten to fill in non numeric characters, only
numbers allowed)

regards
Werner



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Storing-amount-tp75527p75529.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users