Solved

Update Dynamic Datawindow

Posted on 2009-05-18
4
655 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
[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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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?
A brand new malware strain was recently discovered by security researchers at Palo Alto Networks dubbed “AceDeceiver.” This new strain of iOS malware can successfully infect non-jailbroken devices and jailbroken devices alike.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

738 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