Re: [sqlite] PRAGMA table_info

2006-04-13 Thread Christian Werner
"Jackson, Douglas H" wrote:
> 
> This leaves you to parse the DDL from sqlite_master.
> Doug

... or to correlate 'pragma table_info(tablename)'
with 'pragma index_info(tablename)'. Some (unreadable,
imperfect) example code can be found in the ODBC driver e.g.
in the functions SQLPrimaryKeys(), SQLSpecialColumns(),
SQLStatistics(), and the internal function fixupdyncols().

Regards,
Christian


RE: [sqlite] PRAGMA table_info

2006-04-13 Thread Robert Simpson
> -Original Message-
> From: Marco Bambini [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 13, 2006 2:38 PM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] PRAGMA table_info
> 
> Using PRAGMA table_info(...) there is no way to know if a 
> column is declared as unique and/or autoincrement.
> Am I missing something?
>
> Is there a way to get these info?
 
You'll have to run a few hoops to get this information.

First you can prepare a "SELECT * FROM " statement, then call 
sqlite3_table_column_metadata to get primary key and autoincrement
information about the column(s) in the statement.

To get uniqueness, it's a little more convoluted.  First, if the column is
of type "integer" and is a primary key, and is the only primary key in a
table, then it is also implied to be unique.  In such a case, no real index
is created (it's a rowid), so you can't find that information out by looking
in the indexes.

Once you've eliminated the rowids, you'll have to look through all the
indexes to find out if the given column is in a given index.  If the index
is a unique index, and has only one column, then that column is unique.

I think that covers all the cases ...

Robert




[sqlite] How to verify sqlite file?

2006-04-13 Thread Charlie Li
Is there any way to verify a file is sqlite3 file? When I tried to open  a 
non-sqlite file by  sqlite_open(), the system crash. I checked  the source 
codes and found no file type checking.  The final trace  is toward to page.c 
file.  How to  revise code to make   sqlite more reliable.
  
  Charlie 
  

-
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ 
countries) for 2ยข/min or less.

Re: [sqlite] Re: Structured or Object-Oriented

2006-04-13 Thread koneill

- Original Message -
From: "John Stanton" <[EMAIL PROTECTED]>
To: 
Sent: Friday, April 14, 2006 1:32 AM
Subject: Re: [sqlite] Re: Structured or Object-Oriented



> >
> I was always impressed with Dijkstra's contention that a programmer's
> most important quality is a familiarity and skill with mathematics.  The
> ability to think in abstract terms and understand the concept of proof
> of correctness is certainly more important than learning a certain
> methodology and blindly applying it.
> JS

I agree with the basic idea except in that it does not really relate to
mathematics as such:
'The ability to think in abstract terms and understand the concept of proof
of correctness' could be considered a basic principle of philosophy and by
application of science;
In the 1970's I was studying biology and the most earth shattering
concept/rule that came my way was 'always relate structure to function', a
principle which 'encapsulates' OOP in five words (or four if you remove the
'always');
Biology in the evolutionary sense is not concerned with correctness but with
the 'fittest', that is, that which functions best;
there is no proof, correctness or methodology, only that which works;




Re: [sqlite] Re: Structured or Object-Oriented

2006-04-13 Thread John Stanton

Robert Simpson wrote:

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 



You should design your interface using whatever design method 
you are most comfortable with.  Or (better) just design your 
interface using creativity and good sense and don't worry so 
much about rigidly defined design methods.



I had a little chuckle at this.  I was reminded of the old PBS painting
shows on TV that I used to watch.  The artist would make "happy little
trees" and flit about the canvas.  His little dabs and whips of the
paintbrush would transform into a wooded glade, a rushing river, mountains
with the sun dancing off the edges ...

Of course, when I tried to do the same thing, it turned out like brown
blobs.  When your hand automatically knows how to turn, and the brushes are
so familiar you know which one you have just by the feel of it, then you can
paint with the freedom seen on the TV shows.  Until then, you'll just make
brown blobs.

It's the same with programming and programming languages, really.  All the
books you read and courses you take in college are just there to help you
get familiar with the brushes and the canvas.  They'll help keep you from
making brown blobs, but you'll never make a masterpiece by the book.

Robert


I was always impressed with Dijkstra's contention that a programmer's 
most important quality is a familiarity and skill with mathematics.  The 
ability to think in abstract terms and understand the concept of proof 
of correctness is certainly more important than learning a certain 
methodology and blindly applying it.

JS


Re: [sqlite] sqlite3_update_hook

2006-04-13 Thread John Stanton
A wise computer scientist once told me "In Computer Science every 
problem can be solved by yet another level of indirection".  Your 
problem is no exception.

JS

Cameron Tofer wrote:
The rowid of the table's record in the sqlite_master table would be 
great, but really any unique integer that I can later use to get the 
table's name would be fine.


Dennis Cote wrote:


Cameron Tofer wrote:


Hi,
   I'd like to modifiy sqlite3_update_hook so the callback returns 
the table's id instead of the table's name.  I'm not worried about 
proposing any official changes to the spec but rather a small 
customization for myself.  Can anyone point me in the right direction 
for this? At the point where the callback is made I'm not sure what's 
available.  thanks.  -cam



Cameron,

What do you mean by the table's ID? Do you want the table's root page, 
the rowid of the table's record in the sqlite_master table, or 
something else? In SQL the table's name is its ID.


Dennis Cote








Re: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread John Stanton
Aaron, your question indicates that you need to read a bit more deeply 
in general CS theory as a prelude to your project.  Sqlite is basically 
a simplified implementation of basic SQL, and is a just library of 
functions, not an entity.  With it you can build to your chosen model.


Think of looking at a pile of bricks and asking whether they are modern, 
post-modern or baroque architecture.  They are any or none of them, 
strictly depending upon the ideas of the architect.

JS

Aaron Jones wrote:

Hi Fred, when John replied and stated that he was not sure is SQLite was
Structure or OO, I was just waiting for other people to reply also to
confirm this, I do not have any beef with anyone.  Sorry if it came accross
this way.

Aaron

On 13/04/06, Fred Williams <[EMAIL PROTECTED]> wrote:


It would appear the first responder gave you your answer.  So where's
the beef?

If you don't like the answer, don't complain to us about service :-)

Fred



-Original Message-
From: Jay Sprenkle [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 13, 2006 8:20 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Structured or Object-Oriented?


On 4/13/06, Aaron Jones <[EMAIL PROTECTED]> wrote:


How come you all reply to other peoples emails but only 1


person relied to


mine?


I didn't reply because I don't know anything about mono.
I wouldn't take it personally.









[sqlite] Multiple prepared statements work on Windows... fails on Mac OS X

2006-04-13 Thread Slater, Chad
Hello,
 

I'm using two prepared statements in a block of cross platform C++ code
like this (very roughly):
 

{
sqlite3_stmt * pstmt1 = NULL;
sqlite3_stmt * pstmt2 = NULL;
 
pstmt1 = PrepareAndBind(...); // Prepare and bind one statement
pstmt2 = PrepareAndBind(...); // Prepare and bind a different
statement

sqlite3_step(pstmt1); // Returns SQLITE_ROW (as expected)
sqlite3_step(pstmt2); // Returns SQLITE_DONE on Mac OS X  but
returns SQLITE_ROW on Windows (same database. same queries)

sqlite3_finalize(pstmt1);
sqlite3_finalize(pstmt2);
 
}
 

The second step function call returns SQLITE_DONE on Mac OS X (when it
should have found records and returned SQLITE_ROW). On Windows, this
always works (both step function calls return SQLITE_ROW and I can
iterate through both sets of records using step until finished).
 
To work around this so it works on both platforms, I iterate through the
records using step for pstmt1 and call sqlite3_finalize before calling
sqlite3_step on pstmt2. This solution works on both platforms.
 
This could easily be a bug in my code (I have built some light wrappers
to accomplish most of this). But I have copied the same database from
Mac to Windows and ran the same queries to make sure the data is in the
db and the queries work fine. And I've commented out one prepared
statement or the other and both return results. But as soon as I
uncomment the other statement, it stops returning rows on the Mac as
I've described above.
 
Are there any known issues with using multiple prepared statements like
I have done? Am I doing something wrong (maybe I should be calling
sqlite3_reset somewhere along the way?)


RE: [sqlite] PRAGMA table_info

2006-04-13 Thread Jackson, Douglas H
This leaves you to parse the DDL from sqlite_master.
Doug

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 13, 2006 2:51 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] PRAGMA table_info

Marco Bambini <[EMAIL PROTECTED]> wrote:
> Using PRAGMA table_info(...) there is no way to know if a column is  
> declared as unique and/or autoincrement.
> Am I missing something?
> Is there a way to get these info?
> 

There is no pragma currently (that I recall) for finding 
if a column is unique or autoincrement.
--
D. Richard Hipp   <[EMAIL PROTECTED]>


Re: [sqlite] PRAGMA table_info

2006-04-13 Thread drh
Marco Bambini <[EMAIL PROTECTED]> wrote:
> Using PRAGMA table_info(...) there is no way to know if a column is  
> declared as unique and/or autoincrement.
> Am I missing something?
> Is there a way to get these info?
> 

There is no pragma currently (that I recall) for finding 
if a column is unique or autoincrement.
--
D. Richard Hipp   <[EMAIL PROTECTED]>



Re: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread koneill
I have been doing various experiments in applying OO to databases and might
have a few suggestions to make.
I would be interested to provoke debate as to how to apply OOP to a database
like SQLite;

I haven't quite understood why your tutor wants to know if the database is
structured using OO: this would affect how you program the server side of
the database (not very relevant to SQLite), but the Client side (or user
interface) can be created using whatever principles you wish;

Oracle has provision for OO, as I understand with a preference for Java
oriented programming, though the object oriented structure works also in
PL/SQL (PL/SQL and Java are contentious concerning the direction that Oracle
will be taking for its programming language: some think that ultimately Java
will take over: there is a certain logic in pushing towards using the same
language for the frontend as you use for the backend);
I have followed SQLite's evolution with interest (as a Delphi programmer now
moving towards C# and possibly Java), though as I understand it, SQLite
isn't (yet?) structured towards using objects as part of its internal
programming language;
Oracle has the 'package' which internally groups functions and procedures
together with variable declarations: a good way of applying OOP since it
favours modularity; Oracle has also the Object Type, the object Table and
the Object View (the Object Type is analogous to the Class in C++ or Java)
and all the usual elements of OOP (Inheritance, Encapsulation, Polymorphism
etc.);
I presume that to apply a similar structure to SQLite, it would require the
development of an outer object-oriented 'shell' which would have the non
object-oriented SQlite 'motor' at its core: the database 'objects' would
have to persist in the database in some way (presumably implying that the
database contains a structure which would create and maintain them);
Normally Objects on the database side would be part of a database server and
would imply the use of a complex language interpreter on the server side
(SQLite is not really a server in this sense and has only a simple internal
language: Lite after all!!);

In Delphi, I made a multi tier program, which was object-oriented, using COM
and dbexpress to connect to SQLite :
when a module was called on the client, instructions were sent to the client
server which then created its data objects dynamically by means of COM
function calls, opened a session with the database etc
Another set of instructions from the client executed functions on the client
server which sent the corresponding SQL instructions to the database;
On the client I created instanced 'Table_Objects', one for each table I
wanted to use: these had various methods that I inherited from an ancestor
TableObjectType (insert, update, delete etc): just calling these functions
with the field values caused the SQL script to be parsed and executed on the
server; any 'stored procedure' type functionality would be done by creating
specific OO structures (in this case using Delphi) on the server side;
(Obviously the client, server and SQLite modules can be on separate
computers, though the concept is really for multiple clients)

As far as your project is concerned, you could propose writing an object
oriented module that could work as the 'client server' part: this would
dialog with the SQLite database and with all instances of the clients by
opening an 'SQLite session' for each; a second 'client module' could manage
'table objects' which encapsulate the stuctures on the database and which
retrieve user data as required and which update the database by dialoguing
with the client server; (the end result would be a bit like one of the
heavyweight RDBMS's like Oracle, except that it would be lightweight and it
would be exclusively object oriented in that there is no need for a second
'server side language' like PL/SQL or whatever, since this functionality is
'compiled in' on the server and on the client but not required in the
database 'motor' itself);
As I understand, you are working in C#: I have been working on a project in
C# for generating code from the database table structure which will
encapsulate table functions in a TableObject (as described above in Delphi
except that I wrote the code by hand, whereas the C# program generates it):
the generated code that it exports creates a descendant object in C# (or
Delphi or Java) which in turn can execute SQL scripts in a single or
multitier situation depending on where you decide to place the objects and
how you connect to the database (if you go for single tier you could compile
the 'client' and 'client server' functionality into the same executable,
though you would maintain clarity by keeping their modularity distinct and
separate);

Hope my comments are useful, and I would appreciate any feedback,

regards,

Kevin O'Neill



[sqlite] PRAGMA table_info

2006-04-13 Thread Marco Bambini
Using PRAGMA table_info(...) there is no way to know if a column is  
declared as unique and/or autoincrement.

Am I missing something?
Is there a way to get these info?

Thanks,
Marco Bambini




[sqlite] Re: timestamp in SQLITE DB

2006-04-13 Thread drh
[EMAIL PROTECTED] wrote:
> "Fang Fang" <[EMAIL PROTECTED]> wrote:
> > Hello,
> > 
> > Could you please let me know how to retrieve the current time from SQLITE 
> > DB?
> > Will it  be GMT time or local time?
> > 
> 
> SELECT current_timestamp;

Forgot to say: UTC (a.k.a. GMT)
--
D. Richard Hipp   <[EMAIL PROTECTED]>



[sqlite] Re: timestamp in SQLITE DB

2006-04-13 Thread drh
"Fang Fang" <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> Could you please let me know how to retrieve the current time from SQLITE DB?
> Will it  be GMT time or local time?
> 

SELECT current_timestamp;
--
D. Richard Hipp   <[EMAIL PROTECTED]>



Re: [sqlite] Re: Using Like

2006-04-13 Thread Nuno Lucas
On 4/13/06, Roger <[EMAIL PROTECTED]> wrote:
> Thanks for that. Its just that i am developing an application using
> PHP/Sqlite and was having a major problem with escaping. But i got it
> eventually. for anyone who might have a problem its.
>
>  .
>
> $SQL = "Select *
> From people
> where name LIKE '".$_GET['criteria']."'
> Order by Name ASC ";
> ..
> ?>

I don't do any web development and don't know PHP, but isn't this an
example of how not to do things?
It is screaming "SQL injection atack" all over it.

Off course I can be completelly off, but I don't think so.


Best regards,
~Nuno Lucas


Re: [sqlite] sqlite3_update_hook

2006-04-13 Thread Dennis Cote

Cameron Tofer wrote:

The rowid of the table's record in the sqlite_master table would be 
great, but really any unique integer that I can later use to get the 
table's name would be fine.



Cameron,

Then you should be able to execute the following SQL query in your 
sqlite3_update_hook handler itself to convert the table name to an 
integer rowid.


 select rowid from database_name.sqlite_master
 where type = 'table' and name = table_name

This rowid value will not be useful if you are using multiple databases, 
because you won't know which database it comes from. But, if you have a 
single database then you can ignore the database name (i.e. it is always 
the same and matches the open database). The query then simplifies to


 select rowid from sqlite_master
 where type = 'table' and name = table_name

To do anything useful with the table you will have to convert this rowid 
back into a table name to build an SQL query. You can convert the rowid 
back to a table name using the inverse lookup:


 select name from sqlite_master
 where rowid = table_id

You could make a modified version of SQLite that does this before 
calling the sqlite3_update_hook handler, and then passing this rowid 
back. If you do this you will have a nonstandard library which you have 
to maintain yourself.


If you are trying to avoid storing the names, you could create a small 
cache in your application that maps the names to integers. A vector or 
array of strings should work. You scan the array looking for the name. 
If found, use its index as your integer id, if not, add it to the array 
and then use its index as your id.


I don't know what your applications requires, but it seems to me there 
must be a better way than creating a modified library that returns 
pseudo ids for tables which you can't use directly.


HTH
Dennis Cote


Re: [sqlite] Re: Structured or Object-Oriented

2006-04-13 Thread Aaron Jones
Hi Robert, yes I know if I follow the books etc I will be limited as to what
I can achieve but at the moment I am concentrating on getting a high grade
pass on my degree then I set my mnd on the masterpieces ;)


On 13/04/06, Robert Simpson <[EMAIL PROTECTED]> wrote:
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>
> > You should design your interface using whatever design method
> > you are most comfortable with.  Or (better) just design your
> > interface using creativity and good sense and don't worry so
> > much about rigidly defined design methods.
>
> I had a little chuckle at this.  I was reminded of the old PBS painting
> shows on TV that I used to watch.  The artist would make "happy little
> trees" and flit about the canvas.  His little dabs and whips of the
> paintbrush would transform into a wooded glade, a rushing river, mountains
> with the sun dancing off the edges ...
>
> Of course, when I tried to do the same thing, it turned out like brown
> blobs.  When your hand automatically knows how to turn, and the brushes
> are
> so familiar you know which one you have just by the feel of it, then you
> can
> paint with the freedom seen on the TV shows.  Until then, you'll just make
> brown blobs.
>
> It's the same with programming and programming languages, really.  All the
> books you read and courses you take in college are just there to help you
> get familiar with the brushes and the canvas.  They'll help keep you from
> making brown blobs, but you'll never make a masterpiece by the book.
>
> Robert
>
>
>


Re: [sqlite] Re: Structured or Object-Oriented

2006-04-13 Thread Aaron Jones
Hi Jay, yeah I need justification and they said I cant use the fact that I
already know how to do it this way as a justification, but if I elaborate on
the fact that most other projects use this method and the reasons why I
think that would be an OK justification.

Many thanks.

Aaron.

On 13/04/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote:
>
> On 4/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > You assume that the design method used to build a component
> > has some bearing on the design method used to build a
> > user interface to that component.  This is false.  Either
> > your instructor is wrong or your are misquoting him.
>
> I feel the same way, but I think he's looking for justifications why
> he made a specific choice for his disertation. To a large part of humanity
> "because everyone else chose that method" is a suitable justification.
> As they used to tell us "nobody ever got fired for chosing IBM".
> His advisor may have been giving him good advice there.
>


RE: [sqlite] Re: Structured or Object-Oriented

2006-04-13 Thread Robert Simpson
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 

> You should design your interface using whatever design method 
> you are most comfortable with.  Or (better) just design your 
> interface using creativity and good sense and don't worry so 
> much about rigidly defined design methods.

I had a little chuckle at this.  I was reminded of the old PBS painting
shows on TV that I used to watch.  The artist would make "happy little
trees" and flit about the canvas.  His little dabs and whips of the
paintbrush would transform into a wooded glade, a rushing river, mountains
with the sun dancing off the edges ...

Of course, when I tried to do the same thing, it turned out like brown
blobs.  When your hand automatically knows how to turn, and the brushes are
so familiar you know which one you have just by the feel of it, then you can
paint with the freedom seen on the TV shows.  Until then, you'll just make
brown blobs.

It's the same with programming and programming languages, really.  All the
books you read and courses you take in college are just there to help you
get familiar with the brushes and the canvas.  They'll help keep you from
making brown blobs, but you'll never make a masterpiece by the book.

Robert




Re: [sqlite] sqlite3_update_hook

2006-04-13 Thread Cameron Tofer
The rowid of the table's record in the sqlite_master table would be 
great, but really any unique integer that I can later use to get the 
table's name would be fine.


Dennis Cote wrote:

Cameron Tofer wrote:


Hi,
   I'd like to modifiy sqlite3_update_hook so the callback returns 
the table's id instead of the table's name.  I'm not worried about 
proposing any official changes to the spec but rather a small 
customization for myself.  Can anyone point me in the right direction 
for this? At the point where the callback is made I'm not sure what's 
available.  thanks.  -cam



Cameron,

What do you mean by the table's ID? Do you want the table's root page, 
the rowid of the table's record in the sqlite_master table, or 
something else? In SQL the table's name is its ID.


Dennis Cote






Re: [sqlite] Re: Structured or Object-Oriented

2006-04-13 Thread Jay Sprenkle
On 4/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> You assume that the design method used to build a component
> has some bearing on the design method used to build a
> user interface to that component.  This is false.  Either
> your instructor is wrong or your are misquoting him.

I feel the same way, but I think he's looking for justifications why
he made a specific choice for his disertation. To a large part of humanity
"because everyone else chose that method" is a suitable justification.
As they used to tell us "nobody ever got fired for chosing IBM".
His advisor may have been giving him good advice there.


[sqlite] Re: Structured or Object-Oriented

2006-04-13 Thread drh
"Aaron Jones" <[EMAIL PROTECTED]> wrote:
> Hi, sorry to bother you, but I was wondering if you could tell me if you
> designed SQlite using a Structured or Object-Oriented methodology please as
> I am designing an interface to SQLite and my supervisor said if I knew what
> methodology was used for designing SQLite this would be a good justification
> for my choosing a methodology for designing the interface.
> 

I have spent 20 minutes trying to think of a reasonable
answer to your question and have come up with nothing.
The best answer I have is this:  Your question is based on 
multiple false premises and thus has no answer.

You assume that SQLite was designed using either a
structure or an object-oriented procedure.  (Methodology
is a trendy word to use in that context, but when it is
it is misused.  "Design method" or "design procedure" is
correct.  "Design methodology" means the study of various
design methods - not the design method itself.)  This is
false.  I do not design use rigidly defined design methods
found in books.  Book-defined design methods generally
lead to bloated designs that rarely work.

You assume that the design method used to build a component
has some bearing on the design method used to build a
user interface to that component.  This is false.  Either 
your instructor is wrong or your are misquoting him.

You should design your interface using whatever design
method you are most comfortable with.  Or (better) just
design your interface using creativity and good sense
and don't worry so much about rigidly defined design
methods.

--
D. Richard Hipp   <[EMAIL PROTECTED]>




Re: [sqlite] sqlite3_update_hook

2006-04-13 Thread Dennis Cote

Cameron Tofer wrote:


Hi,
   I'd like to modifiy sqlite3_update_hook so the callback returns the 
table's id instead of the table's name.  I'm not worried about 
proposing any official changes to the spec but rather a small 
customization for myself.  Can anyone point me in the right direction 
for this? At the point where the callback is made I'm not sure what's 
available.  thanks.  -cam



Cameron,

What do you mean by the table's ID? Do you want the table's root page, 
the rowid of the table's record in the sqlite_master table, or something 
else? In SQL the table's name is its ID.


Dennis Cote




Re: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread Aaron Jones
Hi, I never saw the smiley, sorry. lol.

Thanx, I will need it.

Aaron.

On 13/04/06, Fred Williams <[EMAIL PROTECTED]> wrote:
>
> And, don't forget I used the required simley face :-)
>
> BUT, I do know that when you are up to your a__ in alligators, it is
> difficult to remember the objective was to drain the swamp. (or check
> for smiley faces.)
>
> Good luck alligator hunting!
>
> Fred
>
> > -Original Message-
> > From: Aaron Jones [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, April 13, 2006 10:24 AM
> > To: sqlite-users@sqlite.org
> > Subject: Re: [sqlite] Structured or Object-Oriented?
> >
> >
> > Hi Fred, when John replied and stated that he was not sure is
> > SQLite was
> > Structure or OO, I was just waiting for other people to reply also to
> > confirm this, I do not have any beef with anyone.  Sorry if
> > it came accross
> > this way.
> >
> > Aaron
> >
> > On 13/04/06, Fred Williams <[EMAIL PROTECTED]> wrote:
> > >
> > > It would appear the first responder gave you your answer.
> > So where's
> > > the beef?
> > >
> > > If you don't like the answer, don't complain to us about service :-)
> > >
> > > Fred
> ...
> >
>
>


[sqlite] sqlite3_update_hook

2006-04-13 Thread Cameron Tofer

Hi,
   I'd like to modifiy sqlite3_update_hook so the callback returns the 
table's id instead of the table's name.  I'm not worried about proposing 
any official changes to the spec but rather a small customization for 
myself.  Can anyone point me in the right direction for this? At the 
point where the callback is made I'm not sure what's available.  
thanks.  -cam


RE: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread Fred Williams
And, don't forget I used the required simley face :-)

BUT, I do know that when you are up to your a__ in alligators, it is
difficult to remember the objective was to drain the swamp. (or check
for smiley faces.)

Good luck alligator hunting!

Fred

> -Original Message-
> From: Aaron Jones [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 13, 2006 10:24 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Structured or Object-Oriented?
>
>
> Hi Fred, when John replied and stated that he was not sure is
> SQLite was
> Structure or OO, I was just waiting for other people to reply also to
> confirm this, I do not have any beef with anyone.  Sorry if
> it came accross
> this way.
>
> Aaron
>
> On 13/04/06, Fred Williams <[EMAIL PROTECTED]> wrote:
> >
> > It would appear the first responder gave you your answer.
> So where's
> > the beef?
> >
> > If you don't like the answer, don't complain to us about service :-)
> >
> > Fred
...
>



Re: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread Aaron Jones
Hi Dennis, thank you for your comments,  my question was a bit vague and i
will try and remedy this in the future.

I was just wanting to know whether it was structured or OO as my supervisor
said if I could find this out, this would be a good justification as to why
I chose structured or OO for the design of my interface.

I don't know mono that well either, but it is an open source version of the
.net framework and I know how to use vb.net so I should be able to use this
when i come round to using it as I could not use vb.net for open-source,
cross-platform.

I'm still in the analysis/literature review stage of the project at the
moment so it will be a while before I get round to building the product so
mono might have fixed the windows.forms issue by then anyway.  there
definitly is a wrapper for mono so hopefully it will work.

thanks again.

Aaron.

On 13/04/06, Dennis Cote <[EMAIL PROTECTED]> wrote:
>
> Aaron Jones wrote:
>
> >How come you all reply to other peoples emails but only 1 person relied
> to
> >mine?
> >
> >
> Aaron,
>
> Referring to your original posting:
>
> >Hi, I am doing a project for University where I am creating a
> >cross-platform, open-source GUI to SQLite, I am going to be using mono to
> >build it, do you think this will be ok or do you think I will encounter
> any
> >problems along the way?  I've noticed there is a wrapper for mono, but
> where
> >mono is unable to use windows.forms it uses GTK#, and I don't think there
> is
> >a wrapper for GTK#, but I am not sure if this will be needed.
>
> I don't know Mono well enough to comment about problems you may have using
> it. I believe GTK# is only a wrapper for the GTK gui, and it should not have
> any bearing on your use of SQLite (but I could be mistaken). If there is a
> mono wrapper for SQLite, and it works, you should be off to the races.
>
>
> >Also, was SQLite created using a structured or object-oriented methodolgy
> so
> >that I can design the interface in the same way.
> >
>
> The only person who can tell you what methodology was used to design
> SQLite is the author, Richard Hipp. I doubt that his methodology can be
> neatly pigeon holed into one of these two cases. In any case the API (see
> http://www.sqlite.org/capi3ref.html) is what you have to work with, and it
> is what it is. You can use whatever methodology you want to develop your
> application.
>
>
> >Any suggestions would be greatfully appreciated.
>
> Work hard at University. Have some fun, but don't waste your time. :-)
>
> In general terms, you have asked very general questions. For future
> reference, you will be more likely to get a suitable response if you ask
> more specific questions (like your second posting).
>
>
> HTH
> Dennis Cote
>
>
>


Re: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread Aaron Jones
Hi John, thank you for your kind words.

Aaron.

On 13/04/06, John Newby <[EMAIL PROTECTED]> wrote:
>
> I said I was not sure if my answer was correct or not, so he probably just
> wanted re-assuring that my answer was correct, give him a break, he'll be
> under enough stress doing his project for uni without us getting on his
> back.
>
> On 13/04/06, Fred Williams <[EMAIL PROTECTED]> wrote:
> >
> > It would appear the first responder gave you your answer.  So where's
> > the beef?
> >
> > If you don't like the answer, don't complain to us about service :-)
> >
> > Fred
> >
> > > -Original Message-
> > > From: Jay Sprenkle [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, April 13, 2006 8:20 AM
> > > To: sqlite-users@sqlite.org
> > > Subject: Re: [sqlite] Structured or Object-Oriented?
> > >
> > >
> > > On 4/13/06, Aaron Jones <[EMAIL PROTECTED]> wrote:
> > > > How come you all reply to other peoples emails but only 1
> > > person relied to
> > > > mine?
> > >
> > > I didn't reply because I don't know anything about mono.
> > > I wouldn't take it personally.
> >
> >
>
>


Re: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread Aaron Jones
Hi Fred, when John replied and stated that he was not sure is SQLite was
Structure or OO, I was just waiting for other people to reply also to
confirm this, I do not have any beef with anyone.  Sorry if it came accross
this way.

Aaron

On 13/04/06, Fred Williams <[EMAIL PROTECTED]> wrote:
>
> It would appear the first responder gave you your answer.  So where's
> the beef?
>
> If you don't like the answer, don't complain to us about service :-)
>
> Fred
>
> > -Original Message-
> > From: Jay Sprenkle [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, April 13, 2006 8:20 AM
> > To: sqlite-users@sqlite.org
> > Subject: Re: [sqlite] Structured or Object-Oriented?
> >
> >
> > On 4/13/06, Aaron Jones <[EMAIL PROTECTED]> wrote:
> > > How come you all reply to other peoples emails but only 1
> > person relied to
> > > mine?
> >
> > I didn't reply because I don't know anything about mono.
> > I wouldn't take it personally.
>
>


Re: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread Dennis Cote

Aaron Jones wrote:


How come you all reply to other peoples emails but only 1 person relied to
mine?



Aaron,

Referring to your original posting:


Hi, I am doing a project for University where I am creating a
cross-platform, open-source GUI to SQLite, I am going to be using mono to
build it, do you think this will be ok or do you think I will encounter any
problems along the way?  I've noticed there is a wrapper for mono, but where
mono is unable to use windows.forms it uses GTK#, and I don't think there is
a wrapper for GTK#, but I am not sure if this will be needed.


I don't know Mono well enough to comment about problems you may have using it. 
I believe GTK# is only a wrapper for the GTK gui, and it should not have any 
bearing on your use of SQLite (but I could be mistaken). If there is a mono 
wrapper for SQLite, and it works, you should be off to the races.



Also, was SQLite created using a structured or object-oriented methodolgy so
that I can design the interface in the same way.



The only person who can tell you what methodology was used to design SQLite is the author, Richard Hipp. I doubt that his methodology can be neatly pigeon holed into one of these two cases. In any case the API (see http://www.sqlite.org/capi3ref.html) is what you have to work with, and it is what it is. You can use whatever methodology you want to develop your application. 




Any suggestions would be greatfully appreciated.


Work hard at University. Have some fun, but don't waste your time. :-) 


In general terms, you have asked very general questions. For future reference, 
you will be more likely to get a suitable response if you ask more specific 
questions (like your second posting).


HTH
Dennis Cote




Re: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread John Newby
I said I was not sure if my answer was correct or not, so he probably just
wanted re-assuring that my answer was correct, give him a break, he'll be
under enough stress doing his project for uni without us getting on his
back.

On 13/04/06, Fred Williams <[EMAIL PROTECTED]> wrote:
>
> It would appear the first responder gave you your answer.  So where's
> the beef?
>
> If you don't like the answer, don't complain to us about service :-)
>
> Fred
>
> > -Original Message-
> > From: Jay Sprenkle [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, April 13, 2006 8:20 AM
> > To: sqlite-users@sqlite.org
> > Subject: Re: [sqlite] Structured or Object-Oriented?
> >
> >
> > On 4/13/06, Aaron Jones <[EMAIL PROTECTED]> wrote:
> > > How come you all reply to other peoples emails but only 1
> > person relied to
> > > mine?
> >
> > I didn't reply because I don't know anything about mono.
> > I wouldn't take it personally.
>
>


RE: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread Fred Williams
It would appear the first responder gave you your answer.  So where's
the beef?

If you don't like the answer, don't complain to us about service :-)

Fred

> -Original Message-
> From: Jay Sprenkle [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 13, 2006 8:20 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Structured or Object-Oriented?
>
>
> On 4/13/06, Aaron Jones <[EMAIL PROTECTED]> wrote:
> > How come you all reply to other peoples emails but only 1
> person relied to
> > mine?
>
> I didn't reply because I don't know anything about mono.
> I wouldn't take it personally.



Re: [sqlite] Re: apostrophe troubles

2006-04-13 Thread Brian Johnson
Thanks .. it's amazing how hard it is to google for this info



Igor Tandetnik ([EMAIL PROTECTED]) wrote:
>
> Brian Johnson
> <[EMAIL PROTECTED]> wrote:
> > Here is example of what I'm trying to do in the bash script:
> >
> > sqlite3 db.dat "BEGIN;
> > UPDATE table1 SET name='O'Neil' WHERE person_id=2
> > COMMIT;"
> >
> > there are more UPDATE lines or I wouldn't bother with the BEGIN; and
> > COMMIT; .. but the real problem is that apostrophe.  I've tried every
> > type of excape that I can think of
>
> name='O''Neil'
>
> And you are missing a semicolon at the end of UPDATE statement, before
> the COMMIT.
>
> Igor Tandetnik
>
>



Re: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread Jay Sprenkle
On 4/13/06, Aaron Jones <[EMAIL PROTECTED]> wrote:
> How come you all reply to other peoples emails but only 1 person relied to
> mine?

I didn't reply because I don't know anything about mono.
I wouldn't take it personally.


Re: [sqlite] Structured or Object-Oriented?

2006-04-13 Thread Aaron Jones
How come you all reply to other peoples emails but only 1 person relied to
mine?

On 06/04/06, John Newby <[EMAIL PROTECTED]> wrote:
>
> I think Object Oriented databases came in with the SQL-99 standard and
> SQLite is the SQL-92 standard so it may be structured but I'm not sure at
> all
>
> On 06/04/06, Aaron Jones <[EMAIL PROTECTED]> wrote:
> >
> > Hi, I am doing a project for University where I am creating a
> > cross-platform, open-source GUI to SQLite, I am going to be using mono
> to
> > build it, do you think this will be ok or do you think I will encounter
> > any
> > problems along the way?  I've noticed there is a wrapper for mono, but
> > where
> > mono is unable to use windows.forms it uses GTK#, and I don't think
> there
> > is
> > a wrapper for GTK#, but I am not sure if this will be needed.
> >
> > Also, was SQLite created using a structured or object-oriented
> methodolgy
> > so
> > that I can design the interface in the same way.
> >
> > Any suggestions would be greatfully appreciated.
> >
> > Aaron
> >
> >
>
>


[sqlite] Using Like

2006-04-13 Thread Roger
hwo do i use LIKE in sqlite

eg in

Select Surname
from people
where surname like A* etc.



Re: [sqlite] questions about performance

2006-04-13 Thread Miha Vrhovnik

>This problem has been coming up with more and more frequency.
>I need to either figure out a solution or at least write up
>some official documentation on it.
I think that table partitioning as I purposed about a month ago would be
a solution if data is of nature, that it can be partitioned by any
column.

Regards,
Miha