Doubt to update.

QuestionsDoubt to update.
José Luciano asked 10 years ago

Google translator on:

I have a connection to DB2 database.
The system is trying to do an update also changing the primary key.

Couldn't execute query. [IBM][CLI Driver][DB2/NT64] SQL0438N O aplicativo apresentou erro ou aviso com texto de diagnostico: "PAF-Coluna PK nao pode ser alterada;". SQLSTATE=75000 – UPDATE dba.produto SET IDSECAO='6',IDGRUPO='1152',IDSUBGRUPO='56',DESCRCOMPRODUTO='ARROZ SEPE TP2 5KG.',IDPRODUTO='20006' WHERE IDPRODUTO IN ('20006')

The ProductID field is the primary key of the table. It should not be part of the command, only the WHERE condition.

What should I do to fix this?
Grateful for the attention.

1 Answers
Abu Ghufran answered 10 years ago

Hello,

This is resolved in full version. We skipped PK while insertion and updation.
I saw that you bought license, so just override the lib folder and it should work.

Docs:
First field in column definition array is by-default skipped from INSERT query (assuming to be primary key and auto increment).
If you wish to include it in INSERT sql (non auto increment) you can set:
$col["autoid"] = false;

Your Answer

6 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?