Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

data provider insert into a table  RSS feed

 
Ionut Putinei
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i am trying to insert some values in a table:
table definition:



CREATE TABLE "JOHN"."ARTICOLE" ( "ART_NO" NUMBER(6), "DESCR" VARCHAR2(30) NOT NULL , "DEPT_NO" NUMBER(1), "SUPPL_ID" NUMBER(6), "LAST_REC_DAY" DATE, "LAST_SALE_DAY" DATE, "SELL_PR" NUMBER(10, 2), CONSTRAINT "ARTNOCHECK" CHECK (ART_NO>0) VALIDATE , CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPT_NO") REFERENCES "JOHN"."DEPARTMENT" ("DEPT_NO") VALIDATE , PRIMARY KEY ("ART_NO") VALIDATE ) TABLESPACE "USERS" PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K BUFFER_POOL DEFAULT) LOGGING

when i press a button it supose to do:

public String button1_action() {
if (articoleDataProvider.canAppendRow()) {
try {
RowKey rowKey = articoleDataProvider.appendRow();
articoleDataProvider.setCursorRow(rowKey);
articoleDataProvider.setValue("ARTICOLE.ART_NO",
rowKey, codArt1.getText());
articoleDataProvider.setValue("ARTICOLE.DESCR",
rowKey, denumireArt1.getText());
articoleDataProvider.setValue("ARTICOLE.DEPT_NO",
rowKey, numarDept1.getText());
articoleDataProvider.setValue("ARTICOLE.SELL_PR",
rowKey, sellPr1.getText());
articoleDataProvider.commitChanges();

} catch (Exception e) {
error("NU am putut adauga articolul: " + e);
articoleDataProvider.refresh();
return null;
}
} else {
error("Cannot append trip types");
return null;
}
//clear fields
codArt1.setText(null);
denumireArt1.setText(null);
numarDept1.setText(null);
sellPr1.setText(null);
return null;
}

thw first error i get is that i cant insert into field art_no: java.lang.IllegalArgumentException: ARTICOLE.ART_NO

thank you
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!