Solved

INSERT ERROR IN VB6 USING SQL PERVASIVE

Posted on 2011-03-20
12
474 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
[X]
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
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

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

Suggested Solutions

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.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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…

759 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