Re: [sqlite] about merge rows

2014-04-17 Thread mm.w
@hello,

it looks like an old sybase
-ms-flatten-like
export, if I understand well you got that just after splitting then
pivoting the properties, am I wrong?


On Thu, Apr 17, 2014 at 6:43 PM, Igor Tandetnik  wrote:

> On 4/17/2014 9:26 PM, YAN HONG YE wrote:
>
>> I want to merge all the mnote, how to do this?
>>
>
> What do you mean "merge"? What should the table look like afterward?
> --
> Igor Tandetnik
>
>
> ___
> 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] Why sqlite has no sqlite_bind_auto or similary named function

2014-04-17 Thread Max Vlasov
Hi,

The problem was with my program that automatically converts xml data
into an sqilte table. It looks for an attribute and appends a column
if it does not exists, but stating no particular type. All values were
appended with sqlite_bind_text. Everything was fine, but an index
created after this on a ParentId field that was in real life integer
or null, actually appeared text-based. Sure, typeof all inserted
fields appeared to be text.

On the other side for a typeless table
  CREATE TABLE t (value)

Query
  insert into t (value) values (123)
  insert into t (value) values ('text')
  insert into t (value) values (34.45)

finally makes
  select typeof (value) from t

returns
  integer
  text
  real

So it seems like if general queries allow affinity automatical
selection while bind api does not have the corresponent function. I
know that I can analize incoming data myself, but since general
queries use a similar function probably, making some kind of
sqlite_bind_auto should be no big deal. But probably this decision was
deliberate.

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


Re: [sqlite] about merge rows

2014-04-17 Thread Igor Tandetnik

On 4/17/2014 9:26 PM, YAN HONG YE wrote:

I want to merge all the mnote, how to do this?


What do you mean "merge"? What should the table look like afterward?
--
Igor Tandetnik

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


[sqlite] about merge rows

2014-04-17 Thread YAN HONG YE
I have a sqlite table like this:
id  namemnote   
7   DDD_POSTE_DE_COND   
2;AA35469850.1;DDD;ECRHEMBNETM6X100AC8Z;000

2;7903233029.1;;AA35469850.1;DDD;ECRHEMBNETM6X100AC8Z;000

3;9807260277.1;;AA36766417.1;DDD;COMMU-REGU-LIMI-VITE;001

4;9665586177.1;;AA36284384.1;DDD;COMMU-REGU-LIMI-VITE;001

5;9675673177.1;;AA36049484.1;DDD;BLOC-COMMU-COMM-BVMP;003

6;9663123380.1;;AA35651299.1;DDD;ANTENN-ELECTR-TRANSP;001DDD_POSTE_DE_COND


8   ASSISE-BASSEAA34695081  
14;9807054180.1;;AA36305186.1;DDD;BOITIE-SERVIT-INTELL;002

15;9801195980.1;;AA37380334.1;DDD;SUPPOR-BOITIE-SERVIT;000

16;9805077080.1;;AA36701967.1;DDD;BOITIE-COMMAN-CLIMAT;003

17;9804790880.1;;AA36696339.1;DDD;CAPT-DET-CHO-MOY-RET;001

18;9804790880.1;;AA36696338.1;DDD;CAPT-DET-CHO-MOY-RET;001


9   FAISCEAUX-ELEC-PDC  
1;9807698080.1;;AA35538582.1;DDD;GOUT-TAB-INF-FAI-HAB;000

2;9803453480.1;;AA35574764.1;DDD;GOUTT-TUNN-FAIS-HABI;000

3;9803453480.1;;AA35538573.1;DDD;GOUTT-TUNN-FAIS-HABI;000

4;9681595580.1;;AA36168981.1;DDD;ECR-HXEMBBOR5X160PLA;002

5;9681595580.2;;AA36168981.1;DDD;ECR-HXEMBBOR5X160PLA;002

6;967352338A.1;;AA35568067.1;DDD;MODU-LOC-ALA-ANT-VOL;004

I want to merge all the mnote, how to do this?

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


Re: [sqlite] Bug Report

2014-04-17 Thread Jim Dodgen
Ryan, The late Grace Hopper would be happy about your responce

*Jim Dodgen*








On Thu, Apr 17, 2014 at 10:40 AM, RSmith  wrote:

> That is just the compiler trying to be helpful without being able to
> completely grasp the code and can safely be ignored, but thank you for the
> notice and feel free to initialize the variable in your version.
>
> As an aside, that does not qualify as a "bug", the word "bug" means a
> whole other thing - which I am not going to elaborate on since I'm sure it
> was just a thought and not an actual contention.
>
> Have a great day!
> Ryan
>
>
> On 2014/04/17 18:23, jalal Mostafa wrote:
>
>> Hey,
>> I downloaded the "Legacy Source Code Distribution Formats -
>> sqlite-preprocessed-3080403.zip", while compiling in Microsoft Visual
>> Studio 2013 a bug appeared in file "fts3_tokenize_vtab.c","error C4703:
>> potentially uninitialized local pointer variable 'pTab' used"
>> Line:203.Assigning the pointer to NULL will solve the problem.
>> Sincerely,Jalal.
>>
>>
>> ___
>> 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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] field length retreval

2014-04-17 Thread Simon Slavin

On 17 Apr 2014, at 11:24pm, David Clark  wrote:

> If I have a table of 
> field1 varchar(25)
> field2 varchar(50)
> field3 varchar(75)

You don't.  SQLite does not support a datatype of varchar().  Fields you 
declare like that will be implemented as TEXT fields and handled the same as 
any other TEXT field, and the length of the contents ignored.

> I know sqlite does not enforce limits, but in my program it would be useful 
> if I could find the declared lengths of
> 25, 50 and 75 in this case.  How might I do that in sqlite?

Technically you could retrieve and parse the CREATE command used to make the 
TABLE and figure them out.  But since they aren't going to be enforced there's 
little point.

There are ways to enforce field length limits entirely within SQLite but 
they're complicated so post again if you want me to explain TRIGGERs.

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


Re: [sqlite] field length retreval

2014-04-17 Thread Igor Tandetnik

On 4/17/2014 6:24 PM, David Clark wrote:

If I have a table of
field1 varchar(25)
field2 varchar(50)
field3 varchar(75)

I know sqlite does not enforce limits, but in my program it would be useful if 
I could find the declared lengths of
25, 50 and 75 in this case.  How might I do that in sqlite?


Prepare a SELECT statement selecting these columns (you don't need to 
actually run it), and call sqlite3_column_decltype[16] for each column. 
That gives you raw text from the original CREATE TABLE statement. You 
can use "select * from mytable;" to do that for all columns (complete 
with sqlite3_column_name[16]).

--
Igor Tandetnik

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


[sqlite] field length retreval

2014-04-17 Thread David Clark
If I have a table of 
field1 varchar(25)
field2 varchar(50)
field3 varchar(75)

I know sqlite does not enforce limits, but in my program it would be useful if 
I could find the declared lengths of
25, 50 and 75 in this case.  How might I do that in sqlite?

Thank you,
David Clark
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] The execute command

2014-04-17 Thread aperi2007

Thx for hint.

I see also the RSmith contribute.


This is not only impossible in the current SQLite implementation, it is also 
inconceivable.  By that I mean that the query output
can be of any form, there is no way a prepare statement can know before-hand 
what the query would look like, it might not even be a
SELECT as you point out.  Let's say the format issue is overcome, whereto will 
errors in the secondary query be reported? And would
the secondary query be able to refer to another in-table-pre-saved query? If so 
a infinite loop may quickly arise.

You could of course implement it given you know exactly what to expect from the 
Queries, I believe it is even done somewhere - but
you'd have to do something like this (pseudo coded for brevity):


Effectively the most useful usecase scenario for an EXECUTE is when
the queries are to build other tables and insert into them.

AFAIK if the dynamic queries are CREATE, INSERT , DELETE.
They return always 1 only value.
I guess a SELECT query is not so useful in a dinamical scenario but if 
needed the select query could have its records redirected on a third 
table to allow return from the EXECUTE always 1 only value (1/0 - 
successful/unsuccesful).


Many thx,

Andrea Peri.


On 17/04/2014 20:47, Richard Hipp wrote:




On Thu, Apr 17, 2014 at 2:43 PM, aperi2007 > wrote:


Hi to all,

There is in sqlite a command to run a query build at runtime ?



Not built-in.  But you can add your own.  See 
http://www.sqlite.org/src/artifact/d3013ce36f19ac72?ln=289-319 for an 
example function that does this that we use for testing.



Our use-case is a list of query build from a sql script and stored
in a table.

something like this:

select EXECUTE([field_query]) from table1;

where "table1" is the table and "field1" is the field where the
builded query was previous stored.

the queries could be of kind "create ...", "insert ...", "update
" and so on.

Thx,

Andrea Peri.

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




--
D. Richard Hipp
d...@sqlite.org 


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


Re: [sqlite] The execute command

2014-04-17 Thread RSmith


On 2014/04/17 20:43, aperi2007 wrote:

Hi to all,

There is in sqlite a command to run a query build at runtime ?

Our use-case is a list of query build from a sql script and stored in a table.

something like this:

select EXECUTE([field_query]) from table1;

where "table1" is the table and "field1" is the field where the builded query 
was previous stored.

the queries could be of kind "create ...", "insert ...", "update " and so 
on.



This is not only impossible in the current SQLite implementation, it is also inconceivable.  By that I mean that the query output 
can be of any form, there is no way a prepare statement can know before-hand what the query would look like, it might not even be a 
SELECT as you point out.  Let's say the format issue is overcome, whereto will errors in the secondary query be reported? And would 
the secondary query be able to refer to another in-table-pre-saved query? If so a infinite loop may quickly arise.


You could of course implement it given you know exactly what to expect from the Queries, I believe it is even done somewhere - but 
you'd have to do something like this (pseudo coded for brevity):



mResult = RunSelectQuery('SELECT field_query FROM table1');
if (mResult != Error) {
  mResult = Execute(mResult); //[1]
}
...

[1] <-- Of course at this point you need to parse the sql a bit to know what 
kind of query result is expected, if any...




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


Re: [sqlite] The execute command

2014-04-17 Thread Richard Hipp
On Thu, Apr 17, 2014 at 2:43 PM, aperi2007  wrote:

> Hi to all,
>
> There is in sqlite a command to run a query build at runtime ?
>


Not built-in.  But you can add your own.  See
http://www.sqlite.org/src/artifact/d3013ce36f19ac72?ln=289-319 for an
example function that does this that we use for testing.


>
> Our use-case is a list of query build from a sql script and stored in a
> table.
>
> something like this:
>
> select EXECUTE([field_query]) from table1;
>
> where "table1" is the table and "field1" is the field where the builded
> query was previous stored.
>
> the queries could be of kind "create ...", "insert ...", "update " and
> so on.
>
> Thx,
>
> Andrea Peri.
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


[sqlite] The execute command

2014-04-17 Thread aperi2007

Hi to all,

There is in sqlite a command to run a query build at runtime ?

Our use-case is a list of query build from a sql script and stored in a 
table.


something like this:

select EXECUTE([field_query]) from table1;

where "table1" is the table and "field1" is the field where the builded 
query was previous stored.


the queries could be of kind "create ...", "insert ...", "update " 
and so on.


Thx,

Andrea Peri.

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


Re: [sqlite] about the apparently arriving soon "threads"

2014-04-17 Thread big stone
Hi James,

You're right :  my example is indeed a "4 independant process" rather than
"4 threads in the same process".

The job I need to do is unchanged : transform a big input table in a big
output table.

I hope that SQlite improvements will allow us to approach this "2x" (or
more) boost in the future, without the pain of managing parallelisation
outside of SQL.

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


Re: [sqlite] Bug Report

2014-04-17 Thread RSmith
That is just the compiler trying to be helpful without being able to completely grasp the code and can safely be ignored, but thank 
you for the notice and feel free to initialize the variable in your version.


As an aside, that does not qualify as a "bug", the word "bug" means a whole other thing - which I am not going to elaborate on since 
I'm sure it was just a thought and not an actual contention.


Have a great day!
Ryan

On 2014/04/17 18:23, jalal Mostafa wrote:

Hey,
I downloaded the "Legacy Source Code Distribution Formats - sqlite-preprocessed-3080403.zip", while 
compiling in Microsoft Visual Studio 2013 a bug appeared in file "fts3_tokenize_vtab.c","error 
C4703: potentially uninitialized local pointer variable 'pTab' used" Line:203.Assigning the pointer to 
NULL will solve the problem.
Sincerely,Jalal.


___
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] Bug Report

2014-04-17 Thread jalal Mostafa
Hey,
I downloaded the "Legacy Source Code Distribution Formats - 
sqlite-preprocessed-3080403.zip", while compiling in Microsoft Visual Studio 
2013 a bug appeared in file "fts3_tokenize_vtab.c","error C4703: potentially 
uninitialized local pointer variable 'pTab' used" Line:203.Assigning the 
pointer to NULL will solve the problem.
Sincerely,Jalal.

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


Re: [sqlite] sqlite dump makes wrong "CREATE VIEW" order

2014-04-17 Thread Simon Slavin

On 17 Apr 2014, at 3:42pm, Igor Tandetnik  wrote:

> If there's a bug anywhere in this, I'd say it's the fact that SQLite allowed 
> "DROP VIEW v2" statement to proceed.

Agreed.  Is there a similar bug if you try to drop a table that a FOREIGN KEY 
depends on ?

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


Re: [sqlite] sqlite dump makes wrong "CREATE VIEW" order

2014-04-17 Thread Gerry Snyder

On 4/17/2014 12:43 AM, Tyumentsev Alexander wrote:

sqlite in some cases dumps views in wrong order.



Interesting situation. My take on it would be that dump is a simple 
little tool designed to help move a database file from one place to 
another. In tricky situations, some editing of its output may be needed.


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


Re: [sqlite] cannot set connection while a datareader is active

2014-04-17 Thread Stefano Ravagni

Il 16/04/2014 22.33, Joe Mistachkin ha scritto:

Stefano Ravagni wrote:

Joe i cannot find the way for follow the command object properties you
saycould you tell me what and how to observe exactly please ?


You might need to add the System.Data.SQLite project(s) to the solution in
order
to be able to see full debugging information for them.

I recommend adding the "System.Data.SQLite.20XX.csproj" and
"SQLite.Interop.20XX.vc[x]proj" projects that correspond to the version of
Visual
Studio you are using.

Then, you'll want to reset the reference to point to the project instead of
the
built assembly.

--
Joe Mistachkin

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


Joe, today i tryed Devart SQLite DotConnect and i have not this problem...

From last week, i made many tests on my code, but remain one fact i 
have this problem only with Sqlite .net library...
I use only one datareader and is not possible it say me that i have one 
datareader active when debugger say me datareader is closed (as you seen)...


I think with more force that could be an error in your datareader check 
routine that cause this problem but i'm not able to demostrate to you...


Think you we could try to solve togheter ? Could be a particular sql 
query to generate this error ? I'm not able to make test including 
project, i never do this and i don't know how to do...


I like to integrate your library in my project but i have to resolve 
this strange errorThanks for your patience...

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


Re: [sqlite] sqlite dump makes wrong "CREATE VIEW" order

2014-04-17 Thread Igor Tandetnik

On 4/17/2014 3:43 AM, Tyumentsev Alexander wrote:

CREATE VIEW v2 as select id1 from test where id1;
CREATE VIEW v1 as select t1.id2 from test as t1 LEFT JOIN v2 ON
t1.id2=v2.id1;
DROP VIEW v2;

Is it the user responsibility to follow all dependencies and recreate
"VIEW" tree ?


I'd say it's the user's responsibility to not drop a view that is being 
referred to elsewhere. If there's a bug anywhere in this, I'd say it's 
the fact that SQLite allowed "DROP VIEW v2" statement to proceed.

--
Igor Tandetnik

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


Re: [sqlite] sqlite dump makes wrong "CREATE VIEW" order

2014-04-17 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 17/04/14 00:43, Tyumentsev Alexander wrote:
> Is it the user responsibility to follow all dependencies and recreate 
> "VIEW" tree ?

The dumping is happening in the order that the views were created.  This
approach generally works, but fails in your example where you created
another view of the same name.  (There are some other edge cases where you
could create circular links between views.)

I can't see any way of resolving your issue since there is no general SQL
parser which is what would have to be run to work out dependency order.

Roger



-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iEYEARECAAYFAlNP58cACgkQmOOfHg372QT0RwCg5gXqYYmQ0Ws1LqJaFBhdpvwJ
dLAAn2+8hvf+nl9jTR45Z2TYQsT6mAlB
=APvL
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] detach failed with error code 1

2014-04-17 Thread Richard Hipp
On Thu, Apr 17, 2014 at 9:08 AM, dd  wrote:

> Dear Richard,
>
>   This is great api.
>
>   output:
>
>   (1) statement aborts at 5: [DETACH my_in_memory_db;] database
> my_in_memory_db is locked
>

The DETACH failed because you have unfinalized statements using the
attached database and you cannot detach a database file out from under a
statement that is using that database file.  Because the DETACH failed,
subsequent ATTACH statements cannot succeed because there would be a name
conflict.



>   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> my_in_memory_db;] database my_in_memory_db is
> already in use
>   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> my_in_memory_db;] database my_in_memory_db is already in use
>   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> my_in_memory_db;] database my_in_memory_db is already in use
>   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> my_in_memory_db;] database my_in_memory_db is already in use
>
>   there is a detach for every attach.  What could be the solution for this?
>
> Thanks,
> dd
>
>
>
>
> On Thu, Apr 17, 2014 at 2:58 PM, Richard Hipp  wrote:
>
> > Please turn on error logging (http://www.sqlite.org/errlog.html) and
> > report
> > back what error messages you are seeing.
> >
> >
> > On Thu, Apr 17, 2014 at 6:47 AM, dd  wrote:
> >
> > > Hi All,
> > >
> > >   1. prepare, step, then finalize: Attach DATABASE '/full/path' as
> > > 'my_in_memory_db';
> > >   2. prepare, step, then finalize: Delete from my_in_memory_db.table_1
> > > where primary_key = 'value';
> > >   3. prepare, step, then finalize: DETACH my_in_memory_db;
> > >
> > >   Executed above three queries in loop for 100 times for empty database
> > > (/full/path). It's throwing sqlite error 1 at some random iteration. Is
> > it
> > > correct way to implement attach and detach dbs?
> > >
> > > Thanks,
> > > dd.
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> >
> >
> >
> > --
> > D. Richard Hipp
> > d...@sqlite.org
> > ___
> > 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
>



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


Re: [sqlite] detach failed with error code 1

2014-04-17 Thread dd
Dear Richard,

  This is great api.

  output:

  (1) statement aborts at 5: [DETACH my_in_memory_db;] database
my_in_memory_db is locked
  (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
my_in_memory_db;] database my_in_memory_db is
already in use
  (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
my_in_memory_db;] database my_in_memory_db is already in use
  (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
my_in_memory_db;] database my_in_memory_db is already in use
  (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
my_in_memory_db;] database my_in_memory_db is already in use

  there is a detach for every attach.  What could be the solution for this?

Thanks,
dd




On Thu, Apr 17, 2014 at 2:58 PM, Richard Hipp  wrote:

> Please turn on error logging (http://www.sqlite.org/errlog.html) and
> report
> back what error messages you are seeing.
>
>
> On Thu, Apr 17, 2014 at 6:47 AM, dd  wrote:
>
> > Hi All,
> >
> >   1. prepare, step, then finalize: Attach DATABASE '/full/path' as
> > 'my_in_memory_db';
> >   2. prepare, step, then finalize: Delete from my_in_memory_db.table_1
> > where primary_key = 'value';
> >   3. prepare, step, then finalize: DETACH my_in_memory_db;
> >
> >   Executed above three queries in loop for 100 times for empty database
> > (/full/path). It's throwing sqlite error 1 at some random iteration. Is
> it
> > correct way to implement attach and detach dbs?
> >
> > Thanks,
> > dd.
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> 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] Why my question are not visibile in this group ?

2014-04-17 Thread Clemens Ladisch
Stefano Ravagni wrote:
> Why my question are not visibile in this group ?

Because this is not a group, it is a mailing list.

Apparently, Google's archive stopped updating in 2012.
If you want to know why Google Groups doesn't work, ask Google.


Every single post in this list has a footer with the real mail
address and a link to a web page explaining things.


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


Re: [sqlite] Why my question are not visibile in this group ?

2014-04-17 Thread Sean Dzafovic
On Wed, Apr 16, 2014 at 3:13 PM, Stefano Ravagni
wrote:

> Why my question are not visibile in this group ?
>
> I send question but never see published... i have many difficult to
> understand the way of support for Sqlite ...
>
>
With Gmail you won't see your original post to a mailing list. But it does
make it.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite dump makes wrong "CREATE VIEW" order

2014-04-17 Thread Tyumentsev Alexander
sqlite in some cases dumps views in wrong order.

how to reproduce on linux:

1) Make the test database with 2 "view". v1 depends on v2. Recreate v2
cat <<_EOF_ | sqlite3 test.sqlite
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE test ( "id1" integer(8,0), "id2" integer(8,0), "id3"
integer(8,0) );
CREATE VIEW v2 as select id1 from test where id1;
CREATE VIEW v1 as select t1.id2 from test as t1 LEFT JOIN v2 ON
t1.id2=v2.id1;
DROP VIEW v2;
CREATE VIEW v2 as select id1 from test where id1;
COMMIT;
_EOF_

2) Dump the base
sqlite3 test.sqlite .dump > test.sqlite.dump
cat test.sqlite.dump
  =>
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE test ( "id1" integer(8,0), "id2" integer(8,0), "id3"
integer(8,0) );
CREATE VIEW v1 as select t1.id2 from test as t1 LEFT JOIN v2 ON
t1.id2=v2.id1;
CREATE VIEW v2 as select id1 from test where id1;
COMMIT;

Here "CREATE VIEW v1" and "CREATE VIEW v2" placed in wrong order.

3) try to restore
cat test.sqlite.dump | sqlite3 test2.sqlite
 =>
Error: near line 4: no such table: main.v2


Is it the user responsibility to follow all dependencies and recreate
"VIEW" tree ?

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


[sqlite] Why my question are not visibile in this group ?

2014-04-17 Thread Stefano Ravagni
Why my question are not visibile in this group ?

I send question but never see published... i have many difficult to 
understand the way of support for Sqlite ...
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] detach failed with error code 1

2014-04-17 Thread Richard Hipp
Please turn on error logging (http://www.sqlite.org/errlog.html) and report
back what error messages you are seeing.


On Thu, Apr 17, 2014 at 6:47 AM, dd  wrote:

> Hi All,
>
>   1. prepare, step, then finalize: Attach DATABASE '/full/path' as
> 'my_in_memory_db';
>   2. prepare, step, then finalize: Delete from my_in_memory_db.table_1
> where primary_key = 'value';
>   3. prepare, step, then finalize: DETACH my_in_memory_db;
>
>   Executed above three queries in loop for 100 times for empty database
> (/full/path). It's throwing sqlite error 1 at some random iteration. Is it
> correct way to implement attach and detach dbs?
>
> Thanks,
> dd.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


[sqlite] detach failed with error code 1

2014-04-17 Thread dd
Hi All,

  1. prepare, step, then finalize: Attach DATABASE '/full/path' as
'my_in_memory_db';
  2. prepare, step, then finalize: Delete from my_in_memory_db.table_1
where primary_key = 'value';
  3. prepare, step, then finalize: DETACH my_in_memory_db;

  Executed above three queries in loop for 100 times for empty database
(/full/path). It's throwing sqlite error 1 at some random iteration. Is it
correct way to implement attach and detach dbs?

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