Solved

Update Dynamic Datawindow

Posted on 2009-05-18
4
652 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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 NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

756 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