Solved

Update Dynamic Datawindow

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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?
Read about achieving the basic levels of HRIS security in the workplace.
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.

760 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

16 Experts available now in Live!

Get 1:1 Help Now