Re: [sqlite] How to determine player's leaderboard rank efficiently?

2014-08-26 Thread Donald Griggs
>
>
> Regarding:
>


> WITH RECURSIVE
>x(y) AS (VALUES(1) UNION ALL SELECT y+1 FROM x WHERE y<1000)
> INSERT INTO player SELECT printf('Player%d',i), i, random(), NULL FROM x;
>
>
> If anyone's "playing along at home" I wondered if instead of:
   ... printf('Player%d',i), i, random(),...
what might have been intended was
   ... printf('Player%07d',y), random(),...
(i.e., with the "i" replaced with "y" in the printf, the additional "i"
removed, and the printf format allowing the final value of 'Player100'.)

So that the modified sql is:

WITH RECURSIVE

   x(y) AS (VALUES(1) UNION ALL SELECT y+1 FROM x WHERE y<10)

INSERT INTO player SELECT printf('Player%07d',y), random(), NULL FROM x;
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Edinburgh Buses

2014-08-26 Thread Igor Tandetnik

On 8/26/2014 5:39 PM, Errol Emden wrote:

I have taken a different approach to the solution to this problem. Instead of 
paring the self-joins I have cross-joined the tables in pairs as follows:
SELECT distinct R1.num, R1.company, S1.name, R2.num, R2.company
FROM stops S1, stops S2, route R1, route R2
WHERE S1.name='Craiglockhart' AND S2.name='Sighthill'
 AND R1.stop=S1.id AND R2.stop=S2.id;


Actually, it's more complicated. I just realized that routes may have 
multiple stops: there's a row in the "route" table for each stop on the 
route, not just one for each route. Bad design by the way; you may want 
to normalize it better. For one thing, you have to repeat route number 
and company name for each stop. You probably want routes(routeNum, 
company) and stopsOnRoute(routeNum, stopId, pos).


Anyway, you need to join with route four times - once for each stop on 
each route (there are three stops we care about, but the middle one is 
visited by two routes). Something like this:


SELECT StartOfR1.num, StartOfR1.company, EndOfR2.num, EndOfR2.company
FROM stops Start, stops Finish, route StartOfR1, route EndOfR1, route 
StartOfR2, route EndOfR2

WHERE
   Start.name='Craiglockhart' AND Finish.name='Sighthill'
   AND StartOfR1.id = Start.id  -- R1 actually visits Start
   AND EndOfR1.num = StartOfR1.num  -- two stops on the same route
   AND EndOfR1.id = StartOfR2.id -- R2 starts where R1 ends
   AND EndOfR1.num != StartOfR2.num -- R1 and R2 are not the same route
   AND EndOfR2.num = StartOfR2.num  -- two stops on the same route
   AND EndOfR2.id = Finish.id  -- R2 actually visits Finish
;

I'm not quite sure what role stops.pos field plays. If it's somehow 
significant, working it into the query is left as an exercise for the 
reader.

--
Igor Tandetnik

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


Re: [sqlite] Edinburgh Buses

2014-08-26 Thread Errol Emden
I have taken a different approach to the solution to this problem. Instead of 
paring the self-joins I have cross-joined the tables in pairs as follows:
SELECT distinct R1.num, R1.company, S1.name, R2.num, R2.company 
FROM stops S1, stops S2, route R1, route R2 
WHERE S1.name='Craiglockhart' AND S2.name='Sighthill' 
AND R1.stop=S1.id AND R2.stop=S2.id;

However, I can't find a way to identify the stops (S3.name) where transfers. 
occur. Also, Rw.num and R2.company remain static. Any idea what I am doing 
wrong here? 
From: eem...@hotmail.com
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] Edinburgh Buses
Date: Tue, 26 Aug 2014 11:03:07 -0400




Igor, thanks for a meaningful response. I am a neophyte at SQL, and learning it 
on my own. The graphical approach to a solution is another methodology I will 
be adding to my arsenal. 

The reason why I was checking both names against stop B is that my intent was 
to find the other route stops that connected to these stops. I am now aware 
that these connections are not possible.

 Errol Emden

> To: sqlite-users@sqlite.org
> From: i...@tandetnik.org
> Date: Mon, 25 Aug 2014 20:05:40 -0400
> Subject: Re: [sqlite] Edinburgh Buses
> 
> On 8/25/2014 7:52 PM, Errol Emden wrote:
> > FROM stops astop
> > JOIN stops bstop ON bstop.name='Craiglockhart' OR bstop.name='Sighthill'
> 
> Why are you checking two names against stop B, and none against stop A?
> 
> You also need to check that route A and route B actually connect - that 
> the end stop of one is the start stop of the other.
> 
> I suggest you draw a picture, then write down all the conditions that 
> need to be true to ensure that all the dots and lines connect to each 
> other the right way.
> -- 
> 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


Re: [sqlite] SQLite wrapper for Swift

2014-08-26 Thread Andreas Kupries
See also
   https://news.ycombinator.com/item?id=8226962
for discussion.

On Tue, Aug 26, 2014 at 9:09 AM, Simon Slavin  wrote:
> A thin SQLite wrapper for Swift:
>
> 
>
> Uses Swift variable types.  You have to explicitly say what type you want 
> your value as.
> Implements variable binding for security purposes.
> Implements a date class.  I have not checked out how well it does this.
>
> Implements its own transaction structure but you can ignore that and execute 
> BEGIN/END.  You can't mix and match them, though: stick to one or the other.
>
> Would welcome comments from experienced Swift programmers, if such a thing 
> can be said to exist.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



-- 
Andreas Kupries
Senior Tcl Developer
Code to Cloud: Smarter, Safer, Faster™
F: 778.786.1133
andre...@activestate.com, http://www.activestate.com
Learn about Stackato for Private PaaS: http://www.activestate.com/stackato

21'st Tcl/Tk Conference: Nov 10-14, Portland, OR, USA --
http://www.tcl.tk/community/tcl2014/
Send mail to tclconfere...@googlegroups.com, by Sep 8
Registration is open.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Curiosity question for an apparent change in Sqlite/timeline pattern

2014-08-26 Thread Richard Hipp
On Tue, Aug 26, 2014 at 12:58 PM, big stone  wrote:

> Hello,
>
> It seems to me that, all of a sudden, a LOT of  micro-wins and bigger wins
> are raining on the Sqlite/timeline
> (since about august 1rst, the "in ()" improvement)
>
> Is it an effect of a new Compiling/Testing environnement ? of summer
> vaccation ? of partner's help ?
> (maybe I'm wrong and all is as speedy as usual)
>


I think it is just perception.  We are constantly working to improve
SQLite.  That's what we do.  Maybe sometimes that work is out-of-sight
because it is happening on non-public repositories (such as TH3 at
http://www.sqlite.org/th3/doc/trunk/www/index.wiki) but it is on-going.

By chance, I was just writing an annual report for an SQLite Consortium
member, and so I have some information at hand that I can share with you.

SQLite version 3.8.0 was release one year ago today.  Since that time, we
have added the following major enhancements:

*  WITHOUT ROWID tables
*  Partial indexes
*  Common Table Expressions
*  The "skip-scan" optimization
*  Partial sorting by index
*  SQLITE_ENABLE_STAT4
*  And many other smaller improvements.

The trunk today is 28.3% faster than the 3.8.0 release, which was in turn
the fastest version of SQLite up until that point.  The 28.3% performance
increase is noteworthy because it was mostly obtained by small changes that
increase performance by 0.1% or 0.05% at a time.  Such small changes are
scarcely measurable (we use valgrind to get precise CPU cycle counts) but
if you do enough of them, they add up.

The size of the SQLite library has grown over time.  The current trunk is
4.9% larger than it was one year ago.  Expect it to get larger still in the
days, months, and years ahead, though we are zealous to restrain the size
growth as much as possible.

The continuous improvement of SQLite is made possible by the SQLite
Consortium members, many of whom are listed on the SQLite homepage (
http://www.sqlite.org/).  If you are using SQLite and appreciate its
reliability, performance, and features, then thank those Consortium members.


-- 
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] Window functions?

2014-08-26 Thread Wiktor Adamski

On 2014-08-26 18:00, sqlite-users-requ...@sqlite.org wrote:

SELECT
   employee_name,
   employee_id,
   salary,
   rank() OVER(PARTITION BY dept ORDER BY salary DESC),
   100.0*salary/sum(salary) OVER (PARTITION BY dept)
FROM employee;

I don't know if the above is valid SQL or not.  But is seems like something
somebody might like to do.  And it also seems hard to implement.


Yes it's valid. But this one actually is not that difficult to 
implement. Basically read rows must be ordered by dept, salary DESC. Then:
- rank() - it only needs to know if dept or salary is different than in 
previous row. that's all.

- sum() - probably the easiest way to implement it is:
-- first pass: calculate aggregate and write result to a temporary table
-- second pass: simply read calculated aggregate and append it to the result
Below are explains of both functions implemented in sqlite 3.3.8 based 
database.
However it doesn't mean that all window functions are easy to implement. 
For example I have no idea how to implement efficiently moving 
aggregates (BETWEEN x PRECEDING AND y FOLLOWING) - I think those have to 
recalculated for every row separately making whole query really slow 
(sum() can be optimized, but most likely most aggregates can't). There 
are many more problems. Most databases still haven't implemented 
everything from standard.


Explains:
- table definition: create table employee(salary, dept)
- table is already sorted by dept, salary DESC (so no sorting/index is 
visible in explains)
- no window specification defaults to ROWS UNBOUNDED PRECEDING AND 
UNBOUNDED FOLLOWING (behavior not specified in a standard)
- especially for rank() there is very little code, but it should be even 
shorter (for example opcodes 24, 25, 26 are useless)


SELECT rank() OVER(PARTITION BY dept ORDER BY salary DESC) FROM employee:
addr | opcode| p1  | p2 | p3  |
++---+-++-+--
   0 | Noop  |   0 |  0 | |
   1 | MemNull   |   2 |  0 | |
   2 | Goto  |   0 | 32 | |
   3 | Integer   |   2 |  0 | |
   4 | OpenRead  |   0 |  2 | |
   5 | SetNumColumns |   0 |  2 | |
   6 | MemInt|   0 |  1 | |
   7 | Rewind|   0 | 30 | |
   8 | MemLoad   |   5 |  0 | |
   9 | Column|   0 |  1 | |
  10 | Ne| 512 | 12 | collseq(BINARY) |
  11 | Goto  |   0 | 15 | |
  12 | MemNull   |   2 |  0 | |
  13 | Column|   0 |  1 | |
  14 | MemStore  |   5 |  1 | |
  15 | MemLoad   |   6 |  0 | |
  16 | Column|   0 |  0 | |
  17 | Ne| 512 | 20 | collseq(BINARY) |
  18 | MemInt|   0 |  4 | |
  19 | Goto  |   0 | 23 | |
  20 | MemInt|   1 |  4 | |
  21 | Column|   0 |  0 | |
  22 | MemStore  |   6 |  1 | |
  23 | WindowStep|   2 |  0 | rank(0) |
  24 | MemStore  |   3 |  0 | |
  25 | Pop   |   1 |  0 | |
  26 | MemLoad   |   3 |  0 | |
  27 | Callback  |   1 |  0 | |
  28 | MemIncr   |   1 |  1 | |
  29 | Next  |   0 |  8 | |
  30 | Close |   0 |  0 | |
  31 | Halt  |   0 |  0 | |
  32 | Transaction   |   2 |  0 | |
  33 | VerifyCookie  |   2 |  1 | |
  34 | Goto  |   0 |  3 | |


SELECT sum(salary) OVER (PARTITION BY dept) FROM employee:
addr | opcode| p1  | p2 | p3  |
++---+-++-+--
   0 | Noop  |   0 |  0 | |
   1 | OpenEphemeralList |   2 |  2 | |
   2 | MemInt|   1 |  2 | |
   3 | MemNull   |   3 |  0 | |
   4 | MemInt|  -1 |  0 | |
   5 | Goto  |   0 | 61 | |
   6 | Integer   |   2 |  0 | |
   7 | OpenRead  |   0 |  2 | |
   8 | SetNumColumns |   0 |  2 | |
   9 | Rewind|   0 | 35 | |
  10 | IfMemPos  |   2 | 28 | |
  11 | MemLoad   |   4 |  0 | |
  12 | Column|   0 |  1 | |
  13 | Ne| 512 | 17 | collseq(BINARY) |
  14 | Column|   0 |  0 | |
  15 | AggStep   |   3 |  1 | sum(1)  |
  16 | Goto  |   0 | 33 | |
  17 | AggFinal  |   3 |  0 | sum(1)  |
  18 | MemLoad   |   0 |  0 |

Re: [sqlite] Curiosity question for an apparent change in Sqlite/timeline pattern

2014-08-26 Thread Stephan Beal
On Tue, Aug 26, 2014 at 6:58 PM, big stone  wrote:

> (maybe I'm wrong and all is as speedy as usual)
>

Maybe this additional info will help:

http://sqlite.org/src/reports?view=byweek
http://sqlite.org/src/reports?view=bymonth

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Curiosity question for an apparent change in Sqlite/timeline pattern

2014-08-26 Thread big stone
Hello,

It seems to me that, all of a sudden, a LOT of  micro-wins and bigger wins
are raining on the Sqlite/timeline
(since about august 1rst, the "in ()" improvement)

Is it an effect of a new Compiling/Testing environnement ? of summer
vaccation ? of partner's help ?
(maybe I'm wrong and all is as speedy as usual)


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


Re: [sqlite] SQLite Database Browser v3.3.0 released

2014-08-26 Thread justin

On 2014-08-25 17:04, Richard Hipp wrote:

Thank you for creating this project.  I downloaded a copy.  It seems
very nice.

NOW, PLEASE CHANGE THE NAME!!!

"SQLite" is a trademark.  You are welcomed and encouraged to use the
code for SQLite, but not the name "SQLite".

This is not just a legal exercise.  A project like your "SQLite
Database Browser" will end up in the hands of many people who think
that your GUI is in fact the real SQLite and not just a GUI front-end
to SQLite.  And so if they encounter problems, they will contact the
SQLite developers for support.  The office phone number here is not
difficult to find with a Google search, and quite a few SQL-newbies
manage to find it, and ring me up.  Then I have to explain to them
that the program they are using is not in fact SQLite but is a
third-party wrapper around SQLite and that they will need to contact
the developers of the third-party wrapper to get support and that, 
no,

I cannot give them the phone number because I dont know what it is. 
Many callers get this.  Others, not so much.  A few are downright
rude.  But in every case, I have to deal with the issue, which takes
time away from working on SQLite.  The experience is also frustrating
for the users of your GUI.

Suggested new name:  "Database Browser for SQLite"

Moving the word "SQLite" into a prepositional phrase makes it clear 
to

(most) people that your program is an add-on to SQLite and not SQLite
itself.  I think that will be sufficient to solve the problem
described above.


Oh, interesting thought.  Obviously creating hassles for yourselves
is kind of the opposite of what we had in mind. :)


Thank you for your understanding and for your prompt attention to 
this

detail!


No worries.  I'll communicate this to the rest of the team.  I don't
think it'll be too hard to do for the pieces we control (eg 
application,

website, some of the external project pages and similar).

Not sure how long it'll take for the information to propagate out, but
hopefully "Not too long". ;)

Regards and best wishes,

Justin Clift

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


[sqlite] SQLite wrapper for Swift

2014-08-26 Thread Simon Slavin
A thin SQLite wrapper for Swift:



Uses Swift variable types.  You have to explicitly say what type you want your 
value as.
Implements variable binding for security purposes.
Implements a date class.  I have not checked out how well it does this.

Implements its own transaction structure but you can ignore that and execute 
BEGIN/END.  You can't mix and match them, though: stick to one or the other.

Would welcome comments from experienced Swift programmers, if such a thing can 
be said to exist.

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


Re: [sqlite] Edinburgh Buses

2014-08-26 Thread Errol Emden
Igor, thanks for a meaningful response. I am a neophyte at SQL, and learning it 
on my own. The graphical approach to a solution is another methodology I will 
be adding to my arsenal. 

The reason why I was checking both names against stop B is that my intent was 
to find the other route stops that connected to these stops. I am now aware 
that these connections are not possible.

 Errol Emden

> To: sqlite-users@sqlite.org
> From: i...@tandetnik.org
> Date: Mon, 25 Aug 2014 20:05:40 -0400
> Subject: Re: [sqlite] Edinburgh Buses
> 
> On 8/25/2014 7:52 PM, Errol Emden wrote:
> > FROM stops astop
> > JOIN stops bstop ON bstop.name='Craiglockhart' OR bstop.name='Sighthill'
> 
> Why are you checking two names against stop B, and none against stop A?
> 
> You also need to check that route A and route B actually connect - that 
> the end stop of one is the start stop of the other.
> 
> I suggest you draw a picture, then write down all the conditions that 
> need to be true to ensure that all the dots and lines connect to each 
> other the right way.
> -- 
> 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


Re: [sqlite] Window functions?

2014-08-26 Thread Alek Paunov

On 25.08.2014 20:47, Richard Hipp wrote:

On Mon, Aug 25, 2014 at 1:21 PM, forkandwait  wrote:


You used the word "immense" which I like - it is an apt description of

the

knowledge and effort needed to add windowing functions to SQLite (and
probably any other database engine for that matter).


Hehe.  I would be interested in any of your specific thoughts on the
immensity of it.  I can imagine that most of the work would be in the
parser, but things always simpler to non-experts ;)



Parsing is the easy part.  The tricky part is the code generator - the
piece that takes the abstract syntax tree that the parser generates and
turns it into bytecode that renders the desired output, taking care to
correctly handle the myriad corner cases.   Then comes the tedious part of
writing 100% MC/DC test cases.



This is not a fresh idea, I am dropping it again, because I continue to 
think that something in that direction could be useful - mostly for 
studying SQLite in a university environment, but also for on-demand 
research like the OPs feature request, where nor compilation time, nor 
the full soundness of the generated code are critical:


- Single new supported SQLite feature bundle:
  - "Standard" database schema for representing "disassembled"
VDBE programs
  - SQLite extension consisting of:
- function "disassemble" for dumping prepared statement to the
  above schema
- function "assemble" for loading and linking VDBE program from
  given rowid of the schema for execution as prepared statement.

- Community project sqlite-asm-tools (possibly coordinated trough 
dedicated list @sqlite.org), aimed to help further development with more 
high level tools over that VDBE schema like: code templates application, 
code pattern marchers, manipulation methods, visualizations, etc.


It seems to me that the above basis will be enough for student projects 
like MERGE implementation or Stored procedures or even new languages 
experiments, just like the myriad of academic experiments on top of JVM, 
LLVM and other backends, some of them far away of the popularity of SQLite.


Kind regards,
Alek

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


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-26 Thread Richard Hipp
On Tue, Aug 26, 2014 at 8:44 AM, 王庆刚 <2004wqg2...@163.com> wrote:

> hi, Andy Ling:
> The error disk I / o error I have resolved ;
> but when I used the following code:
> rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",&db);
> it tell me  can not find the data base;
>

Have you tried instead:

 rc = sqlite3_open("D:/WindRiver/SqliteOne.db", &db);

I do not have access to VxWorks, but as VxWorks is supposed to be POSIX, I
suspect that it would use the POSIX "/" directory separator rather than the
Windows "\\" directory separator.

I'm also suspicious of the "D:" prefix, which I do not believe to be POSIX,
but again, I do not know enough about VxWorks to say whether or not that
will work.



>
> when I used the following code:
> rc = sqlite3_open("SqliteOne.db",&db);
> It is OK
>
>
> How could I resolve the prolblem?
>
>
>
>
>
>
> At 2014-08-25 11:29:57, "Andy Ling"  wrote:
>
> That file name in the first error doesn't look like a vxWorks file. What
> devices have you got mounted. You need to specify a file path that points
> to one of the vxWorks file IO devices. By just specifying the file name in
> your second example it is being created in the current directory.
>
> The second disk I / O error is what I had before applying the patch to
> unixUnlink. The error returned by vxWorks when deleting a file that doesn't
> exist depends on the underlying file system. If it is a POSIX file system
> it should return ENOENT. For dosFS it returns S_dosFsLib_FILE_NOT_FOUND,
> which in vxWorks 6.9 is 0x380003
>
> So if you are using yet another file system, maybe you are getting a
> different error code being set. start by adding a printf to unixUnlink to
> find out if that is your problem.
>
> Regards
>
> Andy Ling
>
>
>
> From: 王庆刚 [2004wqg2...@163.com]
> Sent: 25 August 2014 13:13
> To:sqlite-users@sqlite.org; Andy Ling; Jan Nijtmans
> Subject: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
>
>
> hi
>   I modified the code sqlite3.c according to you method, as follow
>
>
>  <
> http://fossil-scm.org/index.html/vpatch?from=dd5743a8239d1ce9&to=b68f65bb69a098a1>
> or   
>
>
> I test you method in workbench3.2(vxworks6.8) , the build macros which I
> used in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0
> -DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME
>
>
> but it still have some problems.
> 1.  if I do as follows:
> rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",&db);
> it tell me the error  can not open the database.
>
>
>
>
> 2.  if I do as follows:
> rc = sqlite3_open("SqliteOne.db",&db);this will be ok .
> but when I do the following thing
> sql = " create table stu(i int, name text);";
> rc = sqlite3_exec(db,sql,NULL,NULL,&err);
> it tell me the error  : disk I / O  error.
>
>
>
>
>
>
> 在 2014-08-12 08:10:13,"Jan Nijtmans"  写道:
>
> 2014-08-03 9:56 GMT+02:00 Jan Nijtmans :
>
> 2014-08-02 16:00 GMT+02:00 王庆刚 <2004wqg2...@163.com>:
>
> > hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for
> Vxworks6.8 ?
> > When I  compile them , there have so many problems .
>
>
> You can find the necessary changes here:
> <
> http://fossil-scm.org/index.html/vpatch?from=dd5743a8239d1ce9&to=b68f65bb69a098a1
> >
> thanks to Andy Ling.
>
> Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
> (not tested yet on other platforms than vxworks, win32/64 and Linux,
> there it works fine)
>
>
>
> New attempt here, base on current SQLite trunk:
>   
>
>
> Regards,
>
>   Jan Nijtmans
>
>
>
>
> ___
> 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] HELP sqlite3 used in vxworks has someproblem?

2014-08-26 Thread Andy Ling
As I said before, that doesn’t look like a vxWorks path to a file. Are you sure 
D:\\WindRiver really exists? In general vxWorks uses the forward slash (/) as a 
path separator. Is this a remote mounted host file system you are trying to use?

What is your current directory when it works the second time? i.e. what is the 
output from the “pwd” command? Can you use that directory as part of a full 
pathname?

I’m glad you have fixed the disk I/O problem. What did you have to do? Are 
there any more changes that need feeding back into the source?

Regards

Andy Ling


From: 王庆刚 [mailto:2004wqg2...@163.com]
Sent: 26 August 2014 13:44
To: Andy Ling
Cc: sqlite-users@sqlite.org; Jan Nijtmans
Subject: Re:RE: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

hi, Andy Ling:
The error disk I / o error I have resolved ;
but when I used the following code:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",&db);
it tell me  can not find the data base;

when I used the following code:
rc = sqlite3_open("SqliteOne.db",&db);
It is OK


How could I resolve the prolblem?



At 2014-08-25 11:29:57, "Andy Ling" 
mailto:andy.l...@quantel.com>> wrote:

That file name in the first error doesn't look like a vxWorks file. What 
devices have you got mounted. You need to specify a file path that points to 
one of the vxWorks file IO devices. By just specifying the file name in your 
second example it is being created in the current directory.

The second disk I / O error is what I had before applying the patch to 
unixUnlink. The error returned by vxWorks when deleting a file that doesn't 
exist depends on the underlying file system. If it is a POSIX file system it 
should return ENOENT. For dosFS it returns S_dosFsLib_FILE_NOT_FOUND, which in 
vxWorks 6.9 is 0x380003

So if you are using yet another file system, maybe you are getting a different 
error code being set. start by adding a printf to unixUnlink to find out if 
that is your problem.

Regards

Andy Ling


From: 王庆刚 [2004wqg2...@163.com]
Sent: 25 August 2014 13:13
To: sqlite-users@sqlite.org; Andy Ling; Jan 
Nijtmans
Subject: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
hi
  I modified the code sqlite3.c according to you method, as follow

 

  or   

I test you method in workbench3.2(vxworks6.8) , the build macros which I used 
in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0  
-DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME

but it still have some problems.
1.  if I do as follows:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",&db);
it tell me the error  can not open the database.


2.  if I do as follows:
rc = sqlite3_open("SqliteOne.db",&db);this will be ok .
but when I do the following thing
sql = " create table stu(i int, name text);";
rc = sqlite3_exec(db,sql,NULL,NULL,&err);
it tell me the error  : disk I / O  error.




在 2014-08-12 08:10:13,"Jan Nijtmans" 
mailto:jan.nijtm...@gmail.com>> 写道:

2014-08-03 9:56 GMT+02:00 Jan Nijtmans 
mailto:jan.nijtm...@gmail.com>>:
2014-08-02 16:00 GMT+02:00 王庆刚 
<2004wqg2...@163.com>:
> hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for 
> Vxworks6.8 ?
> When I  compile them , there have so many problems .
You can find the necessary changes here:


thanks to Andy Ling.

Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
(not tested yet on other platforms than vxworks, win32/64 and Linux,
there it works fine)

New attempt here, base on current SQLite trunk:
  
Regards,
  Jan Nijtmans


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


Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-26 Thread 王庆刚
hi, Andy Ling:
The error disk I / o error I have resolved ;
but when I used the following code:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",&db);
it tell me  can not find the data base;
 
when I used the following code:
rc = sqlite3_open("SqliteOne.db",&db);
It is OK
 
 
How could I resolve the prolblem?






At 2014-08-25 11:29:57, "Andy Ling"  wrote:

That file name in the first error doesn't look like a vxWorks file. What 
devices have you got mounted. You need to specify a file path that points to 
one of the vxWorks file IO devices. By just specifying the file name in your 
second example it is being created in the current directory.

The second disk I / O error is what I had before applying the patch to 
unixUnlink. The error returned by vxWorks when deleting a file that doesn't 
exist depends on the underlying file system. If it is a POSIX file system it 
should return ENOENT. For dosFS it returns S_dosFsLib_FILE_NOT_FOUND, which in 
vxWorks 6.9 is 0x380003

So if you are using yet another file system, maybe you are getting a different 
error code being set. start by adding a printf to unixUnlink to find out if 
that is your problem.

Regards

Andy Ling



From: 王庆刚 [2004wqg2...@163.com]
Sent: 25 August 2014 13:13
To:sqlite-users@sqlite.org; Andy Ling; Jan Nijtmans
Subject: Re:Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?


hi
  I modified the code sqlite3.c according to you method, as follow 


 

  or    


I test you method in workbench3.2(vxworks6.8) , the build macros which I used 
in build properties is : -DOS_VXWORKS=1 -DSQLITE_THREADSAFE=0  
-DSQLITE_OMIT_LOAD_EXTENSION -DHAVE_UTIME


but it still have some problems.
1.  if I do as follows:
rc = sqlite3_open("D:\\WindRiver\\SqliteOne.db",&db);
it tell me the error  can not open the database.




2.  if I do as follows:
rc = sqlite3_open("SqliteOne.db",&db);this will be ok .
but when I do the following thing 
sql = " create table stu(i int, name text);";
rc = sqlite3_exec(db,sql,NULL,NULL,&err);
it tell me the error  : disk I / O  error.






在 2014-08-12 08:10:13,"Jan Nijtmans"  写道:

2014-08-03 9:56 GMT+02:00 Jan Nijtmans :

2014-08-02 16:00 GMT+02:00 王庆刚 <2004wqg2...@163.com>:

> hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for 
> Vxworks6.8 ?
> When I  compile them , there have so many problems .


You can find the necessary changes here:


thanks to Andy Ling.

Still has to be reviewed by the SQLite developers for inclusion in 3.8.6
(not tested yet on other platforms than vxworks, win32/64 and Linux,
there it works fine)



New attempt here, base on current SQLite trunk:
  


Regards,

  Jan Nijtmans




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


Re: [sqlite] Window functions?

2014-08-26 Thread FarSight Data Systems
On Monday, August 25, 2014 09:25:47 PM Stephan Beal wrote:
> On Mon, Aug 25, 2014 at 9:17 PM, Petite Abeille 
> 
> wrote:
> > True. But what a quantum leap that would be. Like moving from the
> > wheelbarrow to the jet engine.
> 
> For the small percentage of users who need it (or would even know how to
> apply it). i've been following this list since 2006 or 2007 and i recall
> this topic having come up only a small handful of times, which implies that
> only a small minority of users feels the need for it.

I'm coming at this from a different perspective, as I'm using pysqlite and 
wxpython to display, in a windowed fashion, data in a SQLite database.

Would that solve the problem?

Mark


-- 

Mark S. Halegua
718-360-1712
917-686-8794
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users