I am very new to the database and I have the following problem.
I have is on Oracle DB KM_COUNTRY_AREA table called with the following structure:
column name DATA_TYPE NULLABLE DATA_DEFAULT COLUMN_ID ------- ----------- --------------------------------------- ----------- ------------ IDCOUNTRYAREA NUMBER (190) No (empty) 1NoFolderVARCHAR2 (255 CRA) Yes (empty) 2 COUNTRY_ID COUNTRY NUMBER (19.0) Yes (empty) 3
then the IDCOUNTRYAREA field I think is a self-generated field (because the table was created using hibernate And this field is in the @ id and The Divisional Series @ generatedValue ).
So now I have to put some records directly in DB (I need to do some tests) but I have a problem writing the query, inserting, I am following this tutorial:
< P> And I have to make this SQL statement: inserting in KM_COUNTRY_AREA (IDCOUNTRYAREA, NOMEFOLDER, COUNTRY_IDCOUNTRY) value (empty, "Brazil", 715);
I have placed the column value for null because it must be generated automatically (but I think it is wrong).
It does not work and I get the following error message:
Errore con inizio Alla Riga 1 nail Comando: INSERT INTO KM_COUNTRY_AREA (IDCOUNTRYAREA, NOMEFOLDER, COUNTRY_IDCOUNTRY) values (zero, "Brazil", 715) Errore alla Riga del Comando: 2 Colonna: 14 report errori: Errore SQL: ORA-00984: Colonna 00984. questo case Consentita non-00000 - "are not allowed here" column * reason: * action :
How can I resolve this problem and insert my line correctly in my KM_COUNTRY_AREA table Can i do
Tnx
EDIT-1:
I tryied to modify:
inserting in KM_COUNTRY_AREA (IDCOUNTRYAREA, NOMEFOLDER, COUNTRY_IDCOUNTRY) value (zero, 'brazil', 715);
But I get the following error message:
Errore con inizio Alla Riga 1 nail Comando: INSERT INTO KM_COUNTRY_AREA (IDCOUNTRYAREA, NOMEFOLDER, COUNTRY_IDCOUNTRY) values (null , 'Brazil', 715) reported error: Errore SQL: ORA-01400: .. ( "PRC_KM_OWNER" impossibile e-mail address zero "KM_COUNTRY_AREA" "IDCOUNTRYAREA") 01400. 00000 in - "(% s) can not insert null" * Reason: * Action:
It seems that I can not be null to the primary key, but it is strange because I have decided to be in hibernation as the area:
@ id @ generated Private private id idiots;
So I think its value should be automatically generated, what's wrong?
No comments:
Post a Comment