Solved

Update Dynamic Datawindow

Posted on 2009-05-18
4
644 Views
Last Modified: 2013-12-26
I created Dynamic Datawindow using this code

mysql="select id,name,email from users"
new_syntax=SQLCA.SyntaxFromSQL(mysql,'Style(type=grid)', error_syntaxfromSQL);
dw_1.Create(new_syntax, error_syntaxfromSQL).

when i update some name into dw_1 and press update
dw_1.update();

the error message will open :
SQLSTATE = 23000
[Sybase][ODBC Driver][Adaptive Server Anywhere]Column 'CODE' in table 'user' cannot be NULL

i want just update name and keep code as its (code not included into dw_1).

how i can do that.
0
Comment
Question by:Deyhim
  • 2
4 Comments
 
LVL 1

Author Comment

by:Deyhim
ID: 24411507
this is full error msg:
SQLSTATE = 23000
[Sybase][ODBC Driver][Adaptive Server Anywhere]Column 'CODE' in table 'users' cannot be NULL

No changes made to database.

INSERT INTO "users" ( "id", "name", "email" ) VALUES ( ?, ?, ? )


note: CODE is not null in user table.

0
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 500 total points
ID: 24414048
The error is for new records, not for the update. So when you insert new record and there is any column Not Null, you must include that column in your datawindow with value OR give some default value to that column in table design.

check for any insertrow() in your code for that datawindow.

Regards,
Sandeep
0
 
LVL 18

Expert Comment

by:diasroshan
ID: 24419051
Hi,

Can u paste ur entire code here, could help us to point out any bug in it.

Like sandeep mentioned, check for insertrow()

Cheers,
Rosh
0
 
LVL 1

Author Comment

by:Deyhim
ID: 24420999
Thanks i found the problem,
i used insertrow().
i fixed it now
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Getting hacked is no longer a matter or "if you get hacked" — the 2016 cyber threat landscape is now titled "when you get hacked." When it happens — will you be proactive, or reactive?
Cybersecurity has become the buzzword of recent years and years to come. The inventions of cloud infrastructure and the Internet of Things has made us question our online safety. Let us explore how cloud- enabled cybersecurity can help us with our b…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

810 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