Re: [sqlite] OSX path

2011-06-17 Thread john darnell
Thanks for your kind words, Simon.  As for myself, I really do strive for 
civility, though I don't always get there.  I'll keep working at it if you 
promise to be patient with me.

As for "top-posting," In the corporate culture I come from, it is considered 
the only way to do things (or at least one faction who has the ear of the ops 
boss, believes this).  I actually got counseled for cutting out a goodly chunk 
of what I thought was unnecessary old message.  It was a gentle admonishment, 
nevertheless, I got the message.

In fact, I shudder as I read your message and find out I am *expected* to cut 
out the stuff that is no longer needed (grin).


> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org]
> 
> Yep.  Adobe totally explains why you're still thinking in terms of colon 
> paths.
> InDesigns is a terrific program (I've never developed for it) but Adobe hasn't
> ported it to more recent API layers.  Adobe's habit of lagging several years 
> behind
> Apple in this way is a terrible handicap and hits it each time Apple stops 
> supporting
> old (in this case 11 years old) sets of API.  It's going to happen again in 
> OS X 10.7
> because OS X 10.7 does not support the PowerPC compatibility layer.

Gulp.  Another sleepless three months for us InDesign Plugin programmers as we 
figure out how to cope...

Take care.

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


Re: [sqlite] OSX path

2011-06-17 Thread Simon Slavin

On 17 Jun 2011, at 11:50pm, john darnell wrote:

>   Say what you will about Adobe and InDesign, but their tools for writing 
> Apple, ah, supplemental code, are not insubstantial or trivial.  IMHO, it is 
> understandable when that is my major environment for writing code that I 
> might not know the more current practice.  

Yep.  Adobe totally explains why you're still thinking in terms of colon paths. 
 InDesigns is a terrific program (I've never developed for it) but Adobe hasn't 
ported it to more recent API layers.  Adobe's habit of lagging several years 
behind Apple in this way is a terrible handicap and hits it each time Apple 
stops supporting old (in this case 11 years old) sets of API.  It's going to 
happen again in OS X 10.7 because OS X 10.7 does not support the PowerPC 
compatibility layer.

Sorry about the tone of my earlier post.  I wasn't trying to condemn you, 
merely show that neither side of the SQLite programming community would have 
written a note about colon paths because neither side of the Mac SQLite 
programming community would have thought it was a problem.


On 18 Jun 2011, at 1:06am, john darnell wrote:

> Um, what's top-posting?


Adding your new text at the top of a post, then including the whole earlier 
post you're replying to.

We've already read the earlier post.  We don't need to see it again.  If you 
think you need it for context when we read your post, it has to be /above/ your 
new text, so we read it first.  And we don't need the whole thing, just the bit 
you're replying to.

Take a look at the post you're reading now, and you'll see a more efficient way 
to do things.  Don't worry: you're just going through a little stage all new 
posters go through.

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


Re: [sqlite] OSX path

2011-06-17 Thread john darnell
Um, what's top-posting?

And of course I always strive to be wise.  Simon (or for that matter, the rest 
of the list), if you thought I was being a wiseass, then again, my apologies.

R,
John



> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org]
> On Behalf Of Warren Young
> Sent: Friday, June 17, 2011 7:00 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] OSX path
> 
> On 6/17/2011 4:50 PM, john darnell wrote:
> >
> > I am essentially a Windows programmer
> 
> Is that also your excuse for top-posting? :)
> 
> > I will have to take your
> > word on the use of HFS-style paths vs posix/Unix style paths on Mac
> > platforms.
> 
> That would be wise, because Simon is correct.
> 
> > I will have to say, however, that at least the InDesign SDK, which is
> > my chief habitat when it comes to writing Mac code, encourages the
> > use of colon-laden paths--or at least does not greatly discourage it,
> 
> That's because all Adobe software created before about 2006[*] was built
> on top of the Carbon SDK, which interprets colon-delimited paths for
> backwards compatibility with Classic Mac OS.  OS X's native
> POSIX/Mach/Cocoa APIs understand only slash-based paths.
> 
> SQLite is built on top of the POSIX layer of OS X, so it only
> understands POSIX paths.
> 
> As more Mac programs move to 64-bit, they must move from Carbon to
> Cocoa, and thus will require POSIX paths, unless they've built in their
> own portability layer.  I can see Adobe doing that, to preserve legacy
> compatibility.
> 
> [*] Lightroom was the first Cocoa-based Adobe app.  Its first public
> beta came out in 2006.
> ___
> 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] OSX path

2011-06-17 Thread Warren Young
On 6/17/2011 4:50 PM, john darnell wrote:
>
> I am essentially a Windows programmer

Is that also your excuse for top-posting? :)

> I will have to take your
> word on the use of HFS-style paths vs posix/Unix style paths on Mac
> platforms.

That would be wise, because Simon is correct.

> I will have to say, however, that at least the InDesign SDK, which is
> my chief habitat when it comes to writing Mac code, encourages the
> use of colon-laden paths--or at least does not greatly discourage it,

That's because all Adobe software created before about 2006[*] was built 
on top of the Carbon SDK, which interprets colon-delimited paths for 
backwards compatibility with Classic Mac OS.  OS X's native 
POSIX/Mach/Cocoa APIs understand only slash-based paths.

SQLite is built on top of the POSIX layer of OS X, so it only 
understands POSIX paths.

As more Mac programs move to 64-bit, they must move from Carbon to 
Cocoa, and thus will require POSIX paths, unless they've built in their 
own portability layer.  I can see Adobe doing that, to preserve legacy 
compatibility.

[*] Lightroom was the first Cocoa-based Adobe app.  Its first public 
beta came out in 2006.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] OSX path

2011-06-17 Thread john darnell
Simon:

   First of all, let me apologize for my whine.  We all have our bumps in the 
road and if we don't then we're probably not doing our jobs (as one venerable 
Navy Chief once pointed out to a hapless, naïve ensign many years ago).  I 
should have just shut up and moved on.

   I am essentially a Windows programmer so I will have to take your word on 
the use of HFS-style paths vs posix/Unix style paths on Mac platforms.  

   I will have to say, however, that at least the InDesign SDK, which is my 
chief habitat when it comes to writing Mac code, encourages the use of 
colon-laden paths--or at least does not greatly discourage it, while not 
encouraging at all the use of the posix/Unix style of path presentation.  They 
have a few functions scattered here and there for HFS-to-URL/Posix conversion, 
but rarely are they mentioned in their docs, or used not at all in their 
examples.

   Say what you will about Adobe and InDesign, but their tools for writing 
Apple, ah, supplemental code, are not insubstantial or trivial.  IMHO, it is 
understandable when that is my major environment for writing code that I might 
not know the more current practice.  

   Okay, it's an excuse (grin), but it's all I've got.

Take care, and honest, thanks! 
John 

> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org]
> On Behalf Of Simon Slavin
> Sent: Friday, June 17, 2011 5:18 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] OSX path
> 
> 
> On 17 Jun 2011, at 10:09pm, john darnell wrote:
> 
> > I checked two references and neither one of them  mentioned this teensy 
> > little
> requirement.  I guess they must've thought it wasn't important.
> 
> The use of colons for file paths is purely an old-fashioned Mac thing and 
> never
> worked cross-platform.  So from the SQLite and sides, the programmers would
> never think to mention the colon format and might never have known about it
> (although as it happens DRH is a Mac user and doubtless does).
> 
> From the Mac side, since OS X began (twelve years ago) you've been able to use
> standard Unix slash format for file paths, and the colon format has 
> pretty-much
> diminished into misuse.  So only pre-OS X Mac programmers like us would know
> about it.
> 
> Sorry about that.  But I'm keeping my copy of _Inside Mac_ because I'm 
> convinced
> it's a classic.
> 
> Simon.
> 
> 
> ___
> 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] select (partly) url-encoded strings?

2011-06-17 Thread Sven Utcke
Hello Igor Tandetnik,

> On 6/17/2011 6:11 PM, Sven Utcke wrote:
> > Actually, the above would be awfully slow (as it can not use the
> > index).  It might be better to use an intermediate table (but of
> > course still filled using urldecode()), what is the recommended
> > way to create such a table in sqlite3 (and have it dropped on
> > exit)?
> 
> create temp table decoded(decodedUrl);
> 
> insert into decoded(decodedUrl)
> select urldecode(name) from "table";
> 
> You can create indexes on temp table - they will be dropped together 
> with the table when you close the connection.

Perfect --- just what I need.  Sqlite is quite amazing...

Sven
-- 
  __ _  _ __  __ __ 
 / _` || '  \ \ \ /   http://www.svenutcke.de/
 \__, ||_|_|_|/_\_\http://www.dr-utcke.de/
 |___/ Key fingerprint =  6F F8 55 1C F9 E3 A8 F7  09 DF F7 2C 25 0C 54 53
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] select (partly) url-encoded strings?

2011-06-17 Thread Igor Tandetnik
On 6/17/2011 6:11 PM, Sven Utcke wrote:
> Actually, the above would be awfully slow (as it can not use the
> index).  It might be better to use an intermediate table (but of
> course still filled using urldecode()), what is the recommended way to
> create such a table in sqlite3 (and have it dropped on exit)?

create temp table decoded(decodedUrl);

insert into decoded(decodedUrl)
select urldecode(name) from "table";

You can create indexes on temp table - they will be dropped together 
with the table when you close the connection.
-- 
Igor Tandetnik

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


Re: [sqlite] OSX path

2011-06-17 Thread Simon Slavin

On 17 Jun 2011, at 10:09pm, john darnell wrote:

> I checked two references and neither one of them  mentioned this teensy 
> little requirement.  I guess they must've thought it wasn't important.

The use of colons for file paths is purely an old-fashioned Mac thing and never 
worked cross-platform.  So from the SQLite and sides, the programmers would 
never think to mention the colon format and might never have known about it 
(although as it happens DRH is a Mac user and doubtless does).

>From the Mac side, since OS X began (twelve years ago) you've been able to use 
>standard Unix slash format for file paths, and the colon format has 
>pretty-much diminished into misuse.  So only pre-OS X Mac programmers like us 
>would know about it.

Sorry about that.  But I'm keeping my copy of _Inside Mac_ because I'm 
convinced it's a classic.

Simon.


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


Re: [sqlite] Help with CASE WHEN

2011-06-17 Thread Nico Williams
On Fri, Jun 17, 2011 at 5:05 PM, Mr. Puneet Kishor  wrote:
> The above is not SQL. You can't have a SQL statement begin with CASE. SQL 
> statements can only begin with either SELECT or UPDATE or CREATE or DELETE or 
> ALTER, etc. CASE is an expression, and has to be a replacement for a column. 
> I can't even begin to help you rewrite your statement, but what you are 
> trying to accomplish is something like --
>
> if (some condition)
>    UPDATE this
> else
>    UPDATE that
>
> Either accomplish the above in a programming language, or rewrite it as 
> separate queries, or hope Igor or someone can help you rewrite the above into 
> a single query.

Rewrite the statements as:

INSERT ... WHERE ... AND ;

Similarly for SELECT, UPDATE, and DELETE.

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


Re: [sqlite] select (partly) url-encoded strings?

2011-06-17 Thread Sven Utcke
Hello Igor,

> On 6/17/2011 5:36 PM, Sven Utcke wrote:
> > I might see a name
> > like "image 1 (modified%20(2)).jpg".  Since I can not forsee which
> > parts might have been encoded and which not, I therefore need to write
> > something like:
> >
> >SELECT * FROM table WHERE urldecode(table.name)='some file name';

Actually, the above would be awfully slow (as it can not use the
index).  It might be better to use an intermediate table (but of
course still filled using urldecode()), what is the recommended way to
create such a table in sqlite3 (and have it dropped on exit)?

> > So I guess my question is: is there such a function "urldecode()"
> 
> No.
> 
> > and
> > if not, what is the best way to solve this problem?
> 
> http://sqlite.org/c3ref/create_function.html

Thanks.  I'm actually using the Python interface, but this set me on
the right track.

Sven
-- 
  __ _  _ __  __ __ 
 / _` || '  \ \ \ /   http://www.svenutcke.de/
 \__, ||_|_|_|/_\_\http://www.dr-utcke.de/
 |___/ Key fingerprint =  6F F8 55 1C F9 E3 A8 F7  09 DF F7 2C 25 0C 54 53
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Help with CASE WHEN

2011-06-17 Thread Mr. Puneet Kishor

On Jun 17, 2011, at 4:56 PM, jose isaias cabrera wrote:

> CASE (SELECT round(sum(Xtra8),2) FROM LSOpenJobs
>   WHERE subProjID = 9144 AND lang = 'ES-LA'
> AND PSubClass != 'Portal-Fee')
> 
> WHEN < 5000 THEN
>UPDATE LSOpenJobs SET ProjFund = (SELECT round(sum(ProjFund) * .0175,2) 
> FROM LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
> LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee') <= 5000),
>  Xtra8 = (SELECT round(sum(Xtra8) * .0175,2) FROM LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
> LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee') <= 5000),
>  Xtra6 = '1.75% of total',
>  XtraB = '2011-06-17 17:40:05',
>  XtraD = '1.75%'
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass = 'Portal-Fee'
> 
> WHEN BETWEEN 5000 AND 2 THEN
>UPDATE LSOpenJobs SET ProjFund = (SELECT round(sum(ProjFund) * .0125,2) 
> FROM LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
> LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee') > 5000),
>  Xtra8 = (SELECT round(sum(Xtra8) * .0125,2) FROM LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
> LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee') > 5000),
>  Xtra6 = '1.25% of total',
>  XtraB = '2011-06-17 17:40:05',
>  XtraD = '1.25%'
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass = 'Portal-Fee'
> 
> ELSE
>UPDATE LSOpenJobs SET ProjFund = (SELECT round(sum(ProjFund) * .0,2) 
> FROM LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
> LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee') >= 2),
>  Xtra8 = (SELECT round(sum(Xtra8) * .0,2) FROM LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
> LSOpenJobs
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass != 'Portal-Fee') >= 2),
>  Xtra6 = 'No fee charged',
>  XtraB = '2011-06-17 17:40:05',
>  XtraD = '0.00%'
>  WHERE subProjID = 9144 AND lang = 'ES-LA'
>  AND PSubClass = 'Portal-Fee'


The above is not SQL. You can't have a SQL statement begin with CASE. SQL 
statements can only begin with either SELECT or UPDATE or CREATE or DELETE or 
ALTER, etc. CASE is an expression, and has to be a replacement for a column. I 
can't even begin to help you rewrite your statement, but what you are trying to 
accomplish is something like --

if (some condition)
UPDATE this
else
UPDATE that

Either accomplish the above in a programming language, or rewrite it as 
separate queries, or hope Igor or someone can help you rewrite the above into a 
single query.

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


Re: [sqlite] select (partly) url-encoded strings?

2011-06-17 Thread Igor Tandetnik
On 6/17/2011 5:36 PM, Sven Utcke wrote:
>I might see a name
> like "image 1 (modified%20(2)).jpg".  Since I can not forsee which
> parts might have been encoded and which not, I therefore need to write
> something like:
>
>SELECT * FROM table WHERE urldecode(table.name)='some file name';
>
> So I guess my question is: is there such a function "urldecode()"

No.

> and
> if not, what is the best way to solve this problem?

http://sqlite.org/c3ref/create_function.html

>  Can I define my
> own functions in sqlite3?

Yes you can.
-- 
Igor Tandetnik

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


[sqlite] Help with CASE WHEN

2011-06-17 Thread jose isaias cabrera

Greetings.

I have used CASE before, but for simple codes and it works.  However, I am 
trying to break down some calculations and it-s not working.  I am getting,

   ...>
   ...> END;
Error: near "CASE": syntax error
sqlite> COMMIT TRANSACTION;
Error: cannot commit - no transaction is active
sqlite>

This is the code...


BEGIN IMMEDIATE TRANSACTION;

UPDATE LSOpenJobs SET ProjFund = (SELECT round(sum(ProjFund) * .10,2) FROM 
LSOpenJobs
WHERE subProjID = 9144 AND lang = 'ES-LA'
AND PSubClass != 'PM' AND PSubClass != 'Rush-Job'),
Xtra8 = (SELECT round(sum(Xtra8) * .10,2) FROM LSOpenJobs
WHERE subProjID = 9144 AND lang = 'ES-LA'
AND PSubClass != 'PM'
AND PSubClass != 'Portal-Fee'
AND PSubClass != 'Rush-Job'),
Xtra6 = '10% of total',
XtraB = '2011-06-17 17:40:05'
WHERE subProjID = 9144 AND lang = 'ES-LA'
AND XtraD = '10%' AND PSubClass = 'PM' AND PSubClass != 'Rush-Job';

CASE (SELECT round(sum(Xtra8),2) FROM LSOpenJobs
   WHERE subProjID = 9144 AND lang = 'ES-LA'
 AND PSubClass != 'Portal-Fee')

WHEN < 5000 THEN
UPDATE LSOpenJobs SET ProjFund = (SELECT round(sum(ProjFund) * .0175,2) 
FROM LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee') <= 5000),
  Xtra8 = (SELECT round(sum(Xtra8) * .0175,2) FROM LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee') <= 5000),
  Xtra6 = '1.75% of total',
  XtraB = '2011-06-17 17:40:05',
  XtraD = '1.75%'
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass = 'Portal-Fee'

WHEN BETWEEN 5000 AND 2 THEN
UPDATE LSOpenJobs SET ProjFund = (SELECT round(sum(ProjFund) * .0125,2) 
FROM LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee') > 5000),
  Xtra8 = (SELECT round(sum(Xtra8) * .0125,2) FROM LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee') > 5000),
  Xtra6 = '1.25% of total',
  XtraB = '2011-06-17 17:40:05',
  XtraD = '1.25%'
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass = 'Portal-Fee'

ELSE
UPDATE LSOpenJobs SET ProjFund = (SELECT round(sum(ProjFund) * .0,2) 
FROM LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee') >= 2),
  Xtra8 = (SELECT round(sum(Xtra8) * .0,2) FROM LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee' AND (SELECT round(sum(Xtra8),2) FROM 
LSOpenJobs
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass != 'Portal-Fee') >= 2),
  Xtra6 = 'No fee charged',
  XtraB = '2011-06-17 17:40:05',
  XtraD = '0.00%'
  WHERE subProjID = 9144 AND lang = 'ES-LA'
  AND PSubClass = 'Portal-Fee'

END;
COMMIT TRANSACTION;

Any help to clean this up and getting the error out would be great.

thanks,

josé

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


[sqlite] select (partly) url-encoded strings?

2011-06-17 Thread Sven Utcke
Hi,

let me introduce myself first: I'm new to this list (but not SQL),
using sqlite3 mostly in order to write exporters from my
face-recognition tool to some photo management software (F-Spot and
Digikam, currently), but also some convenience functions (mostly for
F-Spot).

And that's actually where my problem comes in: newer versions of
F-Spot store the location of a Photo in what I would call URL-encoded
format --- so instead of a space (' ') I see '%20' (and so on).  Now,
the problem is that due to a bug in some versions of F-Spot, this
information might have been only partly urlencoded, I might see a name
like "image 1 (modified%20(2)).jpg".  Since I can not forsee which
parts might have been encoded and which not, I therefore need to write
something like:

  SELECT * FROM table WHERE urldecode(table.name)='some file name';

So I guess my question is: is there such a function "urldecode()", and
if not, what is the best way to solve this problem?  Can I define my
own functions in sqlite3 (don't think so, or)?  I would appreciate any
ideas...

Sven
-- 
  __ _  _ __  __ __ 
 / _` || '  \ \ \ /   http://www.svenutcke.de/
 \__, ||_|_|_|/_\_\http://www.dr-utcke.de/
 |___/ Key fingerprint =  6F F8 55 1C F9 E3 A8 F7  09 DF F7 2C 25 0C 54 53
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] OSX path

2011-06-17 Thread john darnell
Thanks Doug.  I appreciate you pointing this out to me.  

I checked two references and neither one of them  mentioned this teensy little 
requirement.  I guess they must've thought it wasn't important.

R,
John

> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org]
> On Behalf Of Doug Currie
> Sent: Friday, June 17, 2011 4:07 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] OSX path
> 
> 
> On Jun 17, 2011, at 2:56 PM, john darnell wrote:
> 
> > I am attempting to open an SQLite database on the Mac (OSX Snow Leopard)
> and am getting an error.  This is the code I am using:
> >
> >   char  DBEnginePath[1000];
> >
> >   strcpy(DBEnginePath, "Macintosh HD:Applications:Adobe InDesign CS5:Plug-
> Ins:WPC_ID:IndexData.db");
> >   fprintf(stderr, "%s\n", DBEnginePath);
> > //  Sends
> correct path to stderr for verification.
> >   Result = sqlite3_open_v2(DBEnginePath, _ptr,
> SQLITE_OPEN_READONLY, NULL);  //  Errors out here.
> 
> Your path has colons instead of slashes for separators.
> 
> Open a Terminal window, and drag the database file into the window. The
> terminal.app will display the path name on the command line. You can copy and
> paste from there. It's probably something like:
> 
> /Applications/Adobe\ InDesign\ CS5/Plug-Ins/WPC_ID/IndexData.db
> 
> e
> 
> ___
> 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] OSX path

2011-06-17 Thread Doug Currie

On Jun 17, 2011, at 2:56 PM, john darnell wrote:

> I am attempting to open an SQLite database on the Mac (OSX Snow Leopard) and 
> am getting an error.  This is the code I am using:
> 
>   char  DBEnginePath[1000];
> 
>   strcpy(DBEnginePath, "Macintosh HD:Applications:Adobe InDesign 
> CS5:Plug-Ins:WPC_ID:IndexData.db");
>   fprintf(stderr, "%s\n", DBEnginePath);  
>   //  Sends correct path to stderr for verification.
>   Result = sqlite3_open_v2(DBEnginePath, _ptr, SQLITE_OPEN_READONLY, 
> NULL);  //  Errors out here.

Your path has colons instead of slashes for separators.

Open a Terminal window, and drag the database file into the window. The 
terminal.app will display the path name on the command line. You can copy and 
paste from there. It's probably something like:

/Applications/Adobe\ InDesign\ CS5/Plug-Ins/WPC_ID/IndexData.db

e

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


Re: [sqlite] Opening a database on a Mac

2011-06-17 Thread john darnell
Thanks  Pavel.  That worked.

R,
John

> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org]
> On Behalf Of Pavel Ivanov
> Sent: Friday, June 17, 2011 2:23 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Opening a database on a Mac
> 
> >   strcpy(DBEnginePath, "Macintosh HD:Applications:Adobe InDesign CS5:Plug-
> Ins:WPC_ID:IndexData.db");
> 
> Try to change path here to "/Applications/Adobe InDesign
> CS5/Plug-Ins/WPC_ID/IndexData.db".
> 
> 
> Pavel
> 
> 
> On Fri, Jun 17, 2011 at 3:08 PM, john darnell
>  wrote:
> > Sorry to send this twice, but I realized that my first transmission did not 
> > include a
> subject line.
> >
> > _
> > From: john darnell
> > Sent: Friday, June 17, 2011 1:56 PM
> > To: 'General Discussion of SQLite Database'
> > Subject:
> >
> >
> > I am attempting to open an SQLite database on the Mac (OSX Snow Leopard)
> and am getting an error.  This is the code I am using:
> >
> >
> >   char      DBEnginePath[1000];
> >
> >   strcpy(DBEnginePath, "Macintosh HD:Applications:Adobe InDesign CS5:Plug-
> Ins:WPC_ID:IndexData.db");
> >   fprintf(stderr, "%s\n", DBEnginePath);                                    
> >     //  Sends
> correct path to stderr for verification.
> >   Result = sqlite3_open_v2(DBEnginePath, _ptr,
> SQLITE_OPEN_READONLY, NULL);  //  Errors out here.
> >
> >   const char *msg = sqlite3_errmsg(db_ptr);
> >   fprintf(stderr, "Here's the SQLite error message: %s\n", msg);            
> >     // Sent
> to stderr: "Unable to open database file."
> >
> >
> > I have verified that the file exists on the path described above.  What am 
> > I doing
> wrong?
> >
> > TIA!
> >
> > R,
> > John A.M. Darnell
> > Senior Programmer
> > Walsworth Publishing Company
> > Brookfield, MO
> > John may also be reached at
> johnamdarn...@gmail.com
> >
> > Trivia question Trivia question:  In The Lord of the Rings,Leglolas was a 
> > prince
> among the Silvan Elves.  What was the name of his father the King?  For extra
> credit, what was his surname?
> >
> >
> >
> > ___
> > 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] Opening a database on a Mac

2011-06-17 Thread Pavel Ivanov
>   strcpy(DBEnginePath, "Macintosh HD:Applications:Adobe InDesign 
> CS5:Plug-Ins:WPC_ID:IndexData.db");

Try to change path here to "/Applications/Adobe InDesign
CS5/Plug-Ins/WPC_ID/IndexData.db".


Pavel


On Fri, Jun 17, 2011 at 3:08 PM, john darnell
 wrote:
> Sorry to send this twice, but I realized that my first transmission did not 
> include a subject line.
>
> _
> From: john darnell
> Sent: Friday, June 17, 2011 1:56 PM
> To: 'General Discussion of SQLite Database'
> Subject:
>
>
> I am attempting to open an SQLite database on the Mac (OSX Snow Leopard) and 
> am getting an error.  This is the code I am using:
>
>
>   char      DBEnginePath[1000];
>
>   strcpy(DBEnginePath, "Macintosh HD:Applications:Adobe InDesign 
> CS5:Plug-Ins:WPC_ID:IndexData.db");
>   fprintf(stderr, "%s\n", DBEnginePath);                                      
>   //  Sends correct path to stderr for verification.
>   Result = sqlite3_open_v2(DBEnginePath, _ptr, SQLITE_OPEN_READONLY, 
> NULL);  //  Errors out here.
>
>   const char *msg = sqlite3_errmsg(db_ptr);
>   fprintf(stderr, "Here's the SQLite error message: %s\n", msg);              
>   // Sent to stderr: "Unable to open database file."
>
>
> I have verified that the file exists on the path described above.  What am I 
> doing wrong?
>
> TIA!
>
> R,
> John A.M. Darnell
> Senior Programmer
> Walsworth Publishing Company
> Brookfield, MO
> John may also be reached at 
> johnamdarn...@gmail.com
>
> Trivia question Trivia question:  In The Lord of the Rings,Leglolas was a 
> prince among the Silvan Elves.  What was the name of his father the King?  
> For extra credit, what was his surname?
>
>
>
> ___
> 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] (no subject)

2011-06-17 Thread john darnell
I am attempting to open an SQLite database on the Mac (OSX Snow Leopard) and am 
getting an error.  This is the code I am using:


   char  DBEnginePath[1000];

   strcpy(DBEnginePath, "Macintosh HD:Applications:Adobe InDesign 
CS5:Plug-Ins:WPC_ID:IndexData.db");
   fprintf(stderr, "%s\n", DBEnginePath);   
 //  Sends correct path to stderr for verification.
   Result = sqlite3_open_v2(DBEnginePath, _ptr, SQLITE_OPEN_READONLY, NULL); 
 //  Errors out here.

   const char *msg = sqlite3_errmsg(db_ptr);
   fprintf(stderr, "Here's the SQLite error message: %s\n", msg);   
 // Sent to stderr: "Unable to open database file."


I have verified that the file exists on the path described above.  What am I 
doing wrong?

TIA!

R,
John A.M. Darnell
Senior Programmer
Walsworth Publishing Company
Brookfield, MO
John may also be reached at 
johnamdarn...@gmail.com

Trivia question Trivia question:  In The Lord of the Rings,Leglolas was a 
prince among the Silvan Elves.  What was the name of his father the King?  For 
extra credit, what was his surname?



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


[sqlite] Opening a database on a Mac

2011-06-17 Thread john darnell
Sorry to send this twice, but I realized that my first transmission did not 
include a subject line.

_
From: john darnell
Sent: Friday, June 17, 2011 1:56 PM
To: 'General Discussion of SQLite Database'
Subject:


I am attempting to open an SQLite database on the Mac (OSX Snow Leopard) and am 
getting an error.  This is the code I am using:


   char  DBEnginePath[1000];

   strcpy(DBEnginePath, "Macintosh HD:Applications:Adobe InDesign 
CS5:Plug-Ins:WPC_ID:IndexData.db");
   fprintf(stderr, "%s\n", DBEnginePath);   
 //  Sends correct path to stderr for verification.
   Result = sqlite3_open_v2(DBEnginePath, _ptr, SQLITE_OPEN_READONLY, NULL); 
 //  Errors out here.

   const char *msg = sqlite3_errmsg(db_ptr);
   fprintf(stderr, "Here's the SQLite error message: %s\n", msg);   
 // Sent to stderr: "Unable to open database file."


I have verified that the file exists on the path described above.  What am I 
doing wrong?

TIA!

R,
John A.M. Darnell
Senior Programmer
Walsworth Publishing Company
Brookfield, MO
John may also be reached at 
johnamdarn...@gmail.com

Trivia question Trivia question:  In The Lord of the Rings,Leglolas was a 
prince among the Silvan Elves.  What was the name of his father the King?  For 
extra credit, what was his surname?



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


Re: [sqlite] Is there a difference between DELETE and UPDATE/INSERT in terms of syncing to disk?

2011-06-17 Thread Kevin Yoo
Simon,

Thank you for your response.

The callback function is called when Django's table object's delete method is 
called, and not by sqlite's DELETE command. I do not know what callback 
functionality is provided by sqlite, but I don't believe it is being used in 
this case. 

We have solved the problem by listening for a different signal, one that is 
called well after the deletion has occurred. Thanks to everyone for responding 
to my questions. 

Kevin Yoo
Certification Lead
Wurldtech Security Technologies
1680-401 West Georgia St.
Vancouver, BC, V6B 5A1
 
Phone: (604) 669 6674 ext. 232
Fax: (604) 669 2902

"ARE YOU ACHILLES CERTIFIED?"
 
This message is intended only for the named recipients.  This message may 
contain information that is privileged, confidential or exempt from disclosure 
under applicable law.  Any dissemination or copying of this message by anyone 
other than a named recipient is strictly prohibited.  If you are not a named 
recipient or an employee or agent responsible for delivering this message to a 
named recipient, please notify us immediately by telephone at 604-669-6674, and 
permanently destroy this message and any copies you may have. Email may not be 
secure unless properly encrypted.


-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Simon Slavin
Sent: June 15, 2011 3:48 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Is there a difference between DELETE and UPDATE/INSERT in 
terms of syncing to disk?


On 15 Jun 2011, at 10:38pm, Jean-Christophe Deschamps wrote:

>> and 
>> when the callback function is entered, Django claims that the DELETE 
>> statement has been executed.

Is this the callback function called /by/ the DELETE command ?  If so, it's 
called before the DELETE command is completed.

Simon.

___
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] 2nd Call For Papers, 18th Annual Tcl/Tk Conference 2011

2011-06-17 Thread Andreas Kupries
[[ Important Changes:

   The Conference Registration Page is live.

   Regarding special events we are looking into arranging a trip to
   the Air and Space Museum out near Dulles. This is currently a very
   tentative thing. If a local person would like to help with this
   please talk to "c...@cflynt.com".

]]

18th Annual Tcl/Tk Conference (Tcl'2011)
http://www.tcl.tk/community/tcl2011/

October 24 - 28, 2011
Comfort Suites Manassas

Manassas, Virgina, USA

Important Dates:

Abstracts and proposals due   August  26, 2011
Notification to authors   September 12, 2011
WIP and BOF reservations open August   1, 2011
Author materials due  October  9, 2011
Tutorials Start   October 24, 2011
Conference starts October 26, 2011

Email Contact:tclconfere...@googlegroups.com

Submission of Summaries

Tcl/Tk 2011 will be held in Manassas, Virgina, USA from
October 24 - 28, 2011. The program committee is asking for papers and
presentation proposals from anyone using or developing with Tcl/Tk
(and extensions). Past conferences have seen submissions covering a
wide variety of topics including:

* Scientific and engineering applications
* Industrial controls
* Distributed applications and Network Managment
* Object oriented extensions to Tcl/Tk
* New widgets for Tk
* Simulation and application steering with Tcl/Tk
* Tcl/Tk-centric operating environments
* Tcl/Tk on small and embedded devices
* Medical applications and visualization
* Use of different programming paradigms in Tcl/Tk and proposals for new
  directions.
* New areas of exploration for the Tcl/Tk language

This year is the fourth year that the Tcl community is participating
in the Google Summer of Code.  The conference program committee would
like to encourage submissions that report on the Tcl projects selected
for Google SoC 2011.

Submissions should consist of an abstract of about 100 words and a
summary of not more than two pages, and should be sent as plain text
to  no later than August 26,
2011. Authors of accepted abstracts will have until October 9, 2011
to submit their final paper for the inclusion in the conference
proceedings. The proceedings will be made available on digital media,
so extra materials such as presentation slides, code examples, code
for extensions etc. are encouraged.

Printed proceedings will be produced as an on-demand book at lulu.com

The authors will have 25 minutes to present their paper at the
conference.

The program committee will review and evaluate papers according to the
following criteria:

* Quantity and quality of novel content
* Relevance and interest to the Tcl/Tk community
* Suitability of content for presentation at the conference

Proposals may report on commercial or non-commercial systems, but
those with only blatant marketing content will not be accepted.

Application and experience papers need to strike a balance between
background on the application domain and the relevance of Tcl/Tk to
the application. Application and experience papers should clearly
explain how the application or experience illustrates a novel use of
Tcl/Tk, and what lessons the Tcl/Tk community can derive from the
application or experience to apply to their own development efforts.

Papers accompanied by non-disclosure agreements will be returned to
the author(s) unread. All submissions are held in the highest
confidentiality prior to publication in the Proceedings, both as a
matter of policy and in accord with the U. S. Copyright Act of 1976.

The primary author for each accepted paper will receive registration
to the Technical Sessions portion of the conference at a reduced rate.

Other Forms of Participation

The program committee also welcomes proposals for panel discussions of
up to 90 minutes. Proposals should include a list of confirmed
panelists, a title and format, and a panel description with position
statements from each panelist. Panels should have no more than four
speakers, including the panel moderator, and should allow time for
substantial interaction with attendees. Panels are not presentations
of related research papers.

Slots for Works-in-Progress (WIP) presentations and Birds-of-a-Feather
sessions (BOFs) are available on a first-come, first-served basis
starting in August 1, 2011. Specific instructions for reserving WIP
and BOF time slots will be provided in the registration information
available in June 2011. Some WIP and BOF time slots will be held open
for on-site reservation. All attendees with an interesting work in
progress should consider reserving a WIP slot.

Registration Information

More information on the conference is available the conference Web
site (http://www.tcl.tk/community/tcl2011/) and will be published on
various Tcl/Tk-related information channels.

Reservations for hotel suites can be made by calling
(703) 686-1100. Be certain to mention that you are with the Tcl/Tk
Conference to get the Tcl/Tk Conference room rate.

To keep in touch with 

Re: [sqlite] [sqlite-dev] Is there an option to not lock during transaction?

2011-06-17 Thread Pavel Ivanov
> Doesn't enabling WAL mode address the transaction size limit?

Yes, you are right. WAL mode will eliminate transaction size issue,
although there will be a WAL-file size issue. ;) But that issue is
only about disk space, nothing related to locking of reading
transactions.


Pavel


On Fri, Jun 17, 2011 at 1:18 AM, Florian Weimer  wrote:
> * Pavel Ivanov:
>
>> To answer your original question: if you disable shared cache, start
>> reading transaction on one connection and start writing transaction on
>> the other connection then you'll be able to read on the first
>> connection database in the state it was before writing transaction.
>> But if your writing transaction will grow too big then it won't be
>> able to proceed until reading transaction is finished.
>
> Doesn't enabling WAL mode address the transaction size limit?
> ___
> 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] System.Data.SQLite ADO.NET cannot open databases in WAL mode

2011-06-17 Thread Sougato Das

It seems that the current .NET wrapper for SQLite, which does not use the very 
latest version of SQLite, cannot access SQLite databases in WAL mode. Does 
anyone know a workaround for this, or any other way to access SQLite databases 
in WAL mode via .NET? Or do I basically have to wait for the .NET wrapper to 
upgrade to the latest version of SQLite?

I am new to this listserve, so apologies if this was already asked previously.

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


Re: [sqlite] need help with a query using datetime

2011-06-17 Thread Igor Tandetnik
Black, Michael (IS)  wrote:
> sqlite> create table t(d date);
> sqlite> insert into t values('2011-12-31 09:00');
> sqlite> insert into t values('2011-12-31 12:15');
> sqlite> select d,substr(datetime(d,'-12 hours'),1,16) from t;
> 2011-12-31 09:00|2011-12-30 21:00
> 2011-12-31 12:15|2011-12-31 00:15

In place of datetime and substr, consider

strftime('%Y-%m-%d %H:%M', d, '-12 hours')

-- 
Igor Tandetnik

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


Re: [sqlite] need help with a query using datetime

2011-06-17 Thread Ruth Ivimey-Cook
On 17/06/2011 12:10, looki wrote:
> First column holds the givin datetime from my table and the second column
> should show the datetime from first row but 12 hours before. for example:
>
> '2011-12-31 09:00' '2011-12-30 21:00'
> '2011-12-31 12:15' '2011-12-30 00:15'
> ...
>
> looks simple but datetime was not sufficient for this in my research.

For MySQL, the adddate() operator will do the trick:
  select theDate, adddate(theDate,interval -12 hour) from table;

Does Sqlite have this too?
Ruth
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] need help with a query using datetime

2011-06-17 Thread Black, Michael (IS)
sqlite> create table t(d date);
sqlite> insert into t values('2011-12-31 09:00');
sqlite> insert into t values('2011-12-31 12:15');
sqlite> select d,substr(datetime(d,'-12 hours'),1,16) from t;
2011-12-31 09:00|2011-12-30 21:00
2011-12-31 12:15|2011-12-31 00:15



Michael D. Black

Senior Scientist

NG Information Systems

Advanced Analytics Directorate




From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of looki [looki1...@yahoo.com]
Sent: Friday, June 17, 2011 6:10 AM
To: sqlite-users@sqlite.org
Subject: EXT :[sqlite] need help with a query using datetime


Hi,
i have a table which holds dates like
'2011-12-31 09:00' and i now want to write a query which gives me 2 columns.

First column holds the givin datetime from my table and the second column
should show the datetime from first row but 12 hours before. for example:

'2011-12-31 09:00' '2011-12-30 21:00'
'2011-12-31 12:15' '2011-12-30 00:15'
...

looks simple but datetime was not sufficient for this in my research.

Very thanks for your help.

Greetz looki



--
View this message in context: 
http://old.nabble.com/need-help-with-a-query-using-datetime-tp31868064p31868064.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
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] need help with a query using datetime

2011-06-17 Thread looki

Hi,
i have a table which holds dates like
'2011-12-31 09:00' and i now want to write a query which gives me 2 columns.

First column holds the givin datetime from my table and the second column
should show the datetime from first row but 12 hours before. for example:

'2011-12-31 09:00' '2011-12-30 21:00'
'2011-12-31 12:15' '2011-12-30 00:15'
...

looks simple but datetime was not sufficient for this in my research. 

Very thanks for your help.

Greetz looki



-- 
View this message in context: 
http://old.nabble.com/need-help-with-a-query-using-datetime-tp31868064p31868064.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