Yii Framework Forum: error in inserting record oracle, primary key as sequence - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

error in inserting record oracle, primary key as sequence Rate Topic: -----

#1 User is offline   che 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 12-October 11

Posted 12 October 2011 - 12:23 AM

i'm inserting a record but i received and error.

CDbCommand failed to prepare the SQL statement: SQLSTATE[HY000]: General error: 1741 OCIStmtPrepare: ORA-01741: illegal zero-length identifier
(ext\pdo_oci\oci_driver.c:279)


the primary key is based on sequence..



CREATE TABLE "ADMIN"."BK_R_BOOK_103"
( "BOOK_UID" NUMBER(18,0) primary key,
"DESCRIPTION" VARCHAR2(100),
"PURPOSE" VARCHAR2(200)
);



CREATE OR REPLACE TRIGGER "ADMIN"."BK_R_BOOK_103_TRIG"
before insert on "ADMIN"."BK_R_BOOK_103"
for each row
begin
if inserting then
if :NEW."BOOK_UID" is null then
select BK_R_BOOK_103_SEQ.nextval into :NEW."BOOK_UID" from dual;
end if;
end if;
end;


originally, i dont intend to use sequence but after creating the crud for my table, there is no textbox for my primary key.

hope you can help me with this.

thanks.

god bless
0

#2 User is offline   Jay-ar 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 11-August 11

Posted 18 November 2011 - 03:11 AM

we have thesame problem... anyone can help us?
0

#3 User is offline   Jay-ar 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 11-August 11

Posted 18 November 2011 - 03:18 AM

did u already solve the problem my friend?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users