Re: [sqlite] Keeping Track of Records of IDs in one table. Possible?

2014-01-29 Thread jose isaias cabrera


James K. Lowden wrote...


On Wed, 29 Jan 2014 23:37:43 +
Simon Slavin  wrote:


By the way, once you have this working I would suggest (from my
experience) that you change your database design a little.  Instead
of having a table containing just your open jobs, have a table
containing all jobs, and add a "status" column which can contain
'open', 'paid', and perhaps even other statuses like 'awaiting
payment'.


If closed jobs matter, it can also be nice to use separate tables
after they're closed (or before they're opened) for logical and
physical reasons.

Things that are closed usually have additional attributes e.g. the
close date, by whom, and why.

Because history tends to grow (in a useful database) over time in a
one-table solution active rows become outnumbered by inactive ones.

But, yeah, maybe two tables.  Not a million!


Thanks everyone for the help.  The problem that I have is that I have 
projects that have tasks.  For example:

project 1
   task 1 - File Processing/language de
   task 2 - File Processing/language es
   task 3 - File Processing/language it
   task 4 - Translation/language de
   task 5 - Translation/language es
   task 6 - Translation/language it
   task 7 - Publishing/language de
   task 8 - Publishing/language es
   task 9 - Publishing/language it
project 2
   task 10 - File Processing/language de
   task 11 - File Processing/language es
   task 12 - File Processing/language it
   task 13 - Translation/language de
   task 14 - Translation/language es
   task 15 - Translation/language it
   task 16 - Publishing/language de
   task 17 - Publishing/language es
   task 19 - Publishing/language it
and so forth.  Each of these task have also open/closed as well as the 
project.  For example, task1 belongs to project 1.  Once task 1 is complete, 
then, it becomes complete or closed, but task 2 may still be open.  After 
task 1 is closed, then, task 4 starts rolling and so forth. Also, each tasks 
must have an uniqueID that task has a vendor and has a vendor charge against 
it, so it needs to have an specific ID for the vendor to charge against it 
and we have a unique trace of that task.  We also must keep finances based 
on projects, as well as task, so these tasks must also be connected to a 
ProjID.


I know I have a lot of work to do, but, this indexing are helping a lot. 
Thanks for your loving support. :-)


josé 


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


Re: [sqlite] Keeping Track of Records of IDs in one table. Possible?

2014-01-29 Thread jose isaias cabrera

Simon Slavin wrote...



On 29 Jan 2014, at 10:42pm, jose isaias cabrera  
wrote:



The tables are created this way:
CREATE TABLE OpenProjects (id integer primary key, ProjID integer, 
createDnT, unique(id));
CREATE TABLE OpenJobs (id integer primary key, ProjID integer, Task, 
unique(id));


Thank you for this information which saved many annoying questions.  To 
start off, I agree with what Roman said: using multiple tables for the 
same column layout is almost always a bad idea.



I know I can do,

select * from OpenJobs where ProjID = 2;

and get all the OpenJobs ids that belong to project id 2.  But, this is 
taking a long time.


Have you created a useful index ?  Try doing

CREATE INDEX OjPid ON OpenJobs (ProjID)

Holey moley!  Thanks.


then try your SELECT again.
knocked off 2 minutes now returns all the tasks in less than a second. 
Thanks.  I am going to add some more to the dates.  As also there are dates 
searches and queries that also take a long time.  This should fix the 
problem.


By the way, once you have this working I would suggest (from my 
experience) that you change your database design a little.  Instead of 
having a table containing just your open jobs, have a table containing all 
jobs, and add a "status" column which can contain 'open', 'paid', and 
perhaps even other statuses like 'awaiting payment'.


That's in another table.  :-( I know.  This is a really bad design, but I 
would slowly start making this changes.


Thanks so much!

PS: Read the other response about the whole architectural design... 


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


Re: [sqlite] Keeping Track of Records of IDs in one table. Possible?

2014-01-29 Thread James K. Lowden
On Wed, 29 Jan 2014 23:37:43 +
Simon Slavin  wrote:

> By the way, once you have this working I would suggest (from my
> experience) that you change your database design a little.  Instead
> of having a table containing just your open jobs, have a table
> containing all jobs, and add a "status" column which can contain
> 'open', 'paid', and perhaps even other statuses like 'awaiting
> payment'.

If closed jobs matter, it can also be nice to use separate tables
after they're closed (or before they're opened) for logical and
physical reasons.  

Things that are closed usually have additional attributes e.g. the
close date, by whom, and why.  

Because history tends to grow (in a useful database) over time in a
one-table solution active rows become outnumbered by inactive ones.  

But, yeah, maybe two tables.  Not a million!  

--jkl
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Keeping Track of Records of IDs in one table. Possible?

2014-01-29 Thread Simon Slavin

On 29 Jan 2014, at 10:42pm, jose isaias cabrera  wrote:

> The tables are created this way:
> CREATE TABLE OpenProjects (id integer primary key, ProjID integer, createDnT, 
> unique(id));
> CREATE TABLE OpenJobs (id integer primary key, ProjID integer, Task, 
> unique(id));

Thank you for this information which saved many annoying questions.  To start 
off, I agree with what Roman said: using multiple tables for the same column 
layout is almost always a bad idea.

> I know I can do,
> 
> select * from OpenJobs where ProjID = 2;
> 
> and get all the OpenJobs ids that belong to project id 2.  But, this is 
> taking a long time.

Have you created a useful index ?  Try doing

CREATE INDEX OjPid ON OpenJobs (ProjID)

then try your SELECT again.

By the way, once you have this working I would suggest (from my experience) 
that you change your database design a little.  Instead of having a table 
containing just your open jobs, have a table containing all jobs, and add a 
"status" column which can contain 'open', 'paid', and perhaps even other 
statuses like 'awaiting payment'.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Keeping Track of Records of IDs in one table. Possible?

2014-01-29 Thread Roman Fleysher
Others on the list can give you a better advise. Mine:

If you do not need id column in OpenProjects, get rid of it and make ProjID the 
primary key. Otherwise, create index on ProjID. Either way create index on 
ProjID in OpenJobs. Better, to make ProjID a foreign key in OpenJobs to refer 
to ProjID in OpenProjects.

Multi-table solution is a bad one, even of SQLite can handle it (I think it 
can).

Roman


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of jose isaias cabrera [cabr...@wrc.xerox.com]
Sent: Wednesday, January 29, 2014 5:42 PM
To: General Discussion of SQLite Database
Subject: [sqlite] Keeping Track of Records of IDs in one table. Possible?

Greetings!

I have two tables: OpenProjects and OpenJobs.  OpenJobs have jobs that
belong to one unique project (ProjID).  OpenProjects are projects that have
one project fathers a bunch of jobs.  The design below is found in a localDB
on the user's PC and also on a SharedDB file in a server that another 8
users also connect.  The SharedDB handles the uniqueness of the project ids
as well as the job ids. Also, please excuse my bad design, as this started
out of frustration and need to keep track of projects, etc.

The tables are created this way:
CREATE TABLE OpenProjects (id integer primary key, ProjID integer,
createDnT, unique(id));
CREATE TABLE OpenJobs (id integer primary key, ProjID integer, Task,
unique(id));

OpenProjects has data as such,
1,1,'2011-10-31 23:24:14'
2,2,'2012-12-27 10:56:43'
...
...
123999,123999,'2013-11-26 10:08:53'

lots more data, but, just showing you a little bit...

OpenJobs has data as such,
1,1,'a'
2,1,'b'
3,1,'c'
4,1,'d'
5,2,'z'
6,2,'c'
7,2,'f'
8,1,'g'
9,2,'h'
...
...
1000222,123999,'a'

Lots more data, but just showing you an idea of the sample...

I know I can do,

select * from OpenJobs where ProjID = 2;

and get all the OpenJobs ids that belong to project id 2.  But, this is
taking a long time.Long time means people are complaining and, it should
be much faster, as this is a very small DB (less than 2G).  What I would
like to do, but it does not seem possible or I don't know how to do, is to
have a table that has just the Jobs that belong to one project in one
record.  Now, the number of records in a project varies, so it is not static
(as this may involve multiple languages that have the same tasks, but the
uniqueness is the job id and the language).  I know I can create a table for
each project and push the ids to that table, i.e..

CREATE TABLE p1 (id integer primary key, unique(id));
INSERT OR REPLACE INTO p1 VALUES(select id from OpenJobs where ProjID=1);
CREATE TABLE p2 (id integer primary key, unique(id));
INSERT OR REPLACE INTO p2 VALUES(select id from OpenJobs where ProjID=2)
...
etc.

but that would make the DB with lots of tables and I don't know if Sqlite
can handle millions of tables.  So, is there a way to have one table where
one id (record) has multiple integers as well as variable in number?

Thanks for your help.

josé

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


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


[sqlite] Keeping Track of Records of IDs in one table. Possible?

2014-01-29 Thread jose isaias cabrera


Greetings!

I have two tables: OpenProjects and OpenJobs.  OpenJobs have jobs that 
belong to one unique project (ProjID).  OpenProjects are projects that have 
one project fathers a bunch of jobs.  The design below is found in a localDB 
on the user's PC and also on a SharedDB file in a server that another 8 
users also connect.  The SharedDB handles the uniqueness of the project ids 
as well as the job ids. Also, please excuse my bad design, as this started 
out of frustration and need to keep track of projects, etc.


The tables are created this way:
CREATE TABLE OpenProjects (id integer primary key, ProjID integer, 
createDnT, unique(id));
CREATE TABLE OpenJobs (id integer primary key, ProjID integer, Task, 
unique(id));


OpenProjects has data as such,
1,1,'2011-10-31 23:24:14'
2,2,'2012-12-27 10:56:43'
...
...
123999,123999,'2013-11-26 10:08:53'

lots more data, but, just showing you a little bit...

OpenJobs has data as such,
1,1,'a'
2,1,'b'
3,1,'c'
4,1,'d'
5,2,'z'
6,2,'c'
7,2,'f'
8,1,'g'
9,2,'h'
...
...
1000222,123999,'a'

Lots more data, but just showing you an idea of the sample...

I know I can do,

select * from OpenJobs where ProjID = 2;

and get all the OpenJobs ids that belong to project id 2.  But, this is 
taking a long time.Long time means people are complaining and, it should 
be much faster, as this is a very small DB (less than 2G).  What I would 
like to do, but it does not seem possible or I don't know how to do, is to 
have a table that has just the Jobs that belong to one project in one 
record.  Now, the number of records in a project varies, so it is not static 
(as this may involve multiple languages that have the same tasks, but the 
uniqueness is the job id and the language).  I know I can create a table for 
each project and push the ids to that table, i.e..


CREATE TABLE p1 (id integer primary key, unique(id));
INSERT OR REPLACE INTO p1 VALUES(select id from OpenJobs where ProjID=1);
CREATE TABLE p2 (id integer primary key, unique(id));
INSERT OR REPLACE INTO p2 VALUES(select id from OpenJobs where ProjID=2)
...
etc.

but that would make the DB with lots of tables and I don't know if Sqlite 
can handle millions of tables.  So, is there a way to have one table where 
one id (record) has multiple integers as well as variable in number?


Thanks for your help.

josé 


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


Re: [sqlite] Boolean and DataReader

2014-01-29 Thread Johnny
Simon, 
as I wrote before the native type is numeric.
You're right about typeof showing that type, of course.
But inside sqlite the dump command reads Boolean.
I also confirm that the application is working,
in particular the getBoolean does not throw any exception and
Properly reads the value.
Tell me in case you see anything wrong.
Thanks again.




--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Boolean-and-DataReader-tp73521p73528.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] Boolean and DataReader

2014-01-29 Thread Simon Slavin

On 29 Jan 2014, at 10:19pm, Johnny  wrote:

> Now I'm using the sql browser to create a table column of type numeric
> Boolean.

No you're not.  See section 1.1 of



If some application presents a boolean type to you and then it's being done 
inside that application, and any part of it that isn't working is the fault of 
that application, not SQLite.

To check this out for yourself, inside your application do a

SELECT mycolname, typeof(mycolname) FROM myTable

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Boolean and DataReader

2014-01-29 Thread Johnny
For the sake of clarity.
Now I'm using the sql browser to create a table column of type numeric
Boolean.
Now also my c# DataReader method getBoolean is working fine..
It correctly interprets the type Boolean defined on the sqlite db.
Problem solved, I think :-)



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Boolean-and-DataReader-tp73521p73526.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] pragmas in subselects?

2014-01-29 Thread Petite Abeille

On Jan 29, 2014, at 9:58 PM, big stone  wrote:

> (killing two birds with one stone)

No. One bird only.

Enhancing ‘alter table’ is another kettle of fish altogether.

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


Re: [sqlite] Boolean and DataReader

2014-01-29 Thread Johnny
>From the db standpoint your answer is perfect and you also replied very
quickly, so thank you!
Just of curiosity, who is the developer team (or the support team) of sqlite
software products like sqlite admin or .net data driver? I mean - from the
client connection layer, how can you miss the opportunity to get standard
and consistent behaviour ? SqliteAdmin has the Boolean datatype and the .net
DataReader support the Boolean casting... In any case, thanks again and best
regards :)



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Boolean-and-DataReader-tp73521p73524.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] pragmas in subselects?

2014-01-29 Thread big stone
Would the implementation of a subset of  "Information schema" also allow
the "Alter table" function to work in more (SQL) standard situations ?

(killing two birds with one stone)

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


Re: [sqlite] Boolean and DataReader

2014-01-29 Thread Gerry Snyder

On 1/29/2014 1:08 PM, Johnny wrote:

Sorry, I have again a question about reading a sqlite db from c#.
Suppose you have a simple Boolean column in a table.
I want to use a .net DataReader (connected layer).
My question is:
Why I get a cast exception when calling the getBoolean method (solution A)?
Casting the DataReader to Boolean (solution B) works perfectly.
A) Boolean my_bool = DR.getBoolean(...
B) Boolean my_bool = (Boolean)DR[...
Obviously I can choose B but I would prefer the A programming style.

SQLite does not have a Boolean data type, so it stores the values as an 
integer or a string.

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


[sqlite] Boolean and DataReader

2014-01-29 Thread Johnny
Sorry, I have again a question about reading a sqlite db from c#.
Suppose you have a simple Boolean column in a table.
I want to use a .net DataReader (connected layer).
My question is:
Why I get a cast exception when calling the getBoolean method (solution A)?
Casting the DataReader to Boolean (solution B) works perfectly.
A) Boolean my_bool = DR.getBoolean(...
B) Boolean my_bool = (Boolean)DR[...
Obviously I can choose B but I would prefer the A programming style.
Thank you



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Boolean-and-DataReader-tp73521.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] windows 8.1 cerification - APTCA Check failed

2014-01-29 Thread Scott Robison
On Wed, Jan 29, 2014 at 1:21 AM, Uwe Seibt  wrote:
>
> Dear sirs,
>
> how is it possible to pass the APTCA Check test? Our Application is using
.NET Framework 2.0 and .NET Framework 3.5

I doubt you'll get a lot of feedback on this, as this is the "SQLite
mailing list" not the "Windows .NET Application Certification mailing
list", but I did befriend Google long enough to find the page at
http://msdn.microsoft.com/en-us/library/windows/apps/hh920280.aspx#binscope_1which
says:

> *AllowPartiallyTrustedCallersAttribute*
> *Windows App Certification Kit error message*: APTCACheck Test failed
> The AllowPartiallyTrustedCallersAttribute (APTCA) attribute enables
access to fully trusted code from partially trusted code in signed
assemblies. When you apply the APTCA attribute to an assembly, partially
trusted callers can access that assembly for the life of the assembly,
which can compromise security.
> *What to do if your app fails this test*
> Don't use the APTCA attribute on strong named assemblies unless your
project requires it and the risks are well understood. In cases where it's
required, make sure that all APIs are protected with appropriate code
access security demands. APTCA has no effect when the assembly is a part of
a Windows Store app.
> *Remarks*
> This test is performed only on managed code (C#, .NET, etc.).

I suspect (though I don't know because you did not say) that you received
extra information in your report that indicated that the SQLite .NET
assembly allows partially trusted callers. If that is the case, there are
three possibilities:

One, convince the maintainers to change it (which seems unlikely since it
is probably necessary, but I'll let them decide that);

Two, grab the project source and rebuild it yourself with whatever options
and configuration you need;

Three, take special note of the part under "what to do" that says to not
use that attribute on strong named assemblies "unless your project requires
it and the risks are well understood. In cases where it's required, make
sure that all APIs are protected with appropriate code access security
demands." My reading of this seems to indicate that this message is *not* a
show stopper for becoming Windows certified.

Given the nature of SQLite, designed to embed the ability to access SQL
databases, it seems to me that it is doing exactly what it needs to do
(especially given that the .NET assembly DLL is actually a hybrid interface
[if I understand correctly] that gives both the C# and C level APIs in a
single DLL).
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Fwd: query regarding sqlite

2014-01-29 Thread Clemens Ladisch
Ayush Tripathi wrote:
> i get "SQLite3.Exception: database disk image is malformed" in exception.
> 

This is a duplicate of
.


Regards,
Clemens

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


Re: [sqlite] insert statements with user input in bash script

2014-01-29 Thread Raymond van Daelen
All kind of things.
Tried some version of this 'sql injection' but most variants I tried just give 
an error, or an entry in the table with the value "drop table", or a whole new 
database named: " Robert'); " ! never was the table gone.
But, the scripts will be run in a quite closed environment, and accessed 
normally only be the user who also creates the database (so he will 
predominantly be bothering him/her self).
But a good reminder :)

Raymond


This document is strictly confidential and intended only for use by the 
addressee unless otherwise indicated
Dr. Ir. Raymond A. J. J. van Daelen
Project Manager
KEYGENE N.V.
Bio-Informatics
P.O. Box 216
6700 AE Wageningen
The Netherlands
Tel. (+31) 317 46 68 66
Fax. (+31) 317 42 49 39
Email: raymond.van-dae...@keygene.com
The transmission of messages and/or information via the Internet is not secured 
and may be intercepted by third parties. Keygene assumes no liability if this 
document or its content is intercepted by a third party or becomes publicly 
available.


-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Igor Tandetnik
Sent: Wednesday, January 29, 2014 3:59 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] insert statements with user input in bash script

On 1/29/2014 9:30 AM, Raymond van Daelen wrote:
> Works!

However, see what happens if you type this as user input:

Robert'); DROP TABLE ga_table; --

See also: http://xkcd.com/327/
--
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[http://www.keygene.com/images/maillogo.jpg]








Keygene N.V.
P.O. Box 216
6700 AE Wageningen
The Netherlands
Tel. (+31) 317 46 68 66
Fax. (+31) 317 42 49 39
CoC. 09066631
Web: http://www.keygene.com

The information contained in this message, and attachments if any, may be 
privileged and/or confidential and is intended to be received only by persons 
entitled to receive such information. Use of any part of this message and/or 
its attachments if any, in any other way than as explicitly stated by the 
sender is strictly prohibited. Should you receive this message unintentionally 
please notify the sender immediately, and delete it together with all 
attachments, if any. Thank you.
The transmission of messages and/or information via the Internet is not secured 
and may be intercepted by third parties. KeyGene assumes no liability for any 
damage caused by any unintentional disclosure and/or use of the content of this 
message and attachments if any.

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


Re: [sqlite] insert statements with user input in bash script

2014-01-29 Thread Igor Tandetnik

On 1/29/2014 9:30 AM, Raymond van Daelen wrote:

Works!


However, see what happens if you type this as user input:

Robert'); DROP TABLE ga_table; --

See also: http://xkcd.com/327/
--
Igor Tandetnik

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


Re: [sqlite] insert statements with user input in bash script

2014-01-29 Thread Raymond van Daelen
Works!

Thanks.

Raymond


This document is strictly confidential and intended only for use by the 
addressee unless otherwise indicated
Dr. Ir. Raymond A. J. J. van Daelen
Project Manager
KEYGENE N.V.
Bio-Informatics
P.O. Box 216
6700 AE Wageningen
The Netherlands
Tel. (+31) 317 46 68 66
Fax. (+31) 317 42 49 39
Email: raymond.van-dae...@keygene.com
The transmission of messages and/or information via the Internet is not secured 
and may be intercepted by third parties. Keygene assumes no liability if this 
document or its content is intercepted by a third party or becomes publicly 
available.


-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Igor Tandetnik
Sent: Wednesday, January 29, 2014 2:47 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] insert statements with user input in bash script

On 1/29/2014 8:27 AM, Raymond van Daelen wrote:
> NEWVALUE="$TERM"

Try single quotes:

NEWVALUE='$TERM'

--
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[http://www.keygene.com/images/maillogo.jpg]








Keygene N.V.
P.O. Box 216
6700 AE Wageningen
The Netherlands
Tel. (+31) 317 46 68 66
Fax. (+31) 317 42 49 39
CoC. 09066631
Web: http://www.keygene.com

The information contained in this message, and attachments if any, may be 
privileged and/or confidential and is intended to be received only by persons 
entitled to receive such information. Use of any part of this message and/or 
its attachments if any, in any other way than as explicitly stated by the 
sender is strictly prohibited. Should you receive this message unintentionally 
please notify the sender immediately, and delete it together with all 
attachments, if any. Thank you.
The transmission of messages and/or information via the Internet is not secured 
and may be intercepted by third parties. KeyGene assumes no liability for any 
damage caused by any unintentional disclosure and/or use of the content of this 
message and attachments if any.

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


Re: [sqlite] insert statements with user input in bash script

2014-01-29 Thread Igor Tandetnik

On 1/29/2014 8:27 AM, Raymond van Daelen wrote:

NEWVALUE="$TERM"


Try single quotes:

NEWVALUE='$TERM'

--
Igor Tandetnik

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


[sqlite] insert statements with user input in bash script

2014-01-29 Thread Raymond van Daelen
Ls,

In a bash script I want to get some user input to be stored in a table

#get the user input:

echo -n 'give new value for xxx  :   '
read TERM
NEWVALUE="$TERM"

# now insert into db
sqlite3 $DB.sqlite  "insert into ga_table values (1,$NEWVALUE);"

but then I get an error:

script.sh: line 24: ee: command not found

Where ee is the input given by the user.
Any suggestion as to how I can get the data into the database!

Thanks

Raymond




This document is strictly confidential and intended only for use by the 
addressee unless otherwise indicated
Dr. Ir. Raymond A. J. J. van Daelen
Project Manager
KEYGENE N.V.
Bio-Informatics
P.O. Box 216
6700 AE Wageningen
The Netherlands
Tel. (+31) 317 46 68 66
Fax. (+31) 317 42 49 39
Email: raymond.van-dae...@keygene.com
The transmission of messages and/or information via the Internet is not secured 
and may be intercepted by third parties. Keygene assumes no liability if this 
document or its content is intercepted by a third party or becomes publicly 
available.

[http://www.keygene.com/images/maillogo.jpg]








Keygene N.V.
P.O. Box 216
6700 AE Wageningen
The Netherlands
Tel. (+31) 317 46 68 66
Fax. (+31) 317 42 49 39
CoC. 09066631
Web: http://www.keygene.com

The information contained in this message, and attachments if any, may be 
privileged and/or confidential and is intended to be received only by persons 
entitled to receive such information. Use of any part of this message and/or 
its attachments if any, in any other way than as explicitly stated by the 
sender is strictly prohibited. Should you receive this message unintentionally 
please notify the sender immediately, and delete it together with all 
attachments, if any. Thank you.
The transmission of messages and/or information via the Internet is not secured 
and may be intercepted by third parties. KeyGene assumes no liability for any 
damage caused by any unintentional disclosure and/or use of the content of this 
message and attachments if any.

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


[sqlite] Documentation bug: CAST syntax

2014-01-29 Thread Martijn Pieters
On http://www.sqlite.org/lang_expr.html#castexpr the text reads:

> A CAST expression of the form "CAST( TO )" is used to 
> convert the value of  to a different storage class specified by 
> .

Note the "TO" there; the expression syntax diagram 
(http://www.sqlite.org/syntaxdiagrams.html#expr) correctly shows CAST uses 
"AS". Can the documentation be corrected to read:

> A CAST expression of the form "CAST( AS )" is used to 
> convert the value of  to a different storage class specified by 
> .

instead?

The same syntax error has started to creep into the change log reports too. For 
the 3.8.2 news entry (http://www.sqlite.org/news.html#2013_12_06):

> In other words, CAST(+99.9e99 to INT) would yield -9223372036854775808.
> […]
> Hence, CAST(+99.9e99 to INT) now returns +9223372036854775807.

-- 
Martijn Pieters
www.zopatista.com

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


[sqlite] windows 8.1 cerification - APTCA Check failed

2014-01-29 Thread Uwe Seibt
Dear sirs,

how is it possible to pass the APTCA Check test? Our Application is using .NET 
Framework 2.0 and .NET Framework 3.5


Kind regards

Uwe Seibt

--

Uwe Seibt, Dipl.-Phys.
t +49 (731) 151 899-32 | @ se...@axaris.de | web 
www.axaris.de

axaris - software & systeme GmbH | Lise-Meitner-Str. 14 | 89081 Ulm | 
Deutschland
Geschäftsführer: Michael Volk, Markus Müller, Klaus Baumgartner | Amtsgericht 
Ulm, HRB 36 88
wissenschaftlicher Beirat: Prof. Dr. Franz Schweiggert

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


[sqlite] Fwd: query regarding sqlite

2014-01-29 Thread Ayush Tripathi
Hello,

I'm trying to fetch data from database, my database contains UTF8
characters and when i'm doing so i get "SQLite3.Exception: database disk
image is malformed" in exception.
Getting SQLite3.Exception: database disk image is
malformed


Below is the code:

Please help me out


public ArrayList getDefinations(String query, int column_index)
 {ArrayList words = new ArrayList();MatrixCursor mcursor = null;
 try {Stmt stmt = getDB2().prepare(query);if (stmt.step()) {
stmt.get_cursor().moveToFirst();
mcursor = stmt.get_cursor();try {
mcursor.moveToFirst();
 do {
 words.add(mcursor.getString(column_index));
   } while (mcursor.moveToNext());

 } catch (IndexOutOfBoundsException e) {
 if (MainActivity.logcat_status) {
 Log.e("Error", e + "");
  }
 }}
} catch (Exception e) {
// TODO Auto-generated catch block
if (MainActivity.logcat_status) {
 Log.e("Error", e + "");
   }

 }

This is the query which i'm using

select pos, definition, sample FROM word INNER JOIN sense ON
word.wordid = sense.wordid
 INNER JOIN synset ON sense.synsetid = synset.synsetid LEFT JOIN sample ON
 sample.synsetid = synset.synsetid WHERE lemma = 'life'


Thanks,

Ayush
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users