• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 663
  • Last Modified:

Update Dynamic Datawindow

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
Deyhim
Asked:
Deyhim
  • 2
1 Solution
 
DeyhimAuthor Commented:
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
 
sandeep_patelCommented:
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
 
diasroshanCommented:
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
 
DeyhimAuthor Commented:
Thanks i found the problem,
i used insertrow().
i fixed it now
0

Featured Post

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now