Re: [sqlite] Handling concurrent read request to SQLite

2012-07-29 Thread Navaneeth.K.N
On Thu, Jul 26, 2012 at 11:37 AM, Simon Slavin  wrote:

>
> Have you set a timeout ?  If you haven't the SQLite functions never back
> off and retry when they find the database locked, they just immediately
> return an error.
>

Thanks a lot. I didn't know about this feature. I will give it a try.

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


[sqlite] Unknown module FTS4

2012-07-29 Thread Navaneeth.K.N
Hello,

I have a weird problem.

I am working on a shared library, written using C and a GUI application
written on C++. GUI application uses the shared library. This shared
library uses SQLite amalgamation and links statically. GUI also uses SQLite
for some configuration purpose. It is also statically linked. Both of them
uses latest SQLite version.

My shared library uses FTS4. I have enabled FTS4 by providing the compile
time options while compiling the shared library. All works well with the
shared library. All my tests in the shared library codebase is passing.
Problem happens when I start using this in the GUI program. I am getting
error like, "Unknown module FTS4". This is weird because I have it linked
statically in my shared library and all this GUI program does is to
dynamically link to my library. When I set the FTS compilation options to
the GUI program, error goes away and all works well.

I am not sure why this is happening. Any help would be great!

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


[sqlite] how to process password

2012-07-29 Thread yanhong.ye
I need insert any my bank-card information to sqlite db, so when I insert the 
car number like '3312' and car password like '7711', but I wanna nobody can see 
the password, so I create a function encode('7711','key') and decode(select 
from stable where carnum=3312, 'key') to see the password, the key is like 
'plkey777' to encode or decode the password , but I don't know how to realize 
that. and I have a function to encode and decode :  procode(aa,bb,flag);
char *aa="plkey777";
char *bb="7711";
procode(aa,bb,1);   //here is to encoding the char ,bb result is bb

insert into stable select "3312",bb;


procode(aa,bb,2);//here is to decoding the char ,bb result is bb
select carbumber,procode(aa,bb,2) from stable 

I don't know how to do this. the code upside isPseudo code。
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] open database on Linux. Already db created on Mac.

2012-07-29 Thread Durga D
Hi All,

What is the procedure to open the sqlite3 database file in Linux
Terminal which is already created on Mac.

   Thanks in advance.

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


Re: [sqlite] EXT : Unknown module FTS4

2012-07-29 Thread Black, Michael (IS)
You probably have another shared library in your path that is getting loaded 
first.

Since you said shared library and not DLL I assume you're using Unix of some 
sort?

Run "ldd" on your GUI app and see what library it says it will use.

Also, you should have either strace or truss which can show you which library 
is getting loaded when it runs.

strace myapp &>myapp.log


Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Advanced GEOINT Solutions Operating Unit
Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Navaneeth.K.N [navaneet...@gmail.com]
Sent: Sunday, July 29, 2012 2:17 AM
To: General Discussion of SQLite Database
Subject: EXT :[sqlite] Unknown module FTS4

Hello,

I have a weird problem.

I am working on a shared library, written using C and a GUI application
written on C++. GUI application uses the shared library. This shared
library uses SQLite amalgamation and links statically. GUI also uses SQLite
for some configuration purpose. It is also statically linked. Both of them
uses latest SQLite version.

My shared library uses FTS4. I have enabled FTS4 by providing the compile
time options while compiling the shared library. All works well with the
shared library. All my tests in the shared library codebase is passing.
Problem happens when I start using this in the GUI program. I am getting
error like, "Unknown module FTS4". This is weird because I have it linked
statically in my shared library and all this GUI program does is to
dynamically link to my library. When I set the FTS compilation options to
the GUI program, error goes away and all works well.

I am not sure why this is happening. Any help would be great!

--
-n
___
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


Re: [sqlite] EXT : open database on Linux. Already db created on Mac.

2012-07-29 Thread Black, Michael (IS)
You familiar with the sqlite3 shell?
sqlite-shell here:
http://www.sqlite.org/sqlite-shell-linux-x86-3071300.zip

sqlite3 filename

Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Advanced GEOINT Solutions Operating Unit
Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Durga D [durga.d...@gmail.com]
Sent: Sunday, July 29, 2012 7:14 AM
To: General Discussion of SQLite Database
Subject: EXT :[sqlite] open database on Linux. Already db created on Mac.

Hi All,

What is the procedure to open the sqlite3 database file in Linux
Terminal which is already created on Mac.

   Thanks in advance.

Regards,
___
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


Re: [sqlite] how to process password

2012-07-29 Thread Robert Myers
Encryption is very hard to do right, so in general, let someone else do it.

We use SEE (http://www.hwaci.com/sw/sqlite/see.html) with the key
generated from a password by PBKDF2 and a high number of iterations.
Previously, columns were encrypted with OS functions that made it
impossible to move the database from machine to machine, as well as
really bloating up the data in those columns.

Don't forget to pull the password from secure functions, don't take it
from the command line or getline.

On 7/27/2012 9:50 AM, yanhong.ye wrote:
> I need insert any my bank-card information to sqlite db, so when I insert the 
> car number like '3312' and car password like '7711', but I wanna nobody can 
> see the password, so I create a function encode('7711','key') and 
> decode(select from stable where carnum=3312, 'key') to see the password, the 
> key is like 'plkey777' to encode or decode the password , but I don't know 
> how to realize that. and I have a function to encode and decode :  
> procode(aa,bb,flag);
> char *aa="plkey777";
> char *bb="7711";
> procode(aa,bb,1);   //here is to encoding the char ,bb result is bb
>
> insert into stable select "3312",bb;
>
>
> procode(aa,bb,2);//here is to decoding the char ,bb result is bb
> select carbumber,procode(aa,bb,2) from stable 
>
> I don't know how to do this. the code upside isPseudo code。
> ___
>

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


[sqlite] UNION ALL with queries that have a different number of columns

2012-07-29 Thread Clay Trychta
I've run into a case where a sqlite query I'm expecting to return an
error is actually succeeding and I was wondering if anyone could point
out why this query is valid.

CREATE TABLE test_table(
  k INTEGER,
  v INTEGER
);

INSERT INTO test_table( k, v ) VALUES( 4, 5 );

SELECT * FROM(
  SELECT * FROM(
SELECT k FROM test_table
  )
  UNION ALL
  SELECT * FROM(
SELECT k, v FROM test_table
  )
)

Here is a demo of the above: http://sqlfiddle.com/#!7/0a28f/8

I would think that unioning two selects which have a different number
of columns would return an error. If I remove the outermost SELECT *
then I receive the error I'm expecting: SELECTs to the left and right
of UNION ALL do not have the same number of result columns.

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


Re: [sqlite] UNION ALL with queries that have a different number ofcolumns

2012-07-29 Thread Igor Tandetnik
Clay Trychta  wrote:
> SELECT * FROM(
>  SELECT * FROM(
>SELECT k FROM test_table
>  )
>  UNION ALL
>  SELECT * FROM(
>SELECT k, v FROM test_table
>  )
> )
> 
> I would think that unioning two selects which have a different number
> of columns would return an error. If I remove the outermost SELECT *
> then I receive the error I'm expecting: SELECTs to the left and right
> of UNION ALL do not have the same number of result columns.

Looks like a bug to me, for what it's worth.
-- 
Igor Tandetnik

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