Re: [sqlite] SQLite C# Wrapper

2003-11-10 Thread Noel Frankinet
Richard Heyes wrote:

> > I don't know what unsafe is, but shouldnt it be static (since no 'this'
> pointer
> > can be expected) ?
>
> The unsafe keyword allows the use of pointers, and there's no need for
> static as the method is passed as an instance method.
>
> --
> Richard Heyes

Does it have c linkage as expected by sqlite ?


--
GISTEK software
Gis consultant.
[EMAIL PROTECTED]
www.gistek.net



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] SQLite C# Wrapper

2003-11-10 Thread Noel Frankinet
Richard Heyes wrote:

> > I've done a c++ wrapper around sqlite and have no problem with count(*),
> do you
> > check NULL values ?
>
> I check for null pointers in the argv values. Thing is the callback appears
> to run just as it should, the column name is returned as "count(*)", number
> of columns is 1, and the correct value is returned.
>
> My callback function is this:
>
> private unsafe int ExecuteCallback(IntPtr pArg,
>  int argc,
>  sbyte **argv,
>  sbyte **columnNames)
> {
> string column;
> DataRow newRow = this.dt.NewRow();
> string[] data = new string[argc];
>
> //First time in, add the columns to the DataTable object
> if (dt.Columns.Count == 0) {
> for (int i=0; i column = new String(columnNames[i]);
> dt.Columns.Add(column);
> }
> }
>
> for (int i=0; i // Make an ArrayList of the row data
> if (argv[i] != ((sbyte *)0)) {
> data[i] = new String(argv[i]);
> } else {
> data[i] = null;
> }
> }
>
> // Add the array to the DataRow
> newRow.ItemArray = data;
> dt.Rows.Add(newRow);
> return 0;
> }
>
> Cheers.
> --
> Richard Heyes

I don't know what unsafe is, but shouldnt it be static (since no 'this' pointer
can be expected) ?


--
GISTEK software
Gis consultant.
[EMAIL PROTECTED]
www.gistek.net



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] SQLite C# Wrapper

2003-11-10 Thread Noel Frankinet
Richard Heyes wrote:

> Hi,
>
> I'm in the process of writing a C# wrapper for Sqlite, and all is going
> reasonably well. However the following query is giving me problems:
>
> SELECT COUNT(*) FROM myTable
>
> Whenever it's run, a null reference exception is thrown. When stepping
> through the code I can see the callback method running and the correct data
> is being generated, however after the callback returns (its return value is
> zero) the exception is thrown.
>
> Strangely, this is the only query I've found that generates an exception.
>
> I looked at the Mono wrapper and this too behaves in the same manner.
>
> If anyone has any tips, I'd be grateful.
>
> --
> Richard Heyes
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Hello,
I've done a c++ wrapper around sqlite and have no problem with count(*), do you
check NULL values ?

Noël


--
GISTEK software
Gis consultant.
[EMAIL PROTECTED]
www.gistek.net



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] SQLite C# Wrapper

2003-11-10 Thread Richard Heyes
Hi,

I'm in the process of writing a C# wrapper for Sqlite, and all is going
reasonably well. However the following query is giving me problems:

SELECT COUNT(*) FROM myTable

Whenever it's run, a null reference exception is thrown. When stepping
through the code I can see the callback method running and the correct data
is being generated, however after the callback returns (its return value is
zero) the exception is thrown.

Strangely, this is the only query I've found that generates an exception.

I looked at the Mono wrapper and this too behaves in the same manner.

If anyone has any tips, I'd be grateful.

-- 
Richard Heyes


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] COPY

2003-11-10 Thread [EMAIL PROTECTED]
-- Initial Header ---

>From  : "Fouejieu louis" [EMAIL PROTECTED]
To  : [EMAIL PROTECTED]
Cc  :
Date  : Mon, 10 Nov 2003 14:49:47 +
Subject : Re: [sqlite] COPY

> >Hi all,
> >
> >I would like to know if it is possible to dump a sqlite database
> >with format COPY.
> >I tried sqlite mydb .dump
> >but it uses the INSERT command instead, is there a way to change this
> >behavior?
>
>
> Hi Jo,
>
> I don't know if it will be help you, but i have already make a successfull
> COPY like this:
>
> // 1st Copy data from a hardisk 'Source_data.csv'(for example) to a
> temporary table 'Temp_tb'
> COPY Temp_tb FROM 'C:/path/to/Source_data.csv' USING DELIMITERS ';' ;
>
> // 2nd Insert the data from 'Temp_tb' in target table 'Target_tb'
> INSERT INTO Target_tb (Filed1, Field2, Field3) SELECT DISTINCT Filed_1,
> Field_2, Field_3 FROM Temp_tb;
>
>
> PS: Field1 from Target_tb muss have the same Tipe with Field_1 from Temp_tb
>
> _
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>

Thank you to reply to my question Cappucino, but my problem is of a different kind.
I need to export data from sqlite and import it in PostgreSQL, I would like to
use the COPY format because
it is faster than INSERT command, but seems to me  that sqlite is not able to
export data in such format.

Jo







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] LoadLibrary, ERROR_NOACCESS

2003-11-10 Thread Sergey Startsev
Hello!

  I am trying to load two copies of sqlite.dll at one time.
  One - version 2.8.4, two - version 2.8.6

  handle1:= loadlibrary('c:\2.8.4\sqlite.dll');
  // this loaded OK

  handle2:= loadlibrary('c:\custom\sqlite.dll');
  // this return error
  ERROR_NOACCESS (Invalid access to memory location)
  
  Why I can't load two copies of sqlite.dll?
  
  P.S.
  I use Delphi 7, windows 2000

-- 
Best regards

 Sergey Startsev, KRASLabs
 http://www.kraslabs.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] COPY

2003-11-10 Thread josesoaresdasilva
Hi all,

I would like to know if it is possible to dump a sqlite database
with format COPY.
I tried sqlite mydb .dump
but it uses the INSERT command instead, is there a way to change this 
behavior?

Thank you,

Jo



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]