Collection.extend doubt
hi all...
the way we use collection_name.extend
in the same way can we use tablename%rowtype.extend ???
please help....
in that case how can i do that??
You cannot extend tablename%rowtype, because this is a type, not a collection.
However you can declare a collection of that type, here is a simple example:
CREATE TABLE test132(
x VARCHAR2(10),
y NUMBER,
z char
DECLARE
TYPE tab_type IS TABLE OF test132%ROWTYPE;
tab tab_type;
BEGIN
tab := tab_type();
tab.EXTEND( 5 );
FOR i IN 1 .. 5 LOOP
tab( i ).x := 'x ' || i;
tab( i ).y := 20 + i;
tab( i ).z := i;
END LOOP;
FOR i IN tab.FIRST .. tab.LAST LOOP
DBMS_output.put( tab( i ).x );
DBMS_output.put( ' ' );
DBMS_output.put( tab( i ).y );
DBMS_output.put( ' ' );
DBMS_output.put_line( tab( i ).z );
INSERT into test132 VALUES tab( i );
END LOOP;
END;
x 1 21 1
x 2 22 2
x 3 23 3
x 4 24 4
x 5 25 5
SELECT * FROM test132;
X Y Z
x 1 21 1
x 2 22 2
x 3 23 3
x 4 24 4
x 5 25 5
Similar Messages
-
CS4 Master Collection Extended - OS Windows 8
Hi,
I wounder if the cs4 Master Colllection Extended runs on OS Windows 8 ???
Kindly let me know asap.
Many thanksHi Michael!
I am running Windows 8 64-Bit, so no need to install it on my Laptop.
Thanks for your help
Kind regards
Cecilia
<Removed by Moderator> -
Variable.extend in pl/sql
if l_max_date = to_date('01-01-1900', 'dd-mm-yyyy') then
p_tax_id.extend;
p_tax_desc.extend;
p_effective_date.extend;
p_tax_rate.extend;
p_tax_id(1) := 0;
p_tax_desc(1) := 'ENT';
p_effective_date(1) := null;
p_tax_rate(1) := 0;
This is one part of pl/sql code. I want to know what is .extend is and what is hold/pass data.
Plz help.......Welcome to the forum!
Whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
>
This is one part of pl/sql code. I want to know what is .extend is and what is hold/pass data.
>
Well the subject line says that you know it is 'pl/sql' and the question is about 'extend'
so why didn't you seach for 'extend' in the pl/sql language doc and answer your own question?
See 'Increasing the Size of a Collection (EXTEND Method)' in the doc
http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/collections.htm#sthref592
As for 'hold/pass' you tell us - what is that in reference to? -
Collection evaluator error in SCCM 2012 SP1
I m getting below errors continuously in colleval.log,
CCEPSource::GetCollectionInfo:- Collection Not Found with CollectionID=2924
CEP-ErrorCode=-2016280319
CEP-Failed to process Collection Extended Properties changes, Status = COLLECTION NOT FOUND FOREIGN KEY CONSTRAINTS, changes will be retried on next processing cycle.
But, there is no such collection id '2924' in SCCM database. Due to these continuous errors, SMS_Collection_Evaluator component is in Critical.Colleval.box had some CEP files (240+ files) and I deleted all of them.
Now, Colleval.box is empty and Colleval.box\Retry folder is also empty. -
I am using the data cache and don't seem to have any way of querying it
at a point in time to see its effectiveness. In the DataCache
interface, I don't see methods that might let me know:
* how many hard references are currently in memory
* about how much memory is being used by the cache
* some measure of the "hit ratio",
* some measure of how much is being discarded
This instrumentation would let me tune the cache to the environment. I
don't see any sort of tuning that is possible under the current
implementation, so your answer "more is better", appears to be the best
that I can do. I might like to change
com.solarmetric.kodo.CacheReferenceSize but by what motivation?
Thanks,
DanPatrick,
Looking at the box, tonight, I see that the cached objects have
increased to around 2835. I find this very odd since the max is set to
2500. I'm getting very confused by this behaviour since it doesn't
correspond to expectations.
As a note about garbage collection, I did force at gc() on the code, and
the cached objects went from 2835 to 2507. Maybe your theory isn't
quite right, eh? <g>
Maybe the way it works is that it will cache and cache objects until
some sort of garbage collection is requested. Then, it throws away
objects until some criteria is reached. Can you check with the source,
please?
(I don't have any objects pinned.)
Dan
Patrick Linskey wrote:
Dan,
There isn't anything that I can tell you based on the source that isn't
just a reiteration of something in the JavaDoc for the relevant classes.
I'd suggest generating some output that shows you whenever something is
added to / removed from the DataCache, or whenever a mutation operation
is performed on the DataCache's CacheMap.
Regarding garbage collection, I doubt that that's the issue, since the
CacheMap maintains hard references to all objects unless the cache's size
is greater than the cache size + the pinned objects count.
-Patrick
On Mon, 13 Jan 2003 19:59:25 -0500, Dan Finkelstein wrote:
Thanks, Patrick. Since you have access to the source code, would you
mind perusing the pertient data caching routines and finding out under
what cirumstances, other than a full cache, objects will be evicted? On
my system, the cache size seems to go back and forth between around 1600
and 2000 again and again in a slow sort of cycle. My cache is set for
2500 and I would really like to know what would cause it to go down. For
example, does garbage collection play a role?
Dan
Patrick Linskey wrote:
Dan,
Based on the information below, it's hard to say for sure why the cache
would not reach its full size.
For your second point, we don't do any work to calculate the size of
the objects put into our cache. You should be able to determine this on
your own by looking at the objects that you're putting into the cache.
However, bear in mind that performing such a calculation will have a
negative impact on the cache performance.
It may be more beneficial to do some back-of-the-envelope calculations
by estimating the average size of the variable-length fields in the
cached objects.
-Patrick
On Mon, 13 Jan 2003 17:13:45 -0500, Dan Finkelstein wrote:
Marc,
I implemented an extension to LocalCache as you described. Right now,
I've only used it to display the current number of objects in the
cache.
I assumed the method in CacheMap to use is size(), although it
appeared undocumentated. Anyway, what I've noticed is that the number
of items in the cache can suddenly diminish (say from around 1950 to
1600). My cache size is set to 2500. Could you explain under what
circumstances objects are removed from the cache prior to it reaching
its full capacity?
Second, since the cache is competing for memory with the JVM, I'd like
to have a gauge on how much memory is consumed by the objects in the
cache. How do I retrieve this information? (Patrick has referred me
to you on this one!)
Dan
Marc Prud'hommeaux wrote:
Dan-
Those are good ideas for improvements: I've made an enhancement
request for this at:
http://bugzilla.solarmetric.com/show_bug.cgi?id=527
In the meantime, it wouldn't be too difficult to subclass the cache
implementation to use a decorating CacheMap that tracks statistics, a
la:
public class TrackingCache
extends LocalCache
protected CacheMap newCacheMap ()
final CacheMap orig = super.newCacheMap (); return new
CacheMap ()
// pass-though methods to "orig" that track stats
In article <[email protected]>, Dan Finkelstein
wrote:
Let me give you an idea.
clearStatistics()
-- clears statistics from cache
numberOfAccesses()
-- total number of requests for an object
numberFromCache()
-- total number of times a request was satisfied from the cache
From this, I can calculate the hit percentage, or the effectiveness
of the cache over a period of time:
double hitPercentage = 0;
if(_accesses > 0)
hitPercentage = 100 * (double) accessesFromCache / accesses;
Does this make sense?
Dan
Patrick Linskey wrote:
Dan,
I'm not quite sure what you're looking for aside from the method in
LocalCache to retrieve its CacheMap. Given this information, you
have access to quite a bit of underlying cache data.
-Patrick
Dan Finkelstein wrote:
Patrick,
May I suggest you add an enhancement request for exposing the
underlying properties of the data cache? This appears to be a
feature that would be useful to a great many.
I don't really care to spend a day or two exposing this data -- it
really seems to be in Kodo's domain, but if it were available, I
could easily display it (or log it) and see how that component is
functioning.
Dan
Patrick Linskey wrote:
In 2.3.x, you can extend LocalCache to get access to its
underlying cache implementation (a CacheMap). In 2.4, this
underlying implementantion is available via a get method.
To collect instrumentation details, you can extend the appropriate
cache and intercept the various get etc. calls.
-Patrick
Dan Finkelstein wrote:
I am using the data cache and don't seem to have any way of
querying it
at a point in time to see its effectiveness. In the DataCache
interface, I don't see methods that might let me know:
* how many hard references are currently in memory * about how
much memory is being used by the cache * some measure of the
"hit ratio",
* some measure of how much is being discarded
This instrumentation would let me tune the cache to theenvironment. I
don't see any sort of tuning that is possible under the current
implementation, so your answer "more is better", appears to be
thebest
that I can do. I might like to change
com.solarmetric.kodo.CacheReferenceSize but by what motivation?
Thanks,
Dan -
Calendar Server 7u2 fails with iOS 5
Hello everybody.
Connecting to Oracle Calendar Server for CalDAV with an iPhone 4, updated to iOS 5, fails when loading the calendar. The iPhone can neither see the calendar, nor load tasks. The connection works fine with Thunderbird 7.0/Lightning.
The iPhone also complains that it can't validate the (definitely and double-checked) username and password, regardless of whether we use HTTP or HTTPS. Is there a configuration option or patch we can install?
Thanks for the help,
Johnarnaudq wrote:
Try davadmin config -o service.dav.propfinddavheadervalue -v "1, 3, access-control, calendar-access, calendar-schedule, calendar-auto-schedule, addressbook, sync-collection, extended-mkcol, calendar-proxy, calendarserver-principal-property-search"
although the symptoms are usually different (but I never tried the upgrade account scenario myself).Thank you, this at least is part of the solution. I can now add the calendar account in the iPhone's settings app as it stopped complaining that it can't confirm the account. By the way, this is a fresh installation of version 7u2 and I added the account to the iPhone after importing the calendar from an .ics backup... if that helps :-).
However, even when setting the iPhone to sync "all events" instead of "the last month", only meeting invitations how up inside the CalDAV calendar in the Calendar app. To be clear: events that have been created by the same calendar account do not show up (neither past calendar entries, nor future entries).
Is there something else I can try?
Thanks,
John -
Hi,
currently I am using a generic parameter like
public class SomeClass<C extends Enum<C>>meaning that I have a generic type parameter that is guaranteed to be an enum. But this is not enough. I would like to require that any instantiation of C also implements a certain interface. In principle I would like to write
public class SomeClass<C extends Enum<C> implements SomeInterface>which is of course not the correct syntax.
Is there a way to express what I want in Java?
Thanks,
Harald.
Edited by: pifpafpuf on 28.12.2009 22:19
Edited by: pifpafpuf on 28.12.2009 22:19Peter__Lawrey wrote:
There are some examples in the collections libraries. Can't remember where now.example in collections API: [<T extends Object & Comparable <? super T>> T max(Collection<? extends T> coll)|http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#max(java.util.Collection)|extends Object & Comparable] -
Extending Line Items collection in Master Agreements
Hi All
I wanted to add a custom field to Line Items Collection - but I guess it is not possible to add a custom field to a standard collection, next what I tried is to add an extension field to the Line Item Class(1007). But I could not find the Line Item class listed in the dropdown field "Extended Class Name" while creating an extension definition.
Please tell me if it is possible at all to add a custom field for this collection - either to the collection itself or on the Line Items page (page id - contracts.lineitem.ui.buyside.default)
Thanks!Hi
Plz check the following thread.
Need to add new field in Rfx Line Item Page
Regards
Mudit Saini -
Acrobat Pro 9 Extended not available for CS5 Master Collection
Hello Forum Folks:
I have a volume license account with 5 CS5 Master Collections.
As part of the CS5 MC suite Acrobat 9 Pro is included.
I was told by a sales rep that Acrobat 9 Pro Extended cannot be purchased as an upgrade from a suite product.
If I choose to purchase Acrobat 9 Pro Extended it would be as a stand alone product license at full price for all five licenses.
MY DILEMMA:
I only need one of the features that Acrobat 9 Pro Extended offers that's not included in the Pro version.
If I purchase 5 stand alone copies of Acrobat 9 Pro Extended, I will have 5 additonal licenses of Acrobat
outside of my 5 CS5 Master Collection licenses to keep up with.
So in effect I'll have 10 licenses of 2 different versions of Acrobat 9 Pro and Extended to upgrade
sometime in the future in order to keep all uniform and in sync.
This is not an efficient nor economical way to stay current with Adobe's fine products.
The Case manager I spoke with did a fine job attempting to assist me but was unable to find an effective solution.
She recommended that I post on the forum and an Adobe staff member might be able to contact me
and address my concerns. Case Number: #204262178
Thank You / Peace
vazVanelliI respect that you are employed by MicroSoft, but the compatability center is not always accurate. It indicated that Adobe Pro 8 was compatabile for both 32 bit and 63 bit - but it is not. I have upgraded to Adobe Pro 9 Extended because Adobe says that this is compatable with 64 bit. The Microsoft compatability center also says that v9 is compatable with 64 bit. But it is Not. I have upgraded Adobe to 9.3.0, and it is Still not working. I now have $700 invested in Adobe software that is non-functional due to W7 64 bit.
So although users can check the compatability center - as I did prior to purchasing my new laptop - but it may not be accurate.
And yes, I have updated the compatability center to indicate that the information there is incorrect.
I have searched/googled everything that I can think of, and still nothing helps. If you have a suggestion how to make this work, I am listening. -
Doubt Regarding Statistics Collection in 10g
Hello,
Me Jr Dba i have a doubt regarding statistics calculation in 10g.As we know that if we set
the initilization parameter STATISTICS_LEVEL=Typical then AOS(Automatic Optimizer staistics) calculate the statistics for the tables, whose blocks are greater then 10% changed from the last calculation.Here my doubt is since already statistics are gathered,
is there any necessity for us to gather the statistics manually by using
DBMS_STATS.GATHER to see the tables or system statistics.
Can u plz assist me on the above
Regards,
VamsiHi,
Please see here,
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/stats.htm#i41448
If the table/s are changing very frequently than its better to gather the stats manually.This would lead teh volatile table coming up into the stats job again and again.
For the system stats and data dictionary stats,they are not collected by default.So there is no choice but to gather them manually.
Aman.... -
Doubt about Bulk Collect with LIMIT
Hi
I have a Doubt about Bulk collect , When is done Commit
I Get a example in PSOUG
http://psoug.org/reference/array_processing.html
CREATE TABLE servers2 AS
SELECT *
FROM servers
WHERE 1=2;
DECLARE
CURSOR s_cur IS
SELECT *
FROM servers;
TYPE fetch_array IS TABLE OF s_cur%ROWTYPE;
s_array fetch_array;
BEGIN
OPEN s_cur;
LOOP
FETCH s_cur BULK COLLECT INTO s_array LIMIT 1000;
FORALL i IN 1..s_array.COUNT
INSERT INTO servers2 VALUES s_array(i);
EXIT WHEN s_cur%NOTFOUND;
END LOOP;
CLOSE s_cur;
COMMIT;
END;If my table Servers have 3 000 000 records , when is done commit ? when insert all records ?
could crash redo log ?
using 9.2.08muttleychess wrote:
If my table Servers have 3 000 000 records , when is done commit ? Commit point has nothing to do with how many rows you process. It is purely business driven. Your code implements some business transaction, right? So if you commit before whole trancaction (from business standpoint) is complete other sessions will already see changes that are (from business standpoint) incomplete. Also, what if rest of trancaction (from business standpoint) fails?
SY. -
Extending user collection dynamically
hello,
I have folloving code:
CREATE TYPE T_my_row OID '4711'
IS OBJECT(field1 varchar2(10), field2 number(10));
CREATE TYPE TT_my_table OID '0815'
IS TABLE OF T_my_row;
declare
my_table TT_my_table := TT_my_table()
begin
for my_value in (select rownum, 'a' as filed1, 2 as field2 from dual) loop
my_table(my_value.rownum) := T_my_row(my_value.filed1,my_value.filed2);
end loop;
end;
/but this gives me an error:
ORA-06533: Subscript beyond count.
I understand that I need to tell how many entries the table may have.
But how do I do that without providing all rows on initialisation?
Is there something like my_table TT_my_table := TT_my_table(p_max_row_count=>407) ?
bye
TPDT.PD wrote:
I understand that I need to tell how many entries the table may have.
But how do I do that without providing all rows on initialisation?
Is there something like my_table TT_my_table := TT_my_table(p_max_row_count=>407) ?No. You can use the +.Extend()+ method to add (null) objects to the collection.
In your example's case however, it is much simpler to allow PL/SQL to do all the work for you - extending the collection and populating it using a bulk collect.
E.g.
select T_My_Row( col1, col2 ) bulk collect into my_table from table where ...
Of course, you need to be mindful of the size of the collection created. PGA memory is used - and as dedicated server memory (opposed to shared server memory), it is expensive memory. And not to be needlessly wasted. -
Doubt in Looping over a collection...?
Hello,
As i was goin through some collections topics .. i have understood the basics, but i am NOT able to understand this line ... *" l_tab(l_tab.last) := i; "*
DECLARE
TYPE t_tab IS TABLE OF exception_test.id%TYPE;
l_tab t_tab := t_tab();
BEGIN
-- Fill the collection.
FOR i IN 1 .. 100 LOOP
l_tab.extend;
l_tab(l_tab.last) := i;
END LOOP;
End;
Why it is assigning like ' l_tab.LAST '.....?? y not from FIRST place....???
ThanksAijaz Mallick wrote:
Tht's Correct ... But why only LAST & why not FIRST....???Perhaps if you look at the contents while you do it, you'll get an idea...
SQL> ed
Wrote file afiedt.buf
1 declare
2 type t_coll is table of integer;
3 v_coll t_coll := t_coll();
4 --
5 procedure show_coll is
6 v_str varchar2(2000);
7 begin
8 for x in 1..v_coll.last
9 loop
10 v_str := ltrim(v_str||','||v_coll(x),',');
11 end loop;
12 dbms_output.put_line('Array Size: '||to_char(v_coll.last,'99')||' : '||v_str);
13 end;
14 --
15 begin
16 for i in 1..10
17 loop
18 v_coll.extend;
19 v_coll(v_coll.last) := i;
20 show_coll;
21 end loop;
22* end;
SQL> /
Array Size: 1 : 1
Array Size: 2 : 1,2
Array Size: 3 : 1,2,3
Array Size: 4 : 1,2,3,4
Array Size: 5 : 1,2,3,4,5
Array Size: 6 : 1,2,3,4,5,6
Array Size: 7 : 1,2,3,4,5,6,7
Array Size: 8 : 1,2,3,4,5,6,7,8
Array Size: 9 : 1,2,3,4,5,6,7,8,9
Array Size: 10 : 1,2,3,4,5,6,7,8,9,10
PL/SQL procedure successfully completed.Whereas, if you where using FIRST instead of LAST, you'd get...
SQL> ed
Wrote file afiedt.buf
1 declare
2 type t_coll is table of integer;
3 v_coll t_coll := t_coll();
4 --
5 procedure show_coll is
6 v_str varchar2(2000);
7 begin
8 for x in 1..v_coll.last
9 loop
10 v_str := ltrim(v_str||','||v_coll(x),',');
11 end loop;
12 dbms_output.put_line('Array Size: '||to_char(v_coll.last,'99')||' : '||v_str);
13 end;
14 --
15 begin
16 for i in 1..10
17 loop
18 v_coll.extend;
19 v_coll(v_coll.first) := i;
20 show_coll;
21 end loop;
22* end;
SQL> /
Array Size: 1 : 1
Array Size: 2 : 2,
Array Size: 3 : 3,,
Array Size: 4 : 4,,,
Array Size: 5 : 5,,,,
Array Size: 6 : 6,,,,,
Array Size: 7 : 7,,,,,,
Array Size: 8 : 8,,,,,,,
Array Size: 9 : 9,,,,,,,,
Array Size: 10 : 10,,,,,,,,,
PL/SQL procedure successfully completed.
SQL> -
Hi All,
I've one doubt regarding the bulk operations using the forall statement.
Check below eample:
CREATE TABLE emp_temp AS SELECT * FROM employees;
DECLARE
TYPE empid_tab IS TABLE OF employees.employee_id%TYPE;
emp_sr empid_tab;
-- create an exception handler for ORA-24381
errors NUMBER;
dml_errors EXCEPTION;
PRAGMA EXCEPTION_INIT(dml_errors, -24381);
BEGIN
SELECT employee_id BULK COLLECT INTO emp_sr FROM emp_temp
WHERE hire_date < '30-DEC-94';
-- add '_SR' to the job_id of the most senior employees
FORALL i IN emp_sr.FIRST..emp_sr.LAST SAVE EXCEPTIONS
UPDATE emp_temp SET job_id = job_id || '_SR'
WHERE emp_sr(i) = emp_temp.employee_id;
-- If any errors occurred during the FORALL SAVE EXCEPTIONS,
-- a single exception is raised when the statement completes.
EXCEPTION
WHEN dml_errors THEN -- Now we figure out what failed and why.
errors := SQL%BULK_EXCEPTIONS.COUNT;
DBMS_OUTPUT.PUT_LINE('Number of statements that failed: ' || errors);
FOR i IN 1..errors LOOP
DBMS_OUTPUT.PUT_LINE('Error #' || i || ' occurred during '||
'iteration #' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
DBMS_OUTPUT.PUT_LINE('Error message is ' ||
SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
END LOOP;
END;
Here we update using bulk collect & the exceptions for each iterations are kept separately.
In case, I want to know whether the sql statements in each array are executed separately or all the statements are executed in bulk?
Thanks
DeepakMay this will answer it...
FORALL - documentation -
Collective Settlement Order Doubt
Hi,
I have a doubt about Collective Settlement (t-code KO8G) for this situation: I have order A that has Order B as Settlement Receiver in the Settlement Rule, and order B that has Cost Center C as Settlement Receiver in the Settlement Rule.
Is there a way to process the settlement for order A and B just one time in KO8G, instead of doing it twice. The first time for order A, then for order B.
Best Regards,Hi
Welcome to SDN
Sorry, but thats not possible because each order is processed individually for settlement.... Hence, when you process A & B 1st time - A settles to B, But B has nothing to settle at that time
When you settle again - A has nothinf to settle this time, but B settles to Cost center C
br, Ajay M
Maybe you are looking for
-
Hi, In my current project we use AFS material, For a finished material we use strategy 50, after creating planned independent requirement, without running MRP, in stock requirements we can able to see the planned orders. How is this possible?. Als
-
User changes the page HTML code on the fly and it works... what?!
Hi, I have a report region that generates a number of checkboxes using htmldb_item.checkbox. Each checkbox is associated with a date, and what dates are displayed are based on a number of business rules. The user then can select any date she wants (f
-
Why does Leopard awaken but then not go back to sleep?
I can understand that there is some process that wakes my Mac up in the middle of the night; Software Update, for instance. But what I do not understand is that if the preferences are set to put the Mac to sleep after a period of activity, and I can
-
Syncing to xcode, need an earlier version of the itouch OS
I've been attempting to sync my itouch to xcode, but when i select "Use device for development", it tells me that xcode doesn't support the latest version of itouch OS. I have 3.1.3 , and the latest version that xcode says it supports is 3.1.2 either
-
Internal Order Settlment Error: First settle items from previous year in
Dear Gurus, I tried to work out a solution to settle AUC to G/L expense account through internal order. I tested in QA system it works well. But in PRD, it gave me an error message "First settle items from previous year in the previous year". The pro