Concept with collection
why static objects and enum not allowed in collection.????
"static object" is an oxymoron.
There are collections built precisely for enums.
And you can add enum objects to regular collections as well.
What are you having trouble with, exactly?
Similar Messages
-
How can I copy a Font Book library with "Collections" to my 2nd laptop?
How can I copy a Font Book library with "Collections" to my 2nd laptop?
I have a number of fonts (approx. 500) on my work laptop which are sorted to different Collections. I'd like to have a copy of the Font Book library with Collections on the laptop I use at home to work. I'd think there was a more straight forward way to do it, but I haven't found any posts regarding the matter so any help would be appreciated.
ThanksTo anyone who is reading this based on needing to copy their Font Book to another machine as I do, there is a way to make a copy of the fonts in Font Book by going to file/export fonts. Keep in mind that you will need to have all the fonts selected (command A) in your "All Fonts" list for them to be exported. You will then have a new folder saved to where ever you chose, with all your Font Book fonts in it.
-
EJB 3.0: How to merge detached entity with collection
Hello,
suppose you have 2 database tables: PARENT and CHILD with one-to-many association. In a session bean you load the parent entity together with collection of children and send it all to client. Client might change parent or child data, add/remove children.
Now back in a session bean you want to update database, so you call:
entityManager.merge(detached_parent_entity);Problem is, that removed child objects from entity bean collection are not deleted from database. Bacause I am currently using Hibernate, I could follow the FAQ (http://www.hibernate.org/116.html#A17) and add delete-orphan cascade, but I don't want to be tight to Hibernate nor other frameworks.
Is there any sexy solution?
Thanks for replies!I'm afarid not - a generic feature that will allow to
delete orphan children didn't make it into the final
spec.
regards,
-marinaDo you happen to have any links to public discussions about this feature with regard to the development of the spec? This is a very nice feature in Hibernate and it's absence in EJB 3.0 is rather disappointing.
Thanks. -
Problems Creating Mappings with Collections with tools or workbench
Hi -
I am a new kodo user for my company. And am having a few problems in genereal with mapping objects with collections
in them.
I followed the tutorial on how to use the kodo workbench
using the Passenger example. Build the java code and then
tried to creat a new set of metadata. After going through
this process I expected to see TWO tables. Something like
'PAssenger' and something like 'Luggage' where luggage
would be joined to passenger. However what I am getting
is ONE table passenger with a BLOB field 'Luggage'. This
has been a contant problem with me with any composite
java class containing collection. Obviously I am configuring something wrong. Any help would be great.
Thanks
MattAnswered by one of my fellow and unknown colleagues that suddenly entered the room
-
Problems with collective search help
Hello SDNers,
I was working with collective search help.
Ex : zc_srch1 (Collective)
In the 'Include search help' i have included 2 search elementary search
help
Ex : zsrc1 and zsrc2 (both elementary)
I have also assigned the parameter assignment for each included search help.
I have also mentioned the search help parameter under definition tab
Ex field form zsrch1 and field1 from zsrch2
and also checked the import and export checkboxes.
Now i have used the search help in the abap program
ex: tmp type field1 matchcode object zc_srch1.
Now when i execute the program the collective search help is getting populated. when i try to choose a value it is not getting selected to the parameter box.
Regards,
Ranjith NHi,
Once again check back your seach help creation by following the link below.
http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21ee86446011d189700000e8322d00/content.htm
Cheers!!
VEnk@ -
Working with collections in powershell
Hi,
I'm struggeling with collections in Powershell in general.
I have a variable of type SPWebCollection created and want to add
1) a single SPWeb - Object
2) another collection of SPWeb - Objects
Can someone tell me please why the following doesn't work:
[Microsoft.Sharepoint.SPWebCollection]$allWebs += Get-SPWeb $URL1
or this
[Microsoft.Sharepoint.SPWebCollection]$allWebs += $site.AllWebs | Where-Object {$_.Url -like $URL2}
Finally I want to empty the $allWebs collection i.e. remove all objects. How do I do that?
I appreciate any feedback
Thank youHi,
According to your description, you might want to gather all the SPWeb object into a collection object in order to delete all of them finally.
As we can see, there is no such method in
SPWebCollection object can meet you requirement, as a workaround, we can push all the SPWeb objects into an array, then operate
these SPWeb objects in this array would do the trick.
Here is a link about how to create a generic collection for a list of objects:
http://www.andreasbijl.com/powershell-create-collections-of-custom-objects/
More information about using collection in PowerShell:
https://www.simple-talk.com/sysadmin/powershell/powershell-one-liners--collections,-hashtables,-arrays-and-strings/
Best regards,
Patrick
Patrick Liang
TechNet Community Support -
Explain User exit concept with simple example
Hi friends
I am new member of this forum & i am learning ABAP.
Kindly send me user exit concept with simple example to my mail ID so i can able to use it.
mail ID [email protected]
thanks in advance
Thanks & RegardsCode SE18 is used to Identify the BADI available.
Look for the string 'CL_EXITHANDLER' in the standard program. This is a class which has a method 'GET_INSTANCE' which is used to trigger BADI's from the Standard Program. The interface parameter for this static method 'EXIT_NAME' is used to pass the BADI to the method.
Open Standard Program and do a global search 'CL_EXITHANDLER'.
SE18 > give the BADI name found through above search.
CUSTOMER_ADD_DATA > which has a method SAVE_DATA.
T.Code SE19 is used to Implement BADI.
SE19 > give the implementation name > Give the Definition name as CUSTOMER_ADD_DATA and the Short Text.
Intro.....
http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
Check these links for info about badi..
BADI's
http://support.sas.com/rnd/papers/sugi30/SAP.ppt
BADI's
http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
http://support.sas.com/rnd/papers/sugi30/SAP.ppt
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
http://members.aol.com/_ht_a/skarkada/sap/
http://www.ct-software.com/reportpool_frame.htm
http://www.saphelp.com/SAP_Technical.htm
http://www.kabai.com/abaps/q.htm
http://www.guidancetech.com/people/holland/sap/abap/
http://www.planetsap.com/download_abap_programs.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
/people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
/people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
http://www.esnips.com/web/BAdI
http://www.allsaplinks.com/badi.html
New to Badi
check any fo the below links. this will def help u.
http://www.allsaplinks.com/badi.html
And also download this file....
http://www.savefile.com/files.php?fid=8913854
There are other tutorials on this site...
http://sapbrain.com/Tutorials/tuto_download.html
What are BAdIs?
-> is an anticipated point of extension these points act like sockets and exist in the original source code
-> based on ABAP Objects. BAdI defines an interface that can be implemented by BAdI-implementations that are transport objects of their own
->Important! There are 2 roles: Enhancement Option-provider & Implementer.
-> In the above context, Enhancement Implementation can be done only if option (hook) is provided by the Option-provider. In simple words there are no implicit BAdIs.
Note: In the following slides, Definitions are created so as to understand the method of BAdI definition & for example purpose. As stated above this is the role of Enhancement Option-Provider.
Classic BAdIs already exist since SAP Release 4.6
BAdIs have been Re-implemented in ECC7.0 under the new Enhancement Framework & Switch Framework
Classic BAdIs
To understand what a powerful pattern a BAdI is, we will now define & then implement a BAdI
BADI Class is created automatically.
The various options are described below in detail:
1. Enhanceable: Enhanceability of filter types can only be specified for filter-dependent BADI definitions under very special conditions. For example, the domain belonging to the filter type must be linked with a value table that is of the type E or G. A BADI implementation can then be created in one step by creating a new filter value that is automatically entered into the value table at save and also copied into the transport order of the BADI implementation. In addition, it is also possible to create a new filter value and, at the same time, a BADI implementation with the same name. Naturally, you can also specify existing filter values.
You should select this feature if there is a prerequisite that a new filter value is created together with a new BADI implementation - that is, that BADI implementations are not created solely with existing filter values, although this, too, is possible.
2. Multiple-Use
3. Filter-Dependent
Instance Methods can access all of the attributes of a class and can trigger all events of a class. Static Methods can only access static attributes and static events.
Exceptions:
Events:
Events can be defined in classes or in interfaces. Corresponding methods can trigger these events with the RAISE EVENT statement. Each class (or interface) that is going to handle the corresponding event must implement a relevant handler method, and register it using the SET HANDLER statement. When an event occurs, the system calls all of the handler methods registered for that event.
Like method definitions, events have a parameter interface. The only difference is that events may only have EXPORTING parameters.
BADI : Businees Add IN's
Business Add-Ins are SAP enhancement technique based on ABAP Objects.
Where the SAP standard program is not going to fullfill the client requirement , we are going to add our own program to SAP standard program, without changing the standard prog.
Each Business Add-In has
at least one Business Add-In definition
a Business Add-In interface
a Business Add-In class that implements the interface
Each BADI has two different Views.
1.Definition view
2.Implementation view
T.C for BADI Definition is SE18.
T.C for BADI Implementation is SE19.
There are multiple ways of searching for BADI.
Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
Finding BADI Using SQL Trace (TCODE-ST05).
Finding BADI Using Repository Information System (TCODE- SE84).
1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for CL_EXITHANDLER=>GET_INSTANCE.
Make sure the radio button In main program is checked. A list of all the programs with call to the BADIs will be listed.
The export parameter EXIT_NAME for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter INSTANCE will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
2. Start transaction ST05 (Performance Analysis).
Set flag field "Buffer trace"
Remark: We need to trace also the buffer calls, because BADI database tables are buffered. (Especially view V_EXT_IMP and V_EXT_ACT)
Push the button "Activate Trace". Start transaction VA02 in a new GUI session. Go back to the Performance trace session.
Push the button "Deactivate Trace".
Push the button "Display Trace".
The popup screen "Set Restrictions for Displaying Trace" appears.
Now, filter the trace on Objects:
V_EXT_IMP
V_EXT_ACT
Push button "Multiple selections" button behind field Objects
Fill: V_EXT_IMP and V_EXT_ACT
All the interface class names of view V_EXT_IMP start with IF_EX_. This is the standard SAP prefix for BADI class interfaces. The BADI name is after the IF_EX_.
So the BADI name of IF_EX_CUSTOMER_ADD_DATA is CUSTOMER_ADD_DATA
3. Go to Maintain Transaction (TCODE- SE93).
Enter the Transaction VD02 for which you want to find BADI.
Click on the Display push buttons.
Get the Package Name. (Package VS in this case)
Go to TCode: SE84->Enhancements->Business Add-inns->Definition
Enter the Package Name and Execute.
Here you get a list of all the Enhancement BADIs for the given package MB.
Have a look at http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
http://support.sas.com/rnd/papers/sugi30/SAP.ppt
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
http://members.aol.com/_ht_a/skarkada/sap/
http://www.ct-software.com/reportpool_frame.htm
http://www.saphelp.com/SAP_Technical.htm
http://www.kabai.com/abaps/q.htm
http://www.guidancetech.com/people/holland/sap/abap/
http://www.planetsap.com/download_abap_programs.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
/people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
/people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
How to develop BADI
Rewards if useful. -
How to execute a procedure with collection passed as parameter?
i have created the collection:
CREATE TYPE typ_Project AS OBJECT( project_no NUMBER(2), title VARCHAR2(35), cost NUMBER(7,2))
CREATE TYPE typ_ProjectList AS VARRAY (50) OF typ_Project
and a procedure:
CREATE OR REPLACE PROCEDURE add_project (
p_deptno IN NUMBER,
p_new_project IN typ_Project,
p_position IN NUMBER )
IS
v_my_projects typ_ProjectList;
BEGIN
SELECT projects INTO v_my_projects FROM department
WHERE dept_id = p_deptno FOR UPDATE OF projects;
v_my_projects.EXTEND;
FOR i IN REVERSE p_position..v_my_projects.LAST - 1 LOOP
v_my_projects(i + 1) := v_my_projects(i);
END LOOP;
v_my_projects(p_position) := p_new_project; -- add new
UPDATE department SET projects = v_my_projects
WHERE dept_id = p_deptno;
END add_project;
Now please explain how to call this procedure with collection passed as parameter . . .For example:
BEGIN
add_project(
10, -- department number
typ_Project(
99, -- project number
'New Project', -- project title
99999.99 -- project cost
), -- new project
5 -- project position
END;
/SY. -
Hi i have some problem with collect statement.
hi when i am using collect statement and whn ever any field is modified it is getting doubled and showing doubled value. may i knoe what would be problem.
Hai Kumar
Go through the following Collect Syntax
COLLECT
Basic form
COLLECT [wa INTO] itab.
Addition
... SORTED BY f
Effect
COLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab .
If you use only COLLECT to fill an internal table, COLLECT makes sure that the internal table does not contain two entries with the same default key fields.
If, besides its default key fields, the internal table contains number fields (see also ABAP/4 number types ), the contents of these number fields are added together if the internal table already contains an entry with the same key fields.
If the default key of an internal table processed with COLLECT is blank, all the values are added up in the first table line.
If you specify wa INTO , the entry to be processed is taken from the explicitly specified work area wa . If not, it comes from the header line of the internal table itab .
After COLLECT , the system field SY-TABIX contains the index of the - existing or new - table entry with default key fields which match those of the entry to be processed.
Notes
COLLECT can create unique or compressed datasets and should be used precisely for this purpose. If uniqueness or compression are unimportant, or two values with identical default key field values could not possibly occur in your particular task, you should use APPEND instead. However, for a unique or compressed dataset which is also efficient, COLLECT is the statement to use.
If you process a table with COLLECT , you should also use COLLECT to fill it. Only by doing this can you guarantee that
the internal table will actually be unique or compressed, as described above and
COLLECT will run very efficiently.
If you use COLLECT with an explicitly specified work area, it must be compatible with the line type of the internal table.
Example
Compressed sales figures for each company
DATA: BEGIN OF COMPANIES OCCURS 10,
NAME(20),
SALES TYPE I,
END OF COMPANIES.
COMPANIES-NAME = 'Duck'. COMPANIES-SALES = 10.
COLLECT COMPANIES.
COMPANIES-NAME = 'Tiger'. COMPANIES-SALES = 20.
COLLECT COMPANIES.
COMPANIES-NAME = 'Duck'. COMPANIES-SALES = 30.
COLLECT COMPANIES.
The table COMPANIES now has the following appearance:
NAME SALES
Duck 40
Tiger 20
Addition
... SORTED BY f
Effect
COLLECT ... SORTED BY f is obsolete and should no longer be used. Use APPEND ... SORTED BY f which has the same meaning.
Note
Performance
The cost of a COLLECT in terms of performance increases with the width of the default key needed in the search for table entries and the number of numeric fields with values which have to be added up, if an entry is found in the internal table to match the default key fields.
If no such entry is found, the cost is reduced to that required to append a new entry to the end of the table.
A COLLECT statement used on a table which is 100 bytes wide and has a key which is 60 bytes wide and seven numeric fields is about approx. 50 msn (standardized microseconds).
Note
Runtime errors
COLLECT_OVERFLOW : Overflow in integer field when calculating totals.
COLLECT_OVERFLOW_TYPE_P : Overflow in type P field when calculating totals.
Thanks & regards
Sreenivasulu P -
Biller Direct Integration with Collections Manangement
Hi Experts
I know the Biller Direct integration with Dispute management but not with collections management.
Can anyone explain me the process / Steps of Integration between Biller Direct and Collections Management?
Thanks in advance
Regards,
Meenakshi.NHi Meenakshi,
There is no direct integration between Collections management and Biller direct.
Cristobal. -
Actual Duration with collective confirmation
Dear experts
actual duration does not appear in confirmation Report CN48N when i confirm activity with collective confirmation CN27
and if possible i need the system to calculate automatically the actual duration when i entered actual start and finish dates
Thanks & Regards>
Mohammad wrote:
> actual duration does not appear in confirmation Report CN48N when i confirm activity with collective confirmation CN27
>
is it appearing by individual confirmation..? -
Hello, I have an assignment on collection and have tried to implement it but facing errors that i am unable to understand.
Below is what i am supposed to do and below that is my code which is ofcourse not working as always (just kidding)
Question:
Design and Implement a class called SimpleEmailManager, in package swd.util, which manages a collection of SimpleEmail instances. The manager�s behaviour is shown in the following sample codes: [35%]
SimpleEmailManager manager = new SimpleEmailManager();
// Construct a SimpleManager that manages an empty collection of SimpleEmails
SimpleEmail m1 = new SimpleEmail (�);
Mail m2 = new Mail (�);
m1.setCreateDate(new java.util.Date(�Jan 1, 2002�));
m2.setCreateDate(new java.util.Date(�June 16, 1997�));
manager.add(m1); // Add Mail m1 to the collection
manager.add(m2); // Add Mail m2 to the collection
SimpleEmail m = manager.getNewestMail();
// Return one of the SimpleEmail in the collection with the most recent creation
// date. Return null if the collection is empty
java.util.Iterator iterator1 = manager.getMailMadeBefore("Jan 1, 1998");
// Return an Iterator of the Simple Mails in the collection created Before
// the specific date
java.util.Iterator iterator2 = manager.iterator()
// Return an Iterator of the collection managed by the manager
manager.remove(m1)
// Remove mail m1 from the collection
My Solution:
package swd.util;
import java.util.*;
import javax.swing.*;
import swd.util.SimpleEmail;
import swd.util.Mail;
* <p>Title: SimpleEmailMsnsger Class</p>
* <p>Description: Manages a colection of objects of simple email class</p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* <p>author Irfan Noor Bukhari ID=12748237</p>
* <p>version 1.0</p>
public class SimpleEmailManager
SimpleEmailManager manager = new Collection();
public SimpleEmailManager()
SimpleEmail m1 = new SimpleEmail ("Wag The Dog", "[email protected]", "[email protected]");
Mail m2 = new Mail ("[email protected]", "[email protected]", "Is this the subject", "Wag The Dog");
m1.setCreateDate(new Date("Jan 1, 2002"));
m2.setCreateDate(new Date("June 16, 1997"));
manager.add(m1);
manager.add(m2);
SimpleEmail m = manager.getNewestMail();
//JOptionPane.showInputDialog("Enter Date")
// Collection c;
// c.add(m1);
// c.add(m2);
//m1.setCreateDate(new java.util.Date("Jan 1, 2002"));
//m2.setCreateDate(new java.util.Date("June 16, 1997"));
//manager.add(m1); // Add Mail m1 to the collection
//manager.add(m2); // Add Mail m2 to the collection
//SimpleEmail m = manager.getNewestMail();
// Return one of the SimpleEmail in the collection with the most recent creation
// date. Return null if the collection is empty
//java.util.Iterator iterator1 = manager.getMailMadeBefore("Jan 1, 1998");
// Return an Iterator of the Simple Mails in the collection created Before
// the specific date
//java.util.Iterator iterator2 = manager.iterator()
// Return an Iterator of the collection managed by the manager
//manager.remove(m1)
// public Collection add(SimpleEmail o)
// Collection c;
// c.add(o);
// return c;
public SimpleEmailManager getNewestMail()
Iterator i = manager.iterator();
if (manager == null)
return null;
else
while ( i.hasNext() )
System.out.println(i.next().toString());
return i.next();
public static void main(String[] args)
new SimpleEmailManager();
please help meHow much of java do you know? Since you have started working on Collections I take it that you have covered the basics of class, constructors, variables & their types & such like. From your code it is apparent that you still haven't understood these basic concepts. I'd recommend that you read your notes, read a good book on java, read the tutorials on sun's website (the 1st few trails), get a firm grasp of these basic concepts first and then go back to your Collections assignment. Yes, this is a lot of work; yes it will take time; but nothing of value can be learned without expending time & energy.
Since I'm feeling rather magnanimous at this time, I'll give you a hint. You have class called SimpleEmailManager; you are declaring a variable called manager of type SimpleEmailManager in the constructor; but you are trying to create it as a Collection type. Decide whether the var manager is SimpleEmailManager or Collection. -
We have been using Photoshop Elements 5.0 a lot lately to organize many photos into collections. A new problem just arose when creating a new collection.
As we named the new collection and clicked on "OK" it replaced another existing collection with the new name. The photos from the old collection were still there but now under the new collection name. This happened at least three or four times, each time a different "old" collection was renamed. Does anyone know why this would happen?
This past week we have added at least 20 new collections with no problem prior to this. Adobe actually had to shut down when this happened. Each time we reopened Adobe it would happen again randomly renaming a different "old" collection when we tried to add the new one. Any insights would be much appreciated.Thank you - that was the problem and now it is working correctly
again!
Tom Z.
>>> saurabh288 <[email protected]> 05/24/09 4:23 AM >>>
It may be that the catalog has been corupted.Try repairing the
catalog of PSE. -
I have posted about this previously and have been working on it and could use some help/advice. I had a charge of from 2011 from JC Penney for $741 and when I contacted JC P to make payment, they sent me to a company called "crown asset management." When I contacted this company they said they weren't handling the collection and sent me to an attorrneys office. When I called them they agreed to a payment plan and at that time nothing was on my credit report for this account except the charge off. I have made 2 payments and suddenly a collection pops up on my account from JC Penney and the collection is listed under Synchrony Bank FKA GEO Capital. I want the collection to note that it is open and being "paid as promised." Crown Assett Management, JC Penney and the Attorney office all say to contact one another. I have called Synchrony Bank and they do not have an account in my name. What can I do? I am pulling my hair out with this one.
The taking and reporting of the charge-off is totally separate from any issue of subsequent collection on the debt.It is simply a reporting by the creditor that they moved the bad debt in their accounting books from a receivable asset over to an loss as a bad debt.The consumer continues to owe the entire debt, and can continue to collect upon it themselves of via a debt collector.A charged-off debt can also become a collection if referred to or sold to a debt collector. An in-house collection can still qualify as a debt collector under the FDCPA, and thus report a collection.As clearly defined under FDCPA 803(6), "the term includes any creditor who, in the process of collecting his own debts, uses any name other than his own which would indicate that a third person is collecting or attempting to collect such debts."Synchrony is thus considered a debt collector, and subject to all provisions of the FDCPA. As you pay the debt, you can insist that they promptly update the remaining balance under their collection, and notify the credtior of the current balance.FCRA 623(a)(2) requires a party who has reported to a CRA to promplty update their reporting so as to maintain its current accuracy.It is common for creditors and debt collectors not to update the remaining balance after receipt of each payment, but technically you can insist that they do so. Once the debt is paid, neither the charge-off reported by the OC nor any collection that might also be reported by a debt collector is required to be deleted.They are required to promplty update the balance to show $0 debt (creditor) and $0 remaining under collection (any debt collector).
-
Working with Collection in PL/SQL
Hi,
I am new in PL/SQL programming.
I am writing a PL/SQL stored procedure that have a "data collection" output argument. It extracts a list of data items (eg. id, temperature) from a table. The data items are stored in a collection (as the number of items is unknown therefore I am going to use nested table instead of varray). Some of the fields in the data items on the data collection will be transformed (eg. convert temperature from Fahrenheit to Celsius) before it is returned to the caller program.
* Question1:
How can I add data into a nested table (or varray) one at a time? (see sample codes below)
Eg.
I declared a nested table in the spec:
type test_record_t is record (
test_id number,
test_value number);
type test_list_t is table of test_record_t;
test record test_record_t;
test_list test_list_t;
Then in the body:
i := 1;
loop
fetch test_cursor into test_record;
exit when test_cursor%notfound;
test_list(i) := test_record; -- syntax error
i := i+1;
end loop;
All the examples I have seen so far that the list is populated when it is initialised:
Eg.
test_list := test_list_t(test_record1, test_record2);
but not
test_list(1) := test_record1;
test_list(2) := test_record2;
It could be that I am trying to implement the PL/SQL codes with my C/C++ thinking instead of PL/SQL. Do you have any suggestion?
* Question2:
How do you declare a PL/SQL procedure that have a nested table (or varray) output argument?
Eg.
PROCEDURE test_proc(data_list OUT ???);
Thank you very much and best regards,
Phil
PS. I am using Oracle 9.2Phil, why are you using a collection to pass the data? PL/SQL collections reside in expensive PGA memory. Collections are thus not very scalable. The bigger they are, the less server memory for everyone else on the server. The more processes/sessions using your code, the more collections there are.. and again less server memory to go around for everyone else.
The primary reason for using collections in PL/SQL is to create a buffer that allows you to pass more rows between the PL and SQL engines in a single call. This reduces context switching and increases performance. PL in 10G already does this implicitly for you as bulk fetching/passing data is so critical to performance. PL/SQL collections allow you to explicitly manage this yourself.
Using a PL/SQL collection to "buffer" data for a client application is usually not the best of ideas. It involves using expensive PGA memory. It involves copying data from the inexpensive and scalable buffer cache into PL. It requires PL to crunch that data.
Typically doing all this in SQL is significantly faster and many times more scalable. E.g. using PL to construct the SQL statement that does this data crunching and processing, have PL create a cursor in the SQL engine for that statement, and then pass a reference handle to the client for using that cursor - fetching the data directly from the buffer cache and SQL engine.
Remember that despite the PL being very similar to other procedural languages, the environment it runs in is very different environment. Inside a database server process. With tight integration with the SQL engine.
PL is both a client language (it uses SQL as the server supplying data) and a server language (it is called by clients as a service on the server).
In order to use PL effectively, the very basic design rule is minimise PL/SQL and maximise SQL. Do not do in PL what SQL is perfectly capable of doing.. as the SQL engine will do it better and faster and more scalable than your PL code can ever do it.
Maybe you are looking for
-
How do I transfert my domain name from the first registrar to business catalyst ?
Hey, I don't find where (on the Admin Console) I have to put the EEP Key of my domain name I want to use for the website on BC. This EPP Key come from the registrar of my site that I want to transfer to BC. I want use this name domain. Can you help
-
Multiple PFCG Roles to a user and one business role
Hello SAP CRM Experts, we are facing a problem then I need your help. The external user can access the CRM through three distinct business roles. However, for each of these business roles, there are specific access rules configured in three different
-
Can anybody send to me E-mail validation code? Please don't send below code again. This is not working properly. please send a perfect E-mail validation code. Thank you. public static boolean validEmail(String strEmail) Pattern pat=Pattern.c
-
Why is Photoshop Elements 10 making my pics bigger when resizing to smaller dims
I am using the Process Multiple files function to resize pics, which I have done many times before. However, when I try to resize my pics to 1000 x 750, Photoshop is blowing them up to approx 30,000 x 30,000. I've never sen this happen. The organiz
-
Help required with Browser Cookies..
Hi, How do we default the userlogin of the Login Page using Cookies?? The procedure given below was taken from one the login pages created with HTMLDB Applications... What does "c.vals(1)" stand for and what value will it contain... declare v varchar