Solved

INSERT ERROR IN VB6 USING SQL PERVASIVE

Posted on 2011-03-20
12
471 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
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.

 

Author Comment

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

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

Gigs: Get Your Project Delivered by an Expert

Select from 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

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
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…

813 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

10 Experts available now in Live!

Get 1:1 Help Now