What is the column name when use select ... from table(my_table)

I have some code that takes a csv and loads it into a type table. I am now trying to select from this table but am not sure what column name to use in my cursor. (See below I have c2.???).
FUNCTION in_list_varchar2 (p_in_list IN VARCHAR2) RETURN VARCHAR2_TT is
l_tab VARCHAR2_TT := VARCHAR2_TT();
l_text VARCHAR2(32767) := p_in_list || ',';
l_idx NUMBER;
BEGIN
LOOP l_idx := INSTR(l_text, ',');
EXIT WHEN NVL(l_idx, 0) = 0;
l_tab.extend;
l_tab(l_tab.last) := TRIM(SUBSTR(l_text, 1, l_idx - 1));
l_text := SUBSTR(l_text, l_idx + 1);
END LOOP;
RETURN l_tab;
END in_list_varchar2;
schema_list := 'SCOTT, TOM, MIKE';
schema_names := regexp_replace(schema_list, '([^,]+)', '''\1''');
schema_list_t := DATAPUMP_UTIL.in_list_varchar2(schema_list);
for c2 in
select *from table(schema_list_t)   
loop
dml_str := 'DROP USER ' || c2.??? || 'CASADE';
EXECUTE IMMEDIATE dml_str;
end loop;

Chris wrote:
I have some code that takes a csv and loads it into a type table. I am now trying to select from this table but am not sure what column name to use in my cursor. (See below I have c2.???).
FUNCTION in_list_varchar2 (p_in_list IN VARCHAR2) RETURN VARCHAR2_TT is
l_tab VARCHAR2_TT := VARCHAR2_TT();
l_text VARCHAR2(32767) := p_in_list || ',';
l_idx NUMBER;
BEGIN
LOOP l_idx := INSTR(l_text, ',');
EXIT WHEN NVL(l_idx, 0) = 0;
l_tab.extend;
l_tab(l_tab.last) := TRIM(SUBSTR(l_text, 1, l_idx - 1));
l_text := SUBSTR(l_text, l_idx + 1);
END LOOP;
RETURN l_tab;
END in_list_varchar2;
schema_list := 'SCOTT, TOM, MIKE';
schema_names := regexp_replace(schema_list, '([^,]+)', '''\1''');
schema_list_t := DATAPUMP_UTIL.in_list_varchar2(schema_list);
for c2 in
select *from table(schema_list_t)   
loop
dml_str := 'DROP USER ' || c2.??? || 'CASADE';
EXECUTE IMMEDIATE dml_str;
end loop;
I have some code that takes a csv and loads it into a type table.Why a type table? Where is type table defined as such?
with PL/SQL, objects must be declared before they can be referenced.
You need to correct syntax errors before tackling any runtime/logic flaws.

Similar Messages

  • 6.1 What is the Domain Name when using LDAP

    Hi,
    We are currently installing Tidal 6.1, we are going to integrate Oracle Directory Server for LDAP (not AD).
    Qustion is, what is the domain name we have to provide when we install?
    Master and CM both on Linux.
    Thanks!

    Do you know any document which shows LDAP compatibility?
    I havent seen on Intsallation Guide.
    Problem is, when I install, linux servers are on different network (domain) but LDAP contains different domain details. Wondering how Tidal check the domain details when authenticating.
    When we give LDAP domain details, it gives following error.
    WARN:  javax.security.auth.login.LoginException: [LDAP: error code 49 - Invalid Credentials]
    Anyone know how to increase log level to debug?
    Thanks!

  • HT1688 what is the HDR option when using the camera?

    What is the HDR option when using the camera and why is it important to me?

    The User Guide is available at http://support.apple.com/manuals/ or downloadable from iTunes as an iBook.

  • How to update zero to a column value when record does not exist in table but should display the column value when it exists in table?

    Hello Everyone,
    How to update zero to a column value when record does not exist in table  but should display the column value when it exists in table
    Regards
    Regards Gautam S

    As per my understanding...
    You Would like to see this 
    Code:
    SELECT COALESCE(Salary,0) from Employee;
    Regards
    Shivaprasad S
    Please mark as answer if helpful
    Shiv

  • How to change the column name as bold in adf table

    Hi,
    How can I change the column name with bolder style and blue colour in adf Table?
    I changed the color and font weight in af:column properties, but its effecting the data in that column but not with the column Header Text property.(i have given column name in header text).
    can any one have any idea how to do this?
    and I have taken panel tabbed layout and in that i'm displaying this table.
    but this table has scroll beneath of it to show all columns.
    but i want to display all columns (for this, page should have scroll at the bottom side).
    how can I achieve this???

    Hi,
    Add the following CSS Code to the custom skin css file that is to be created as per the suggestions above.
    *af|column::column-header-cell{*
    color:Blue;
    font-weight:bold;
    This would ensure that all the table column headers are blue in color and bolder font style through-out the application.
    By the way, what version of JDeveloper are you using?
    Thanks,
    Navaneeth

  • Script task to read the column names dynamically and create a table in database based on excel column structure

    Hello,
    Can anyone help me out to write a vb.net script.
    I need to read the column names from excel and based on that column names I need to create a table in database(I have more than one sheet in excel).
    For each sheet columns will be changing and should create a table dynamically for each sheet.
    Any help would be appreciated.

    Refer the below script to read columns in each sheet.
    Dim excelfile As String = Dts.Variables("ExcelPath").Value.ToString
    Dim connectionstring As String = "Provider=Microsoft.Jet.OLEDB.4.0;" +
    "Data Source=" + excelfile + ";Extended Properties=Excel 8.0"
    Dim oledbcon As New OleDb.OleDbConnection(connectionstring)
    oledbcon.Open()
    Dim dt As DataTable
    Dim schemaTable As DataTable
    Dim OLEDBCMD As New OleDb.OleDbCommand
    Dim oledbdatareader As OleDb.OleDbDataReader
    Dim columns As String = ""
    dt = oledbcon.GetSchema("Tables")
    Dim TABCOMMAND(20) As String
    Dim TABCOUNT As Integer = 0
    For Each row As DataRow In dt.Rows
    TABCOMMAND(TABCOUNT) = "SELECT * FROM [" & row.Item("TABLE_NAME").ToString & "]"
    OLEDBCMD.CommandText = TABCOMMAND(TABCOUNT)
    OLEDBCMD.Connection = oledbcon
    oledbdatareader = OLEDBCMD.ExecuteReader(CommandBehavior.KeyInfo)
    schemaTable = oledbdatareader.GetSchemaTable()
    For Each myfield As DataRow In schemaTable.Rows
    For Each myproperty As DataColumn In schemaTable.Columns
    If myproperty.ColumnName = "ColumnName" Then
    columns = columns & myfield(myproperty).ToString & ","
    MsgBox(myfield(myproperty).ToString)
    End If
    Next
    Next
    oledbdatareader.Close()
    OLEDBCMD.Dispose()
    Next
    oledbcon.Close()
    Regards, RSingh

  • Special Grant to use "Select * from Table(cast..."??

    Hi,
    I've recently created the types and function to use the Table(Cast(funtion) as type)). It works fine, and gives me the correct result. I've granted execute on the types and on the function to a role that is enabled for a user, but when the user tries to use the "select * from table(cast(function) as type))", he gets a "ORA-01031: Insufficient Privileges" error message. Is there any other grant that must be given to the role, so that the user can execute the select?
    Thanks in advance!
    Daniel

    Hi Kamal,
    I'm not sure what anonymous PL/SQL block means. When I (or the user) try to run the select, I enter all the information, i.e., the owners for the type and function: "select * from table(cast(a.my_function(my_argument) as a.my_type))". I'm trying to use SQLPlus at this time, and I have Oracle 8i.
    I didn't to explicitly grant execute to the user because that would go against some rules I have to follow... I'll se if I give it a try though!
    Thanks!

  • Not getting the Document name when using CSWB

    happy New Year all!
    Am using SP Online.
    I have inserted the Content Search Web Part on a subsite to pull documents from a main list located on the parent site.
    It works ok but the result I am getting is the first line inside the document, so all I get a 10 identical results.
    team meeting
    team meeting
    team meeting
    How can I get the actual document name?
    Thank you
    Pierre
    pgg02

    Hello Sekar,
    I think I figured out the problem but still is strange.  Am trying things but SharePoint Online is extremely slow.
    When I created the library list, I only created 2 columns, one called "Name" the other "Tower", other columns got in like  automatically and are created by:, modified by, modified date.
    I went to edit one of the documents, and that's when I saw a field called "title" which does not appear See below:
    Columns
    A column stores information about each document in the document library. The following columns are currently available in this document library:
    Column (click to edit)
    Type
    Required
    Title
    Single line of text
    Tower
    Choice
    Created
    Date and Time
    Modified
    Date and Time
    Created By
    Person or Group
    Modified By
    Person or Group
    Checked Out To   
    Person or Group
    but in the column ordering screen see
    Field Order    
    Choose the order of the fields by selecting a number for each field under "Position from Top".
    Field Name  
    Position from Top   
    <input name="numSelects" type="hidden" value="3" />
    Name
    <select name="FormPosition0" title="Name: Position from Top"><option selected="selected" value="FileLeafRef">1</option>   <option value="FileLeafRef">2</option>   <option value="FileLeafRef">3</option>         
    </select>
    Title
    <select name="FormPosition1" title="Title: Position from Top"><option value="Title">1</option>   <option selected="selected" value="Title">2</option>   <option value="Title">3</option>         
    </select>
    Tower
    <select name="FormPosition2" title="Tower: Position from Top"><option value="Tower">1</option>   <option value="Tower">2</option>   <option selected="selected" value="Tower">3</option>         
    </select>
     A field called "Name" mysteriously appeared.
    The text in the "Name" fields was the same for all items so that explains why I was getting 10 times the same result.
    I went back to my list and copied the unique file name (library of word documents) into the "Name" field. But now when I am finally able to try the query I get the same results as before.?!
    here is the KQL
    path:"https://proposalforcondo.sharepoint.com"  (FileExtension:doc OR FileExtension:docx OR FileExtension:xls OR FileExtension:xlsx OR FileExtension:ppt OR FileExtension:pptx OR FileExtension:pdf) (IsDocument:"True"
    OR contentclass:"STS_ListItem")
    The result I get is:
    RelevantResults                       
                    (8)           
                        Home.aspx               
                            proposalforcondo.sharepoint.com/Home.aspx.docx                   
                        CARLETON CONDOMINIUM CORPORATION NO. 12               
                            proposalforcondo.sharepoint.com/C12_MINUTES_Oct 28...                   
                        CARLETON CONDOMINIUM CORPORATION NO. 12               
                            proposalforcondo.sharepoint.com/C12_MINUTES_July4_...                   
                        CARLETON CONDOMINIUM CORPORATION NO. 12               
                            proposalforcondo.sharepoint.com/C12_MINUTES_Septem...                   
                        CARLETON CONDOMINIUM CORPORATION NO. 12               
                            proposalforcondo.sharepoint.com/C12_MINUTES_July31...                   
                        CARLETON CONDOMINIUM CORPORATION NO. 12               
                            proposalforcondo.sharepoint.com/C12_MINUTES_June17...                   
                        CARLETON CONDOMINIUM CORPORATION NO. 12               
                            proposalforcondo.sharepoint.com/C12 - MINS_June 25...                   
                        CARLETON CONDOMINIUM CORPORATION NO. 12               
                            proposalforcondo.sharepoint.com/C12 - MINS_June11_...
    Any suggestion?
    Thanks again
    Pierre
    pgg02

  • How can I adjust the file names when using the "export layers to files" Script in photoshop?

    Currently the standard set up adds "_0000s_0001_" in front of the layer names that I need the new files to use. I'm processing hundreds of images so I'd like to avoid selecting and deleting the extra characters one by one. Any way to automate this or set it correctly before exporting?

    http://forums.adobe.com/thread/688851?tstart=0

  • HT1430 What is the output power,      when using a portable batteries that the iPad need to charge up??

    What is the output power needed to charge a iPad,  when using a portable battery?
    Will 2.1A output work?
    Thanks

    The wall charger which comes with the ipad is a 10 watt charger, it's current is 2A, voltage is 5v. 2x5=10 w.
    2.1Ax5v = 10.5w.

  • How can you keep the file name when using "Download Linked File As..."?

    I'm a longtime PC user finally making the transition to Mac.  Some of the tasks that seemed so simple in Windows have really stumped me!  One of the tasks I do frequently is download files into specific folders.  After much looking, I finally found the "Download Linked File As..." option if I right-click on the download link.  The problem is, when I choose this option, I lose the file name.  I get a window in which I can choose the desired folder, but the filename is always "0".  If I want to keep the filename (and I usually do), I have to type it in manually.  Is there anyway around this?

    You can post a screen shot by clicking on the liitle Camera icon above your reply.  :)
    Just checked on 10.7.4+, still the same, something is borked about your install, to see if we need to re-install...
    To find out if it's system wide or user specific, try this...
    Open System Preferences>Accounts, unlock the lock, click on the little plus icon, make a new admin account, log out & into the new account.
    Does it work in the new account?

  • What is the application name when CMS connects to SQL server 2005

    Hi, We are BOXI R2 SP3. We have 3 servers with CMS installed on each. We have 3 separate web servers. When I monitor sessions in SQL server 2005 then I see 6 process. 2 process are from each processing servers but the application name for 2 servers ( 4 processes) are WIndows Installer-unicode and for third server its Business Objects Enterprise.
    I think all the env should be same in a cluster so not sure how to correct this issue.
    Thanks,

    No Answer so closing this topic.

  • What are the performance tradeoffs when using more than one EntityStore?

    Hi,
    I have different accounts where each account has the same set of Entity classes. I don't know yet wheter to have one EntityStore for each account or have one EntityStore for all accounts together and do a lot of 'joining' when retrieving Entities.
    This is a very similar use case as with the FAQ http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#37 . The only difference is that I want to use DTP.
    It would be great if you could answer me the following questions:
    1.) Do basicly the same answers as in the FAQ apply to EntityStores?
    2.) How expensive is an EntityStore (memory, speed - creating and releasing)?
    3.) What would you recommend? I have to do a lot of secondary-index lookups which are restricted to one account. There are about 10 Entity classes and about 1000 accounts.
    Thanks,
    Christian

    Hello,
    It would be great if you could answer me the
    following questions:
    1.) Do basicly the same answers as in the FAQ apply
    to EntityStores?Yes, they apply.
    2.) How expensive is an EntityStore (memory, speed -
    creating and releasing)?For each store, there is an underlying Database per entity class and per secondary key. And for each store there is a catalog database which is also kept in memory.
    3.) What would you recommend? I have to do a lot of
    secondary-index lookups which are restricted to one
    account. There are about 10 Entity classes and about
    1000 accounts. I recommend using a single store for best performance and resource utilization.
    Mark

  • What do the column names represent?

    In wiew v$flashback_database_stat, there are some columns such as BEGIN_TIM, END_TIM, FLASH_DATA, DB_DATA, REDO_DATA. What do they represent?----No.159
    Message was edited by:
    frank.qian

    From the Reference Guide
    http://download-east.oracle.com/docs/cd/B14117_01/server.101/b10755/dynviews_1089.htm#sthref3128
    BEGIN_TIME DATE Beginning of the time interval
    END_TIME DATE End of the time interval
    FLASHBACK_DATA NUMBER Number of bytes of flashback data written during the interval
    DB_DATA NUMBER Number of bytes of database data read and written during the interval
    REDO_DATA NUMBER Number of bytes of redo data written during the interval
    ESTIMATED_FLASHBACK_SIZE NUMBER Value of ESTIMATED_FLASHBACK_SIZE in V$FLASHBACK_DATABASE_LOG at the end of the time interval

  • What are the correct setting when using a canon t4i in sequence ?

    im new to adobe premiere and i've been using sony vegas. If you can help me please comment. Thank you

    If you are on the trial version (assuming this is CC7) drag a clip from the Project window into the New Item Icon (lower right bottom of the window)
    That will give you a matching sequence for your clips.
    Start here:
    How to create a video story with Premiere Pro | Adobe Premiere Pro CC tutorials

Maybe you are looking for

  • Itunes movie hire download stuck processing

    I have downloaded a rented movie from iTunes on my iPad2 and it now seems stuck 'processing' - any ideas other than wait?

  • White screen of death after installing Macfuse

    I had a well running MacPro hexa 3.2 (upgraded from a quad 2.6G hz) under ML and since I needed to backup some files from an ext3 drive I looked up how to mount them. The proposed solution was to install both OSXFuse and Fuse-ext2, which I did. I cou

  • Where are my old pictures on iphoto?

    I frequently import my pictures to iphoto as backup, but today when i tried to look at my pictures from few months ago i cannot seem to find them on iphoto, i can only see the most recent imports, just a month worth of photos.

  • Expresscard/34 Esta Adapters Crash OS X -- long-standing issue.

    Hi everyone, I have a MacBook Pro (17-inch Early 2008) that has exhibited this issue from the onset of using an Expresscard/34 esata adapter: Upon inserting the Esata adapter, I will get a Kernel Panic (the one whree I get multiple languages saying I

  • Can I use my iPod apps with a MacBook?

    I'm in college and am trying to decide if I want to use an iPad or one of the MacBooks. I guess one of the big questions is can I use my existing iPod apps with the MacBooks or do I have to make separate purchases again for them? I also want to recor