Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

INSERT ERROR IN VB6 USING SQL PERVASIVE

Posted on 2011-03-20
12
472 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
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

856 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