Internal PLSQL Tables Access via SQL. But how ?

Hello,
I want to write the result of a database query in an internal PLSQL Table. After that i would like work with this internal PLSQL Table
in a Package/Procedure/Function.
Important for me is to access the internal Table via SQL because i have to refactor a package wich is working with 46 Database Tables an plain SQL. I
would like to change these DB Tables into internal PLSQL Tables.
I have written a short example wich will explain my approach to solving this problem.
The syntax will be accepted by the Database but my 'dbms_output.put_line' statement at the end is empty or blank.
What do i wrong ? Would be nice if anyone can help me out.
With best regards
Jens
pre work :
create table PERSON_DB_TABLE
(SURNAME  VARCHAR2(50),
LASTNAME VARCHAR2(50));
insert into PERSON_DB_TABLE values
('JENS','FOERSTER');
insert into PERSON_DB_TABLE values
('MAX','MEIER');
insert into PERSON_DB_TABLE values
('MARTHA','MUSTERMANN');
create type PERSON_OBJECT as object (
    SURNAME  VARCHAR2(50),
    LASTNAME VARCHAR2(50));
create type PERSON_NESTED_TABLE as table of PERSON_OBJECT;
now my anonymous block
declare
   v_PERSON_OBJECT        PERSON_OBJECT;
   v_PERSON_NESTED_TABLE  PERSON_NESTED_TABLE;
   v_PERSON_OBJECT_2      PERSON_OBJECT;
begin
   for v_counter in (select SURNAME, LASTNAME into v_PERSON_OBJECT.SURNAME,
                                                                                        v_PERSON_OBJECT.LASTNAME
                              from PERSON_DB_TABLE)
     loop
        v_PERSON_NESTED_TABLE := PERSON_NESTED_TABLE(v_PERSON_OBJECT);
     end loop;
   for v_counter in (select SURNAME, LASTNAME into v_PERSON_OBJECT_2.SURNAME,
                                                                                        v_PERSON_OBJECT_2.LASTNAME
                              from TABLE (v_PERSON_NESTED_TABLE))
     loop
        dbms_output.put_line(v_PERSON_OBJECT_2.LASTNAME);
     end loop; 
end;

1386a7b8-e834-43bf-a0d4-922b548bb70b wrote:
I need this, because my customer didn't like the idea to use Database Tables instead of Variables in the RAM. So he wants this procedure redesigned.
As Mike says, keep this person away from your database.
Customers should not be dictating how to implement technical solutions, they should be providing business and logical requirements.
PL/SQL arrays/collections use expensive PGA memory, taking up valuable server resources.
Copying data from the database to PGA memory to try and process it using PL/SQL is bad design.  SQL is designed specifically for data manipulation using database tables, so it's the ideal way to do process data... directly on database tables.

Similar Messages

  • Tables created via SQL...

    There is a way to show information stored in a table creadted via SQL in the SBO Print Forms ?

    Hello!
    yes, this will work as such, but might not give you the
    correct values as there is no link between the table and the layout! Usually, it pulls simply the first value in the table.
    Or, you might be lucky that it works now, but not after an upgrade.
    Be careful when adding field with "ALT", if you encounter problems at any stage, you will not receive any support!
    When adding fields via "ALT", check if you can create manual links between the table and the layout via "next segment" and "link to".
    Kind regards

  • HT201269 I have successfully sync'd my macbook and new ipad via itunes, but how do I sync the calendar, please ? I do not have icloud yet.

    I have successfully sync'd my macbook and new ipad via itunes, but how do I sync the calendar, please ? I do not have icloud yet.

    You can select the calendar to sync in the Info Tab in the iTunes window on the right, when your iPad is connected to the Mac , while iTunes is running and after you select the iPad on the left side under the devices heading.
    read for more information.
    http://support.apple.com/kb/HT1296

  • Labview bitmaps to Access via SQL

    I am trying to write a bmp file that is created into labview into an access
    database via SQL. The user must be able to browse the database in access and
    view the bitmap image as part of the form. So far I am able to extract the
    bitmap, view it in labview, and save the file using the picture toolkit
    Vi's. If I create a longbinary table in access (OLE Object) I can write some
    binary data to the table but I can't view. Anyone have any ideas how I could
    accomplich this? Any help would be greatly appreciated.
    Thanks
    Kevin

    check...
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/05058e8d-0c01-0010-c986-fdc8eaebf37c

  • DB Link - works via SQL but not via packages

    I have a database link on user ODB on database A, to database B. The DB Link seems fine for SQLs that i do, but doesn't compile in my package code. Please tell me why it works for "regular sqls" but not inside a package.
    Example: while connected as ODB user on database A, if I do this query:
    SELECT "TRAXDOC_DETAIL"."FILE_NAME",
    "TRAXDOC_DETAIL"."FILE_TYPE",
    FROM "TRAXDOC_DETAIL"@TRAXDOC_LINK
    WHERE "TRAXDOC_DETAIL"."TRAXDOC_ROW_ID" = 100031 AND
    "TRAXDOC_DETAIL"."TRAXDOC_LINE"= 2
    It works fine. But the same query inside a package that is owned by user ODB on database A will not compile, stating the table/view does not exist.
    The database link is owned by use ODB on database A, connects directly to the owner of the tables in question on database B.
    Any suggestions welcome... this is an urgent issue, because it also worked fine on my customer's test environment, but not on their Production that they just upgraded. I need to know what to look for as to what could be wrong.

    Thanks so much for your response - Prefixing the call to the table within the package, with the schema owner does indeed solve the problem. Since this is a Production issue, i have implemented this fix in my customer's database.
    However, I would still like this issue permanently resolved. The next time we send out updated package code, this will happen again (unless we then fix it again). I'd still like info from anyone on what exactly must be done to allow the call within the package to work without specifically pre-fixing the table's schema owner. It shouldn't be needed... The DB link is connecting via the same schema on database B that owns the table in question.
    pre-fixing the schema owner is something we don't do in our sql statements, and this has worked fine for many of our cusomer's environments. We're only seeing this issue on one environment.

  • Can do via SQL but not via PL/SQL

    is it possible that a simple; 'create global temporary table..' SQL can run, yet same code being called from an 'execute immediate' within a PL/SQL block throw an; ORA-01031: insufficient privileges exception...(same user)
    is it a role/privilege issue or do I need to de a better job debugging?

    short version, each user will pass unique values to the proc that via dynamic sql will build these tables based on that iterative select criteria, to be used only during their current working session.
    so it's not the 'same' table in structure each time
    would not having 'TEMP grantable' be the issue?
    trying to find a way to communicate this to the DBA

  • MS Access querying SQL Server: How to configure Network ACL?

    I need to set up a highly restrictive ACL for access to a particular SQL server in our network.  This ACL will reside on our core switch at the "front door" of our network and permit access to the SQL server only using the ports that
    are necessary.  The purpose is to A) Try to keep unauthorized users from gaining access to the host server and B) Should someone somehow gain unauthorized access to the host server. keep them from being able to "hop off" to other PC's on
    the network. 
    The server will be accessed by clients using MS Access to query the SQL database and bring back reports.  A few admins are actually able to make minor changes to the database such as updating a user list or location list. In other words, both
    read and write access is needed to the SQL database.
    I know that the default SQL server port is 1433, but according to a Microsoft Support article I read, "client ports are assigned a random value between 1024 and 5000".
    I was really hoping I could just put something like "permit PC1 access to SQL Server on Port 1433" in my ACL, but after reading the MS Support article it sounds like I've got to allow almost 4,000 ports through?
    Could someone help demystify this for me so I can build the right ACL?

    The tool to use is SQL Server Configuration Management.
    But what you can configure is which port SQL Server listens to. Which port the client listens to is not controllable as far as I know. But that can of course be many, since a client can have many connections to SQL Server. (And the range is not
    restricted to 1024-5000. I connected over TCP locally, and I see this with netstat -a
      TCP    127.0.0.1:6621         NATSUMORI:ms-sql-s     ESTABLISHED
    Then again, I don't see why you would have to open any ports for the clients at all. I have never heard of this being a problem.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • After I right-clicked on an unwanted email in Microsoft Web Access and put a filter on it all my emails and the menus disappeared. I can re-access in IE but how do I restore what I have foolishly done in Firefox?

    I was working through my emails in Microsoft Web Access when I came across an email from a sender who keeps spamming me. I right-clicked on this unwanted email, saw a filter option and (recklessly) chose it. ALL my emails and the menus disappeared. I can re-access my emails in MWA in IE but how do I restore what I have foolishly messed up in Firefox? When I get to my email page in MWA in Firefox I now see nothing but the movable vertical bar.

    You should really read the manual.
    "How do you restore from backup? "
    Restore.  When given the choice, choose to use backup.
    "And how can I check to see if the pics and videos are on my computer somewhere first??"
    They would only be where you put them.  What program did you use to import them?  Pics/vids taken with ipod are not part of the sync process at all.  You should be importing them just as you would with any digital camera.
    If you did not import them, then they are not on your computer.

  • Abap-table access via JDBC

    Hello,
    we have a java-program, that accesses data via jdbc to a mysql-database.
    Now we want to migrate the mysql-table to abap-table.
    How can we access from the  java-program to theese migrated abap-tables via jdbc?
    Regards Oliver

    Oliver,
    If you want to access those tables from SAP, then you have to use the Java Connectors (
    JCO).
    Please write the more details abount the java IDE and OS, which you are using I will send you appropriate help.
    Thanks

  • Direct Access is working but how do I configure it for remote services, client management software, etc..

    Good morning/afternoon/evening TechNet,
    I've finally gotten a DA client connected to the corporate network utilizing an external network. I'm having a couple issues, one, not being able to ping the server from a computer that's on the same domain(I'm able to ping the DA client from the DA server).
    I'm not sure if there is a firewall setting that needs to be open on the client for incoming echo requests? Second, we use a client management system called BMC and I would like the direct access server to be able to utilize the BMC server so that I can manage
    the DA client whenever its on the network. I noticed on the DA server that "Step 3" offers an area where it allows you to add servers that will be used for direct access client management. Would I just need to populate the server in here and then
    open appropriate firewall rules so that the DA server has access to them? Lastly, Trying to "mstsc" into the DA client what would I need to open up on both sides so that I'm able to do this?
    Sorry about the horrible grammar but I've been up 24+ hours getting this awesome but pain in the butt Direct Access feature working.
    Thank you as always!
    -Liqsh0t

    I'm afraid it's a bit more complicated than adding a server into the list in Step 3 :)
    When a DirectAccess client is connecting into a corporate network that is IPv4 (I assume yours is, most are), it can reach into your IPv4 servers because the DA server is doing NAT64/DNS64 translations, turning all of your DirectAccess IPv6 packets into
    IPv4 packets before they head inside the network. But even though this happens in the background without you really knowing about it, the key thing there is that all DirectAccess traffic is IPv6. This means the clients can only be contacted via IPv6. If you
    have IPv6 inside your network, then you can route outbound fairly easily to your DA client computers. If you are all IPv4 inside as most companies are, then you have to either roll IPv6 out inside your network, at least partially, or you have to utilize ISATAP
    inside your network in order to create a sort of "virtual IPv6 cloud" that runs on top of your IPv4 internal network. This enables your internal management systems (like the BMC servers and helpdesk computers for RDP access outbound) to have a connection
    into the IPv6 world, which then enables them some routing capability to get out to the IPv6-connected DA clients. In addition to this IPv6 or ISATAP setup, you also need to configure WFAS rules on the DA clients so that they will allow this traffic.
    There is some info on setting up ISATAP here: http://blogs.technet.com/b/jasonjones/archive/2013/04/19/limiting-isatap-services-to-directaccess-manage-out-clients.aspx
    Otherwise one of the chapters in this book is also dedicated to the setup of a selective ISATAP environment, to be used for the purposes of DirectAccess outward management: https://www.packtpub.com/virtualization-and-cloud/microsoft-directaccess-best-practices-and-troubleshooting

  • App malfunctions when accessed via URL but not when accessed in workspace

    I have an application that I have built at work. I have it on a test box. I have been using the app for several months with no problem. Because it is on the test box I am able to use the url to log into the app e.g. http://infotest.finone.bankone.net:7777/pls/htmldb/f?p=229
    Today I started having problems with the app not functioning properly for no apparent reason. A file browse upload process stopped uploading the files even though I got no error messages. Editable items stopped passing values to the next page when I click to edit something.
    The weird thing is when I log into my workspace on the test box and then launch the app from there everything works perfectly as before! I went in an deleted and purged all the sessions and then logged into the app via the url again and it worked for a minute then I had problems creep back up.
    This app is supposed to move to the production server soon. Any ideas why this weirdness is happening??!!

    Hi,
    As far as the file upload process...nothing happens and nothing appears in the Web Server Error Log at least not from what I see perhaps I am not looking in the right place. It's like as if the process just didn't actually activate or something although the page does in fact submit because the field values are cleared and the success message I coded in appears. So I know the page is submitted.
    The values being passed were actually part of the Wizard Form/Report on a Table. You click the Edit icon and it passes the value of the PK field to the subsequent field on the next page within the same session ID and fetches the appropriate row from the underlying table.
    So far not a single other person has had this happen to them. Today the app worked perfectly without any of these issues. Can there be local settings on my PC that are conflicting with the session state and other things on the Application? I log in and out of the app close to a 100 times a day, could this be clogging up session id's or something?
    Unfortunately its not consistently reproducible from the standpoint that today its not doing it all but when it was happening yesterday it certainly was consistent so at this point I don't know what to think.

  • Proxy users  - oracle 9.2  - accessing via sql plus

    I may be totally off track here, but here is what I want
    to do.
    I have 2 schema's (schema A and schema B).
    schema A has multiple objects (tables) within it.
    I want to allow another user, schema B to access these objects. Can I use the Proxy User settings to do this? By going in and allowing Schema B to proxy for this user (shcema a). "ALTER user schemaA GRANT CONNECT THROUGH schemaB"
    I try this and then go into sqlplus and log in as
    schemaB, but I can't see any of schemaA's objects.
    Am I missing somthing here?
    In the past I have always assigned the proper grants to a role and assinged them to schema B as needed which works fine. However, it seemed to me if the proxy user worked the way I thought it would you could do things for an entire schema at one time instead of object by object using the grants.
    Thanks
    John

    The command "oemapp.bat" does not yield any output at the command line. Here comes a session log:
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    D:\oracle\ora92\bin>oemapp.bat
    D:\oracle\ora92\bin>sqlplusw
    Zugriff verweigert (= access denied)
    D:\oracle\ora92\bin>dir oem*
    Volume in Laufwerk D: hat keine Bezeichnung.
    Volumeseriennummer: A0D5-BD0B
    Verzeichnis von D:\oracle\ora92\bin
    17.10.2006 11:15 4.971 oemapp.bat
    26.04.2002 16:29 24.848 oemautil.exe
    26.04.2002 16:29 20.752 oemevent.exe
    3 Datei(en), 50.571 Bytes
    0 Verzeichnis(se), 18.221.547.520 Bytes frei
    D:\oracle\ora92\bin>dir sqlplus*
    Volume in Laufwerk D: hat keine Bezeichnung.
    Volumeseriennummer: A0D5-BD0B
    Verzeichnis von D:\oracle\ora92\bin
    27.04.2002 00:07 459.024 sqlplus.exe
    26.04.2002 23:58 700.416 sqlplusw.exe
    2 Datei(en), 1.159.440 Bytes
    0 Verzeichnis(se), 18.221.547.520 Bytes frei
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    I'm glad about your immediate response!
    Message was edited by:
    user542934

  • Doubt Regarding Table Accessed via DB Link

    I have the following SQL:
    select * from tab1@db_link tab1, tab2
    where tab1.col1=tab2.col2
    and tab1.col2=99;
    Can I ensure that Oracle brings data corresponding to:
    select * from tab1@db_link tab1
    where tab1=99;
    and then joins the data with tab2.
    What could be fastest way to access data in this manner? Basically i need to tune a similar query.

    No not much difference. On both the cases oracle goes for the same plan. Here is a small test case
    select t.*
      from t@to_inlabnew t, t1
    where t.object_id = t1.object_id
       and t.object_type = 'TABLE'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.03       0.16          0          0          1           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch      171      1.09       1.68          0          6          0        2544
    total      173      1.12       1.84          0          6          1        2544
    Rows     Execution Plan
          0  SELECT STATEMENT   GOAL: ALL_ROWS
       2544   HASH JOIN
       1000    INDEX   GOAL: ANALYZED (FAST FULL SCAN) OF 'T1_IDX' (INDEX)
    199792    REMOTE OF 'T' (REMOTE)
                   [TO_INLABNEW.REGRESS.RDBMS.DEV.US.ORACLE.COM]
                  SELECT "OWNER","OBJECT_NAME","SUBOBJECT_NAME","OBJECT_ID",
                  "DATA_OBJECT_ID","OBJECT_TYPE","CREATED","LAST_DDL_TIME",
                  "TIMESTAMP","STATUS","TEMPORARY","GENERATED","SECONDARY" FROM
                    "T" "T" WHERE "OBJECT_TYPE"='TABLE'
    select t.*
      from (select * from t@to_inlabnew where object_type = 'TABLE') t, t1
    where t.object_id = t1.object_id
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch      171      1.09       1.46          0          6          0        2544
    total      173      1.09       1.46          0          6          0        2544
    Rows     Execution Plan
          0  SELECT STATEMENT   GOAL: ALL_ROWS
       2544   HASH JOIN
       1000    INDEX   GOAL: ANALYZED (FAST FULL SCAN) OF 'T1_IDX' (INDEX)
    199792    REMOTE OF 'T' (REMOTE)
                   [TO_INLABNEW.REGRESS.RDBMS.DEV.US.ORACLE.COM]
                  SELECT "OWNER","OBJECT_NAME","SUBOBJECT_NAME","OBJECT_ID",
                  "DATA_OBJECT_ID","OBJECT_TYPE","CREATED","LAST_DDL_TIME",
                  "TIMESTAMP","STATUS","TEMPORARY","GENERATED","SECONDARY" FROM
                    "T" "T" WHERE "OBJECT_TYPE"='TABLE'

  • BSP - 500 Internal Server Error  Access via 'NULL' object reference not possible.

    Hello Colleagues, I'm new to BSP maybe someone could help me.
    I’m taking data from a DB table through select an put them into htmlb tables. 
    The layout looks like:
    &lt;htmlb:tableViewColumn columnName="PK_Terms"
    <%--wrapping="true"--%>
    width="50"
    horizontalAlignment = "center"
    verticalAlignment = "middle"
    fixedColumn="true">
    &lt;/htmlb:tableViewColumn>
    After I select the vendor (first table), another table appears with additional Info (see screenshot). I've set the the visible row count to 10 and the data appears without errors, but when I click the next page button or type  page number to see the next 10 rows, following error message appears:
    The ABAP call hierarchy was:
    Method: _ONINPUTPROCESSING of program CL_O2DH4AGZFD1H3VPXDQ9541G8559CP
    Method: %_ONINPUTPROCESSING of program CL_O2DH4AGZFD1H3VPXDQ9541G8559CP
    Method: DO_REQUEST of program CL_BSP_PAGE===================CP
    Method: ON_REQUEST of program CL_BSP_RUNTIME================CP
    Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_HTTP_EXT_BSP===============CP
    Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
    Function: HTTP_DISPATCH_REQUEST of program SAPLHTTP_RUNTIME
    Module: %_HTTP_START of program SAPMHTTP
    My select statement:
    if tv_data->row_key is not initial.
    select ekko~lifnr ekko~ekorg as po ekpo~netwr as netwr ekko~bukrs as cc
    ekpo~ebeln    from ekpo join ekko on ekpo~ebeln eq ekko~ebeln
    into corresponding fields of table lt_ek1
    where lifnr eq tv_data->row_key.
    Whats wrong ?

    Hi Pramod,
    we have already checked and maintain also.
    but no use.
    and this user moved to QUA and maintain Personnel number also it is working well in QUA.
    but it is not working in PRD. it is having all authorizations also.
    once we deleted user in PRD and then created in PRD assign all roles but no use.
    we got same error in particular USER only.
    and clear the cache in portal side and browser side also there is no use.
    and PMS documentation update it.but no use.
    what is missing authorization to particular user and how to solve this issue please suggest us.
    regards
    nagendra

  • You can run Win XP in OSX via Parallels, but how do you run OSX in XP?

    Hey, I have a week old MBP that I've boot camped to run a stripped down version of XP for gaming. I got Parallels so that I could, if I wanted, game while keeping OSX native, but with no DX9 support (and awful DX compatibility in general) it's totally useless to me.
    SO, I thought, why not try to virtualize OSX within XP. I'd want to keep the memory/processor dedications as light as possible, as I'd just be using the virtualized OSX to access iTunes and keep various torrents seeding.
    Any progs you know of?
    Alternately, is there an easy way to get access to the iTunes collection on the OSX partition from within XP?
    Thanks for your help in advance

    Hi 12orphans;
    There is an iTunes for XP. As to whether or not it can access the iTunes library on a Mac I don't know. I try to have as little to do with anything Windozes as I can.
    Allan

Maybe you are looking for