Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

INSERT ERROR IN VB6 USING SQL PERVASIVE

Posted on 2011-03-20
12
Medium Priority
?
480 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 2000 total points
ID: 35174963
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
ID: 35175005
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
ID: 35175078
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:BIAPRO
ID: 35175079
sorry  the key does NOT exist , i did check that with bedit
0
 
LVL 143

Expert Comment

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

Author Comment

by:BIAPRO
ID: 35175118
This one
  [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface]Column <DbPrijs> not nullable.
0
 

Author Comment

by:BIAPRO
ID: 35175125
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
ID: 35175127
0
 

Author Comment

by:BIAPRO
ID: 35175130
will try will all on nullable
0
 

Author Comment

by:BIAPRO
ID: 35175200
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
ID: 35175590
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
ID: 35175745
ok thanks for explanation Bill
regards Jack
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

885 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