Read the documentation:
"The first parameter is a prepared SQL statement. If this statement is a
SELECT statement, the Nth column of the returned result set of the SELECT is
a table column then the declared type of the table column is returned. If
the Nth column of the result set is not at table column, then a NULL pointer
is returned."

----- Original Message ----- 
From: "EzTools Support" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 20, 2004 11:43 PM
Subject: [sqlite] Re: *** Please help ***


> Can someone please please answer the question, does
> sqlite3_column_decltype NOT return the column type for Views?  I don't
> see how this wouldn't considered as a major bug.
>
>
> EzTools Support wrote:
>
> >
> > I found out why Views were returning all NULLs.  I have made a
> > modified version of sqlite3_exec.  Mine checks for NULL returned from
> > sqlite3_column_decltype, for which Sqlite3 now returns NULL.  Am I
> > right that this is so?  My COM wrapper depends on having the column
> > data types returned for Views. Can you please make it work again, as
> > this is vital.
> >
> > thanks
> > -brett
> >
> >
> > EzTools Support wrote:
> >
> >> Hello.  Can someone please help with this issue.  It may turn out to
> >> be a bug in Sqlite 3.
> >>
> >> I have the following fairly basic SQL View that works fine with
> >> Sqlite 2.x:
> >>
> >> CREATE VIEW Invoices AS
> >> SELECT Customers.CustomerID, Customers.CompanyName,Orders.OrderID,
> >> OrderDetails.ProductID, OrderDetails.Quantity FROM Customers INNER
> >> JOIN Orders ON Customers.CustomerID = Orders.CustomerID INNER JOIN
> >> OrderDetails ON Orders.OrderID = OrderDetails.OrderID
> >>
> >> When I create and run this view in 3.x, I get all of the rows back,
> >> but all values are NULL!
> >>
> >> If I run the SELECT statement apart from the view, it I get the data
> >> back fine.  But if I select * FROM Invoices, I get all of the rows
> >> back, but all values are NULL.
> >>
> >> Another interesting thing is that when selecting from the View, the
> >> column names are without the table prefix.  That is, CustomerID,
> >> CompanyName, OrderID, et.  But if I select from the tables directly,
> >> the column names have the table prefix, Customers.CustomerID,
> >> Customers.CompanyName, Orders.OrderID
> >>
> >> I have put the database up on my website here (Zip file):
> >>
> >>    www.eztools-software.com/downloads/northwind.zip
> >>
> >> This is happening in all version 3.0.5-3.0.7.  Can someone please
> >> download this DB and investigate.
> >>
> >> If you want to test the same view and data with a v2.x database, you
> >> can get the SqlitePlus28 download from here:
> >>
> >>    www.eztools-software.com/downloads/sqliteplus.exe
> >>
> >> TIA
> >> -Brett Goodman
> >>
> >>
> >
>

Reply via email to