talahi
asked on
Oracle Objects and using dot notation
I'm trying to understand how to use objects in Oracle and curious why the following example doesn't work. Or what is missing that would make it work using Objects and dot notation.
create table comments_table
(dat date,
comments varchar2(200));
declare
type ser_table is table of varchar2(10) index by binary_integer;
ser_list ser_table;
temp_count integer := 0;
begin
ser_list(1) := 'TEST 1';
ser_list(2) := 'TEST 2';
ser_list(3) := 'TEST 3';
-- Doesn't work
insert into comments_table(dat,comment s) values(sysdate,ser_list.co unt||' records inserted.');
-- Does work
temp_count := ser_list.count;
insert into comments_table(dat,comment s) values(sysdate,temp_count| |' records inserted.');
end;
create table comments_table
(dat date,
comments varchar2(200));
declare
type ser_table is table of varchar2(10) index by binary_integer;
ser_list ser_table;
temp_count integer := 0;
begin
ser_list(1) := 'TEST 1';
ser_list(2) := 'TEST 2';
ser_list(3) := 'TEST 3';
-- Doesn't work
insert into comments_table(dat,comment
-- Does work
temp_count := ser_list.count;
insert into comments_table(dat,comment
end;
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
you cannot use an object as a part of a string, you need to convert it to a variable first before you can use it
ser_list.count is a property of an object
ASKER
Ok thanks.