dynamic insert procedure [message #154558] |
Mon, 09 January 2006 07:06 |
nicnitti
Messages: 8 Registered: December 2005
|
Junior Member |
|
|
Hello,
i need to insert a record in a table dynamically;
Exists a procedure define by
insert name_table (record rowtype%nametable)
that insert a record without write the field of the table.
The following procedure is good ,but it don't work in Oracle Forms Builder .
Error 518:This INSERT statments requires VALUES clause containing a parenthesised list of values.
DECLARE
t1_rec t1%ROWTYPE;
BEGIN
t1_rec.c1 := 1;
t1_rec.c2 := SYSDATE;
INSERT INTO t1 VALUES t1_rec;
END;
Thank you for all.
Best regards. Nicola
|
|
|
|
|
Re: dynamic insert procedure [message #154674 is a reply to message #154672] |
Tue, 10 January 2006 02:27 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Hello, Nicola!
I was just kidding asking you whether you speak English or not It just seemed that you didn't realize what the message was saying.
I created a sample table
CREATE TABLE t1 (c1 number, c2 date);
PL/SQL block you wrote works fine when run in SQL*Plus.
Then I wrote a default form based on this table. Also, I created a push button item and attached the code you provided (with minor change - I added parenthesis where appropriate). It also worked properly.
It was done on Oracle 10g, using Forms Developer 10g. There were no errors at all, and the form worked perfectly well.
Regarding the message you received (wrong type), did you check table description? Is there, perhaps, c1 column of a CHARACTER datatype, so forms refuses to perform implicit conversion?
|
|
|
Re: dynamic insert procedure [message #154679 is a reply to message #154674] |
Tue, 10 January 2006 02:59 |
nicnitti
Messages: 8 Registered: December 2005
|
Junior Member |
|
|
Hello, Littlefoot!
I'm sorry.
The RDBMS is Oracle Database 9i and I use Forms Developer 6i Patch 4. In this situation the procedure don't work well.
Thank you for all,
Nicola
|
|
|
|
|