Board index » delphi » Insert Problem with Local SQL

Insert Problem with Local SQL

The error is that the insert values expects a value for
each field. I just tried that to see if something was really
messed up. There are only 6 fields in the table with the
first two being character and the last four being integer.

No, I did not try an explicit column list. I will try that
tomorrow (time and chores permitting) and get back to
this thread.

Thank you for your response.

Quote
<Steve Koterski (Borland)> wrote in message

news:38ad75c3.3447602@forums.inprise.com...
Quote
> On Fri, 18 Feb 2000 09:46:54 -0500, "John C. Bell III" <jcb...@us.net>
> wrote:

> >    Insert into Table values ("","Description",0,0,0,0)

> >where the first two fields are character and the last 4
> >fields are integers, I get a record with Description in
> >the second field and blanks/nulls in the last 4 fields. I
> >change the 0 to 40, I get the same thing! If I use

> >    Insert into Table values ("","Description")

> >I get an error (as expected). I am using D4 C/S with
> >5.01. What could I be doing wrong here?

> You get an error? What error? And why do you expect it? (It sounds like
> critical information about the situation you did not pass on in your
post.)
> What is the exception type: EDBEngineError or EDatabaseError?

> Do the values passed in the values list for that INSERT statement
> correspond to the first six (or all six) columns in the table? That is,
are
> there any columns between the first two CHAR columns and the four INTEGER
> columns?

> Passing a value of 40 to an INTEGER column should never result in a NULL
> column value. Something is definitely wrong there, but it is not clear
from
> just the information in your post what that something might be. Your
> pseudo-SQL statement looks to be syntactically correct, so you should not
> be incurring an exception due to incorrect syntax. Therefore it is likely
> due to the statement not properly synchronizing with the metadata.

> Does the statemnt work if you add a columns list and explicitly cite the
> columns into which the sic values are to be placed?

> (Follow-ups to the newsgroup only, please.)

> Local SQL (the SQL implementation the BDE uses for dBASE, Paradox, and
> FoxPro tables) is documented in the online help file LOCALSQL.HLP, found
in
> the main BDE directory. This help file is a language reference of the
local
> SQL implementation (subset) of SQL-92. The copy of this file that came
with
> BDE 4.x (and earlier versions) was seriously out of date and contained
> little useful information. It has since been rewritten. It has been
updated
> again concurrent with C++Builder 5. Updated copies will have the topic
> "VIEWs" in the index (and lack of this topic indicates a pre-update copy).
> I can e-mail you a copy of the updated file if you need and desire it.

> ==========================================================================
> Steve Koterski                      "Only dead fish swim with the stream."
> Technical Publications                                          -- Unknown
> Borland
> http://www.borland.com/techpubs/delphi

 

Re:Insert Problem with Local SQL


OK, I used an insert with columns and it put the 0's into
the table. What next? Have you tried this and does it
"work" for you"

Quote
<Steve Koterski (Borland)> wrote in message

news:38ad75c3.3447602@forums.inprise.com...
Quote
> On Fri, 18 Feb 2000 09:46:54 -0500, "John C. Bell III" <jcb...@us.net>
> wrote:

> >    Insert into Table values ("","Description",0,0,0,0)

> >where the first two fields are character and the last 4
> >fields are integers, I get a record with Description in
> >the second field and blanks/nulls in the last 4 fields. I
> >change the 0 to 40, I get the same thing! If I use

> >    Insert into Table values ("","Description")

> >I get an error (as expected). I am using D4 C/S with
> >5.01. What could I be doing wrong here?

> You get an error? What error? And why do you expect it? (It sounds like
> critical information about the situation you did not pass on in your
post.)
> What is the exception type: EDBEngineError or EDatabaseError?

> Do the values passed in the values list for that INSERT statement
> correspond to the first six (or all six) columns in the table? That is,
are
> there any columns between the first two CHAR columns and the four INTEGER
> columns?

> Passing a value of 40 to an INTEGER column should never result in a NULL
> column value. Something is definitely wrong there, but it is not clear
from
> just the information in your post what that something might be. Your
> pseudo-SQL statement looks to be syntactically correct, so you should not
> be incurring an exception due to incorrect syntax. Therefore it is likely
> due to the statement not properly synchronizing with the metadata.

> Does the statemnt work if you add a columns list and explicitly cite the
> columns into which the sic values are to be placed?

> (Follow-ups to the newsgroup only, please.)

> Local SQL (the SQL implementation the BDE uses for dBASE, Paradox, and
> FoxPro tables) is documented in the online help file LOCALSQL.HLP, found
in
> the main BDE directory. This help file is a language reference of the
local
> SQL implementation (subset) of SQL-92. The copy of this file that came
with
> BDE 4.x (and earlier versions) was seriously out of date and contained
> little useful information. It has since been rewritten. It has been
updated
> again concurrent with C++Builder 5. Updated copies will have the topic
> "VIEWs" in the index (and lack of this topic indicates a pre-update copy).
> I can e-mail you a copy of the updated file if you need and desire it.

> ==========================================================================
> Steve Koterski                      "Only dead fish swim with the stream."
> Technical Publications                                          -- Unknown
> Borland
> http://www.borland.com/techpubs/delphi

Re:Insert Problem with Local SQL


OK, I used an insert using all the column names
(explicitly) and it put the 0's into the table. What
next? Have you tried this and does it "work" for you"

Unless I am doing something wrong, this seems to be
a problem with Local SQL.

Quote
<Steve Koterski (Borland)> wrote in message

news:38ad75c3.3447602@forums.inprise.com...
Quote
> On Fri, 18 Feb 2000 09:46:54 -0500, "John C. Bell III" <jcb...@us.net>
> wrote:

> >    Insert into Table values ("","Description",0,0,0,0)

> >where the first two fields are character and the last 4
> >fields are integers, I get a record with Description in
> >the second field and blanks/nulls in the last 4 fields. I
> >change the 0 to 40, I get the same thing! If I use

> >    Insert into Table values ("","Description")

> >I get an error (as expected). I am using D4 C/S with
> >5.01. What could I be doing wrong here?

> You get an error? What error? And why do you expect it? (It sounds like
> critical information about the situation you did not pass on in your
post.)
> What is the exception type: EDBEngineError or EDatabaseError?

> Do the values passed in the values list for that INSERT statement
> correspond to the first six (or all six) columns in the table? That is,
are
> there any columns between the first two CHAR columns and the four INTEGER
> columns?

> Passing a value of 40 to an INTEGER column should never result in a NULL
> column value. Something is definitely wrong there, but it is not clear
from
> just the information in your post what that something might be. Your
> pseudo-SQL statement looks to be syntactically correct, so you should not
> be incurring an exception due to incorrect syntax. Therefore it is likely
> due to the statement not properly synchronizing with the metadata.

> Does the statemnt work if you add a columns list and explicitly cite the
> columns into which the sic values are to be placed?

Other Threads