Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!in.100proofnews.com!in.100proofnews.com!cyclone.bc.net!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
From: william_hulse@hotmail.com (will)
Newsgroups: comp.databases.oracle.server
Subject: Re: Accessing components of an object within a varray...
Date: 9 Sep 2003 07:08:58 -0700
Organization: http://groups.google.com/
Lines: 84
Message-ID: <283ad5ec.0309090608.301c0ca8@posting.google.com>
References: <283ad5ec.0309030612.40ec11fd@posting.google.com> <m3wucpnbiz.fsf@ate.maierh>
NNTP-Posting-Host: 193.111.24.42
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1063116540 16536 127.0.0.1 (9 Sep 2003 14:09:00 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 9 Sep 2003 14:09:00 GMT
Xref: newssvr20.news.prodigy.com comp.databases.oracle.server:242690

Harald Maier <maierh@myself.com> wrote in message news:<m3wucpnbiz.fsf@ate.maierh>...
> william_hulse@hotmail.com (will) writes:
> 
> > Hope you can help with the following...
> >
> > I have the following type declaration
> >
> > CREATE OR REPLACE TYPE mytype IS OBJECT (
> > STATUS             VARCHAR2(1000),
> > SET_OF_BOOKS_ID             NUMBER,
> > ACCOUNTING_DATE             DATE,
> > CURRENCY_CODE             VARCHAR2(1000),
> > DATE_CREATED             DATE,
> > CREATED_BY             NUMBER,
> >
> > );
> >
> > CREATE OR REPLACE TYPE mytype_Arr IS VARRAY(1000) OF mytype;
> >
> > What i need to know is how to assign values to specific components of
> > the object within the varray ?
> >
> > For example set the status component of the 5th varray element to
> > 'hello'
> >
> > I have tried the following 
> >
> >       mytype_Arr(i).status := 'hello';
> 
> I don't quite understand but it looks that you don't have a variable
> instance of your type array 'mytype_Arr'. Try the following:
> 
> ,----
> | declare
> |   abc mytype_Arr;
> | begin
> |   ... -- fill here the array
> |   abc(i).status := 'hello';
> | end;
> | /
> `----
> 
> Harald


Harald thanks fro you response 

sorry probably wasnt that clear but here is more of the code i used,
including a variable instance

admittedly the code is a bit "rough" at the moment but i'm trying to
get that first bit of syntax correct...



PROCEDURE sub_FTE_FEED_KS_V1(
AP_GL_ITEM IN OAI.APPS11I_AP_GL_ITEMS_KS_V1_Arr)
AS
dummy NUMBER;
ac_date date := sysdate;


BEGIN
-- fill code here
dummy:= 0;
IF AP_GL_ITEM.EXISTS(1) THEN
 
--populate accounting date column with sysdate   
  FOR i IN 1..AP_GL_ITEM.COUNT 
      LOOP
        AP_GL_ITEM(i).ACCOUNTING_DATE := ac_date;
      END LOOP;  
  insert into AP_GL_ITEM
 END IF;
-- Insert into gl_interface table
IGKGLS00.APPLY_MSG( AP_GL_ITEM);
END sub_FTE_FEED_KS_V1;
/

The code is basically taking in the array, i'll loop round it and set
the accounting date to sysdate within the object...


any more clues.. ?
