How can I fill a table of objects from cursor with select * bulk collect???

Hi All, I have a TYPE as OBJECT
create or replace type dept2_o as object (
deptno NUMBER(2),
dname VARCHAR2(14),
loc VARCHAR2(13));
I can fill a table of objects from cursor with out select * bulk collect...., row by row
declare
TYPE dept2_t IS TABLE of dept2_o;
dept_o_tab dept2_t:=dept2_t();
i integer;
begin
i:=0;
dept_o_tab.extend(20);
for rec in (select * from dept) loop
i:=i+1;
dept_o_tab(i):=dept2_o(
deptno => rec.deptno,
dname => rec.dname,
loc =>rec.loc
end loop;
for k IN 1..i loop
dbms_output.put_line(dept_o_tab(k).deptno||' '||dept_o_tab(k).dname||' '||dept_o_tab(k).loc);
end loop;
end;
RESULT
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
But I can't fill a table of objects from cursor with select * bulk collect construction ...
declare
TYPE dept2_t IS TABLE of dept2_o;
dept_o_tab dept2_t:=dept2_t();
begin
dept_o_tab.extend(20);
select * bulk collect into dept_o_tab from dept;
end;
RESULT
ORA-06550: line 6, column 39;
PL/SQL: ORA-00947: not enough values ....
How can I fill a table of objects from cursor with select * bulk collect???

create or replace type dept_ot as object (
deptno NUMBER(2),
dname VARCHAR2(14),
loc VARCHAR2(13));
create table dept
(deptno number
,dname varchar2(14)
,loc varchar2(13)
insert into dept values (10, 'x', 'xx');
insert into dept values (20, 'y', 'yy');
insert into dept values (30, 'z', 'zz');
select dept_ot (deptno, dname, loc)
  from dept
create type dept_nt is table of dept_ot
declare
   l_depts dept_nt;
begin
   select dept_ot (deptno, dname, loc)
     bulk collect
     into l_depts
     from dept
   for i in l_depts.first .. l_depts.last
   loop
      dbms_output.put_line (l_depts(i).deptno);
      dbms_output.put_line (l_depts(i).dname);
      dbms_output.put_line (l_depts(i).loc);    
   end loop;
end;
/

Similar Messages

  • How can I generate a table of contents from bookmarks

    How can I generate a Table of Contents from bookmarks in Adobe Acrobat XI?

    Something to try.
    Rick Bostein  provided a "Create Bookmark Report" Acrobat Action.
    With this report as a PDF you could insert it at the start of your PDF document to serve as a "TOC". 
    Go here:
    https://acrobatusers.com/actions-exchange 
    Scroll down some.
    Be well...

  • How can we read the screen field values from the report selection screen wi

    Hi expart,
    How can we read the screen field values from the report selection screen with out having an ENTER button pressed  .
    Regards
    Razz

    use this code...
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
    **Read the Values of the SCREEN FIELDs
    CALL FUNCTION 'DYNP_VALUES_READ'

  • How can I Fill up the applet form from VB code?

    Hi,
    I urgently required help in this issue.
    Please check the below URL :
    http://java.sun.com/applets/jdk/1.4/demo/applets/ArcTest/example1.html
    this is the sample i found on the java example page.
    What I want to do is?
    I want to opened that page in IE from VB. I did it by below code.
    Public WithEvents IE As SHDocVw.InternetExplorer
    Public WithEvents HtmDoc As HTMLDocument
    Private Sub CreateIE()
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = 1
    End Sub
    Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    Set HtmDoc = IE.document
    End Sub
    Private Sub Navigate(URL)
    IE.Navigate URL
    End Sub
    Private Sub Command1_Click()
    CreateIE
    Navigate "http://java.sun.com/applets/jdk/1.4/demo/applets/ArcTest/example1.html"
    Call SetDocument
    End Sub
    Private Sub SetDocument()
    Set HtmDoc = IE.document
    For i = 0 To HtmDoc.getElementsByTagName("a").length
    List1.AddItem HtmDoc.All(i)
    Next i
    End Sub
    I just want to set the value of that two text box and then I want to click on that button.
    Is there any way that i can do it by getting the java applet content or by some another way?
    I downloaded the Java Activex Bridge. but i didn't found any solutions. I couden't understand that how can I use it.
    Please reply me as soon as possible as I am stuck on it. If possible send me sample project in VB 6.0 also for the same.
    Edited by: Sanket Shah on Feb 25, 2010 2:41 AM
    Edited by: SanketShah on Feb 25, 2010 2:43 AM
    Edited by: SanketShah on Feb 25, 2010 2:44 AM

    I'm certain that VB forums exist. I'm fairly certain that Microsoft would support them, so that's where I would look.
    But I would bet a fair amount of money that they'll tell you "That's a Java problem, ask on a Java forum". Let me just say that you can interface with an applet via Javascript (I haven't done it myself but you could look it up). Then your problem becomes how to execute Javascript from your VB code. That's probably askable on the VB forum.

  • How can I delete Z.SAPB18.8_MyPO object from B1iSN 8.8

    Dear All,
    I have created only one object type (apart from the B1iSN default one)
    Ex: For the Purchase Order object (LocalObjectId = 22) I defined only one B1iSN object type.
    but I have the same error message "Sender SysId, Sender ObjectType or Sender payload is missing".
    suppose If by mistake I create two B1iSN object types for the same B1 object (same local object id)
    how can I delete one object from those two objects.
    Thanks and Regards,
    Anvar

    Hi Anvar,
    Z-objects always have priority against standard objects.
    =>  if you have more Z-objects for the same local object ID, it's always the latest created object
    If you created an Z-object, please make sure, that the BIUs can handle this object.
    All default integration scenarios need to be adjusted or copied to support the newly created z object.
    If you want to delete your newly created object, go to SAP B1iSN Tools -> Repository Tools -> Entities - Remove:
    Select your Entity Type (e.g. Object Type) and your Entity Instance (e.g. Z.SAPB18.8_MyPO) and press button Delete Entity.
    B1iSN gives you information, if there're constraints (e.g. Publication Object or object is used in an active integration scenario) and the object can't be deleted.
    Best regards
    Bastian

  • How can i fill PIQRULEMASTERS table

    I am testing registration using VSR and i wander when and how PIQRULEMASTERS
    table get a values.
    In the IDES system we have rule module 9001 = Reg. Deadline
    and we also have rule container Registration Rules - General
    and i linked it with program using call-up point 0016
    but i can not get any values for this VSR which means always false.
    did i missed something ?
    regards,
    jin dal

    Hi,
    The table CRMD_MKTPL_BDINC is populated with fields when we add fields using EEWB.
    When we use AET these fields are directly appended as structures to CRM_MKTPL_ATTR table.
    Hope this answers your query.
    Regards,
    Sayan

  • How can I reinstall 24.6 & keep Thunderbird from updating with 31

    Thunderbird 31 screws up my e-mail addresses. The background in the header turns all blue & when I enter names, most appear in red ink. It does not call up the addresses from my address book using my abbreviated letters as 24.6 did & it substitutes names until I spell the whole name out.
    I keep doing system restores to get 24.6 back & would like to block future Thunderbird updates so I can keep 24.6. If not, how do I fix this lousy replacement.

    I performed another restore to get to my previous version of 24, then followed your directions. You are right 31 settings are different than 24, nonetheless in 24, I unchecked all references to updating & It worked for me. The big test came with all the pending updates which I performed, except Internet Explorer. The updates didn't affect TB, so I went ahead & updated Explorer and my setting held.
    I'm back in business now. I would still like to know why 31 screwed things up so bad. Like Windows 8 & 8.1, I don't want it and opted for Windows 7 on my new laptop.
    Thanks for the helpful minfo.

  • How can I fill my Organizer

    Good evening Creative Community,
    Sorry when my English is not so good because I'm German.:mansad:
    I have a question how can I fill my Zen X-fi 2 Organizer with the Creative Media Centrale.
    And my own Meaning to Creative Media Centrale is not so good and I find
    the Software for the Zen V Plus better because the Software of Zen V Plus is clearer
    and you can fill your player easyer than the software of the Zen X-fi 2.
    I hope you can help me and you can understand my english and what I mean.
    Nicolaj

    You can delete songs from your iTunes/computer hard drive after transferring them to the iPod, and for this you need to set your iPod to manage the songs manually.
    However, this is an extremely risky option because when (and not if) there comes a time to restore your iPod, which is a very common fix for iPod problems, then all the music would be erased. If you no longer have the music in iTunes (or any other back up), then all that music would be lost.
    What if the iPod were lost/stolen/needed repair? Again, the music would lost. I strongly recommend a back up, and if computer hard drive space is in short supply, you should seriously consider an external hard drive. They are not expensive, and the cost is well worth it when compared to the loss of all your precious music.
    At the very least back up your music to either cd or dvd before deleting it, particularly any purchased music/videos, as this would have to be bought again if it were lost. See this.
    Backing up your media in iTunes.

  • How can I tell what table(s) have the most transactions against them

    Hello, in Oracle 11.2.0.3, RHEL 6 x86-64, how can I tell what tables have the highest transaction activity?
    Picked "Objects" because I could not find a space related to performance tuning
    Humbly,

    What version of Oracle are you running (standard or enterprise)?
    Easist system is to run an AWR or statspack report. If you run either of these you will see sections on segments (so segments by logical reads, physical reads) which is easily digestible.
    v$segment_statistics will also give you a breakdown on segment access.

  • How can I make a table cell extend beyond the page?  The text disappears when the cell becomes larger than the page.

    How can I make a table cell extend beyond a page?  The text disappears when the cell becomes bigger than the page.  I want the table to continue to the next page.

    As a student, you might be able to get Office for Mac from the college bookstore at a substantial discount. Otherwise, I think your best option for documents that need to be shared with Office users is to get one of the free Office clones such as LibreOffice.

  • HT3354 how can i use one table for reference to another

    how can i use a table for a referance to another eg when i type a word in a cell, i will like it to match the word with another table then return the information in the cell i am using

    you can use vlookup() (or any of the lookup family of functions) to locate an item based on a key value:
    Here is an example of something you can do with two tables:
    The table on the right is title "Data" and stores a list of names with age and favorite color.
    The table on the left uses the value in the first column to lookup up information in the table Data
    in the table on the left:
    B2=IFERROR(A2&" is " & VLOOKUP(A2, Data :: A:D, 2, 0)&" years old and likes the color "& VLOOKUP(A2, Data :: A:D, 3, 0), "NOT FOUND")
    I know this look complicated.  so I'll break it up into smalled pieces:
    first the "&" is called the concatenate operator and joins two strings.  like this:
    a string is a set of characters between double quotes.
    so "string 1" & "string 2" becomes "string 1string2"  or "Sam " & "Jones" becomes "Sam Jones"
    you can use cell references instead of strings directly in which case the concatenation is performed on the contents of the cells.
    so if cell A1 contains "Hi " and the cell A2 contains "There"  then A1 & A2 will result in "Hi There"
    so you could add the formula
    A3=A1 & A2
    this is short hand for select cell A3 then type everything including the A3 so that A3 contains "=A1 & A2" (omit the double quote)
    OK.  So the formula I provided concatenates several items together:
    it concatenates A2, then the string " is " then a formula, then the string " years old and likes the color " then a formula
    the two formulas (highlighted in blue) perform a lookup of the value in cell A2 in columns A thru D of the table named "Data".  If if finds the value in cell A2 in the first column of the lookup range in the table Data (column A) then it returns the value from the same row but in the second or third column.
    all that is in a function calld iserror() to trap the condition where the calue you enter in A2 does not exist in the table Data:
    You will find the Numbers users guide and function reference helpful.  You can download then from Apple here:
    http://support.apple.com/manuals/#productivitysoftware

  • Re:How can we delete the concurrent node entry from the FND_NODE table

    HI ,
    11.5.10.2 on Oracle Solaris on SPARC (64-bit) .
    How can we delete the concurrent node entry from the FND_NODES table without running Autoconfig.
    Currently we are having 3 nodes RAC and we are deciding to remove one node from the RAC and all 3 nodes are registered as concurrent node with application but concurrent manager is running only on one node.
    Lot of the custom configuration we did it at application web tire level. If we run the Autoconfig at that time we need to redo those changes again that we are trying to avoid.
    Regards .

    we are trying to avoid to run FND_CLONE.setup_clean because it will delete all the nodes entries from the FND_NODES.If those entries are invalid then they should be deleted.
    Running AutoConfig after purging the table will populate it with the correct entries.
    In order to populate the nodes entries again we need to run autoconfig and it will change the server id in fnd_nodes and then we need to redo the ADI client configuration on users PC and redo all the changes that we made in jserv and webserver.For ADI Clients, you should use the correct server ids which will be populated in the table for you once you run AutoConfig.
    For jserv configuration, you can refer to (Customizing an AutoConfig Environment [ID 270519.1]) to make the preserve all your custom setup/configuration after running AutoConfig.
    If there any custom script to delete only one node from the fnd_node so that we don't need to run autoconfig after that, then I really appreciate.No.
    Thanks,
    Hussein

  • How can I filter a table from Data Control without enter query

    I have a table from a web service data control based on WSDL.
    I want to filter the table without input query at filter text box. Without filter text box, each would filter the table with a hardcoded query internally.
    For example, when user click A menu button then it filters the table where type = '1' and B menu button filters the table by type='2' and C menu button filters the table by type=' ' .
    How can I filter the table without enter query?
    Could anyone point me to a solution please.
    Thanks.
    jdev 11.1.5
    Edited by: 893364 on Oct 26, 2011 12:15 PM
    Edited by: 893364 on Oct 26, 2011 12:21 PM

    Hi,
    when you created the table, did you try selecting the "filter" option. Select the table and go to the Property Inspctor. In the tool bar of the Property Inspector there is an icon to change the configuration. Its adding filter filter fields for the user to search in.
    Option 2: The data of the Web Service actually is held in the iterators. If you wanted to filter the WebService query, I would not use the WS DC but a JAX-WS proxy in a POJO to fetch the WS Data. Then have the Data Control created from the POJO. You could have a method exposed on the POJO that allows you to filter the internally held data
    Frank

  • How can I insert a table in the header?

    The question is easy: How can I insert a table of one row in the header.
    Thanks in advance.
    Jesús.

    There are multiple versions of Pages in circulation on Mavericks and Yosemite. Telling us which one helps with a more accurate answer.
    If you are referring to Pages v5, then you cannot insert a table into the header or footer, because implicitly, these are table cells too. The discontinued Pages ’09 v4.3 would allow table insertion in the document header/footer fields.

  • How can I refer to the PhotoShop Object library dynamically depend on the release of PhotoShop?

    Recently, I make a program, now I face a big program:
    I make the program by visual basic and photoshop script , but my client have different release of Photoshop, for example : photoshop 7.0 cs and cs2. I know every release of PhotoShop have ist own Object library, but in visual basic 6.0, I can only refer to one PhotoShop Object library. for example: if I refer to Photoshop 8.0 Object library, if my clients release of Photoshop is 7.0. there will be a error message : Run-time error '429 ( cant create object) Run-time error '430(Class does not support Automation or does not support expected interface), How can I refer to the PhotoShop Object library dynamically depend on the release of PhotoShop?
    my email is : [email protected] .
    any suggestion?

    Please read, and reply back here with information https://forums.adobe.com/thread/1499014
    -and try some steps such as changing browsers and turning off your firewall for downloads

Maybe you are looking for

  • KVM for mixed DVI D-sub setup

    I can't find one of the KVM discussions I recall, but I don't think it addressed this. I would love to share a keyboard, mouse, and one or more monitors with my 3 PCs.  But the laptop and one PC are old (meaning D-sub video outputs), and the other is

  • Windows 7 loading hangs - Bootcamp

    Hi guys, i just got a i5 13" MBA 256Gb, LG dvdrw drive and windows 7 pro. problem is that after setting bootcamp parition, it restarts to setup mode, and it hangs at the loading bar, about 3 fingers long, it hangs forever. did anybody encounter this?

  • Help me in creating wizard

    hi. can anyone guide me , how to create a wizard in SBPT_WB . Please show step by step procedure. thanks & regards, arul.

  • Problem with downloading document from here!!!

    Hi, Anyone got the same situation.  I would like to download documents (pdf, power point,...)  from here.  Unfortunately, Files cannot be completed downloaded.  Consequently, they cannot be opened due to errors.  Anyone got the same situation or can

  • URGENT: hoe to know scenarios

    hi srm gurus,                  can anyone tell me where i have to find the business scenarios (classic ,extended) etc...in SRM 5.0 .is there any menupath for that pls tell me as soon as possible. with regards to all srini