Solved

INSERT ERROR IN VB6 USING SQL PERVASIVE

Posted on 2011-03-20
12
468 Views
Last Modified: 2012-06-21
I insert a new record , where only 2 fields are important during insert the other I leave blank
My call is
insert  into artprice VALUES('JACK        07.2000       '   , ' ' ,  ' ' ,  ' ' ,  ' ' ,  ' ' ,  ' ' ,  ' ' , '110320', ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ')

also tried
nsert  into artprice VALUES('JACK        07.2000       '   , 0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 , '110320', 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0)

for my table lookat the attached files


fields.jpg
indexes.jpg
statistics.jpg
0
Comment
Question by:BIAPRO
12 Comments
 
LVL 11

Accepted Solution

by:
JoeNuvo earned 500 total points
Comment Utility
try to see if this one can success insert or not?

insert  into artprice VALUES('JACK        07.2000       '   , 0 , 0 , 0 ,  ' ' ,  ' ' ,  ' ' ,  ' ' , '110320', 0 , ' ' , ' ' , ' ' , ' ' , 0 , 0 , ' ' , ' ' , ' ' , 0 , ' ' , ' ')

Open in new window


Anyway, maybe reason of error is because 'JACK        07.2000       ' already exists in the table
0
 
LVL 3

Expert Comment

by:ssisworo
Comment Utility
if it is only 2 fields are preferred, other fields may be created allow null. so insertnya can be simplified like this:
insert into artprice (DebArtNum, DebLastUpdate) VALUES ('JACK 07.2000', '110320').

if other fields must be filled, try to insert the syntax in the order of the sequence fields in the table and the format with the rules:
to insert char data type to string (char ==> ' ')
to float data type insert with a number (char ==> 0)
so that the syntax insertnya as written by JoeNuvo
0
 

Author Comment

by:BIAPRO
Comment Utility
the key does exist , i did check that with bedit

insert into artprice (DebArtNum, DebLastUpdate) VALUES ('JACK 07.2000', '110320')
should work according Pervasive sql2000i manual but gives error   -2147217900
0
 

Author Comment

by:BIAPRO
Comment Utility
sorry  the key does NOT exist , i did check that with bedit
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
don't you get a error description? the error number might not be "helpful", actually
0
 

Author Comment

by:BIAPRO
Comment Utility
This one
  [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface]Column <DbPrijs> not nullable.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:BIAPRO
Comment Utility
after i did set all Float fields at nullable it gives
  [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface]Column <DbTabel> not nullable.
0
 

Author Comment

by:BIAPRO
Comment Utility
0
 

Author Comment

by:BIAPRO
Comment Utility
will try will all on nullable
0
 

Author Comment

by:BIAPRO
Comment Utility
All set to nul give grazy data in the flot fields,
did set back the way it was, then this one
insert  into artprice VALUES('JACK        07.2000       '    , 0 , 0 , 0 ,  ' ' ,  ' ' ,  ' ' ,  ' ' ,  '110320', 0 , 'JACK         ' , ' ' , ' ' , ' ' , 0 , 0 , ' ' , ' ' , ' ' , 0 , ' ' , ' ')

works ok
0
 
LVL 28

Expert Comment

by:Bill Bach
Comment Utility
To better understand this solution, you need to understand the definition of "Nullable".  Making a field nullable allows that field to have an "undefined" value.  This allows you to use the much simpler SQL syntax of specifying only the known columns:
    insert into artprice (DebArtNum, DebLastUpdate) VALUES ('JACK 07.2000', '110320')

However, because some of the tables are defined as NOT nullable, you *must* define a value for every single one of them.  If you want this to wortk in a more simplistic way, then you can instead define DEFAULT values for each of the non-nullable columns.  Then, if you do not specify the fields, they will receive their proper default values (instead of NULL).

0
 

Author Comment

by:BIAPRO
Comment Utility
ok thanks for explanation Bill
regards Jack
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now