2 running, 1 inside and 1 sql external, dynamic queries using loops and ref Cursor

Hi all

I'm under Oracle 10.2.0.2. I'm currently building dynamic sql using external and internal queries ref Cursor. Queries make use of user selected lists of ID, which is stored in a table in memory at run time. My example is as follows. From a list of book_publication_id on a web page, the user selects several books. The same user selects then several maps from a list of map_publication_id on the same web page. A book contains several maps and some of these cards will appear in more than one book (aka many many relationships).

This should then ask the following output to a new web page:
Outer loop:  Display book details for book_publication_id 230
  Inner loop:  Display 1st map details for map_publication_id 340
  Inner loop:  Display 2nd map details for map_publication_id 346
  Inner loop:  Display 3rd map details for map_publication_id 350
Outer loop:  Display book details for book_publication_id 240
  Inner loop:  Display 1st map details for map_publication_id 346
  Inner loop:  Display 2nd map details for map_publication_id 375
Outer loop:  Display book details for id 255
and so on.
In the example above, the outer loop displays the details of the book for book_publication_id 230 and the inner loop displays all the users selected the maps in book_publication_id 230. Then, it moves on the details of the book for book_publication_id 240 and done the same thing again. Similar in some ways to how break would work in SQL * Plus, even if the table is built like an HTML, the book details must be on a separate line for the card details. However I don't know how I would want it to work.

So far, using loops, I could not show all the details of card for each different book_publication_id, after the details of the book for only 1 book_publication_id are displayed each time. If a loop in a loop. I hope that makes sense. I think this is my internal request that it be built differently. My code for this part of the program, which is currently wrong, is as follows:
--Global variable section contains:
var_user_chosen_map_list_ids VARCHAR2(32767);
var_details VARCHAR2(32767);
......
PROCEDURE PROCMAPSEARCH (par_user_chosen_map_list_ids PKG_ARR_MAPS.ARR_MAP_LIST)
IS
BEGIN
FOR rec_user_chosen_map_list_ids IN 1 .. par_user_chosen_map_list_ids.count
LOOP
   var_user_chosen_map_list_ids := var_user_chosen_map_list_ids || 
   '''' || 
   par_user_chosen_map_list_ids(rec_user_chosen_map_list_ids) || 
   ''',' ;
END LOOP;
 var_user_chosen_map_list_ids := substr(var_user_chosen_map_list_ids,
                                        1, 
                                        length(var_user_chosen_map_list_ids)-1);
var_details := FUNCMAPDATAFIND (var_user_chosen_map_list_ids);
htp.print(var_details);
END PROCMAPSEARCH;
FUNCTION FUNCMAPDETAILS (par_user_chosen_map_list_ids IN VARCHAR2(32767)
RETURN VARCHAR2
AS
TYPE cur_type_map IS REF CURSOR;
cur_book_search cur_type_map;
var_book_date NUMBER(4);
var_book_title VARCHAR2(32767);
cur_map_search cur_type_map;
var_map_date NUMBER(4);
var_map_title VARCHAR2(32767);
begin:
OPEN cur_book_search FOR
'SELECT BI.book_date,
        BT.book_title
 FROM   BOOK_INFO BI,
        BOOK_TITLE BT,
        TABLE (sys.dbms_debug_vc2coll(' || par_user_chosen_book_list_ids || ')) BL_1
 WHERE BI.book_title_id = BT.book_title_id
 AND BI.book_publication_id = BL_1.column_value';
OPEN cur_map_search FOR
'SELECT MI.map_date,
       MT.map_title
FROM map_info MI,
     map_title MT,
     TABLE (sys.dbms_debug_vc2coll(' || par_user_chosen_book_list_ids || ')) BL_2
     TABLE (sys.dbms_debug_vc2coll(' || par_user_chosen_map_list_ids || ')) ML
WHERE MI.map_title_id = MT.map_title_id
AND BI.book_publication_id = BL_2.column_value
AND BI.book_publication_id = MI.pub_publication_id
AND MI.map_publication_id = ML.column_value';
LOOP
LOOP
FETCH cur_map_compare INTO
var_book_date,
var_book_title;
var_details
var_details := var_details || 'Book date: '||
                    var_book_date ||
                    'Book title: ' ||
                    var_book_title;
FETCH cur_map_compare INTO
var_map_date,
var_map_title;
var_details := var_details || 'Map date: '||
                    var_map_date ||
                    'Map title: ' ||
                    var_map_title
EXIT WHEN cur_book_compare%NOTFOUND;
END LOOP;
EXIT WHEN cur_map_compare%NOTFOUND;
END LOOP;
RETURN var_details;
END FUNCMAPDETAILS;
If anyone has any ideas or suggestions, I would be grateful. It is an extension of my previous code, I posted a question recently. As I am working and learning a step at a time, I left this idea in my previous question, that I had to make sure I knew that first.

Kind regards

Tim

Using dynamic SQL

declare
  dd sys_refcursor;
  ee sys_refcursor;
  d dept%rowtype ;
  e emp%rowtype ;
begin
open dd for 'select * from dept' ;
loop
fetch dd into d ;
exit when dd%notfound ;
dbms_output.put_line('Department:'||d.dname);
  open ee for 'select * from emp where deptno='||d.deptno ;
  loop
  fetch ee into e ;
  exit when ee%notfound ;
  dbms_output.put_line('..Employee:'||e.empno||':'||e.ename);
  end loop;
end loop ;
end ;
/
Department:ACCOUNTING
..Employee:7782:CLARK
..Employee:7839:KING
..Employee:7934:MILLER
Department:RESEARCH
..Employee:7369:SMITH
..Employee:7566:JONES
..Employee:7788:SCOTT
..Employee:7876:ADAMS
..Employee:7902:FORD
Department:SALES
..Employee:7499:ALLEN
..Employee:7521:WARD
..Employee:7654:MARTIN
..Employee:7698:BLAKE
..Employee:7844:TURNER
..Employee:7900:JAMES
Department:OPERATIONS

PL/SQL procedure successfully completed.

HTH

SS

Tags: Database

Similar Questions

  • sys_refcursor and Ref Cursor

    Hello

    I found this diffrence between ref and sys_refcursor slider.

    If you specify return_type, then the variables of type and slider REF CURSOR of this type are strong; If not,
    they are weak.
    The variables SYS_REFCURSOR and slider of this type are weak.

    my situation is that I must write a procedure stored so many reports entery pages. little enter pages use typed data groups and can't.

    so please tel me what is the best in terms of performance and maintainability above three conditions?

    Yours sincerely

    944768 wrote:

    my situation is that I must write a procedure stored so many reports entery pages. little enter pages use typed data groups and can't.

    Called stored procedures what and where?

    If, with a layer of app such as Java or .net, then they do not distinguish between weak and strong ref Cursor - because it is a concept of PL/SQL.

    And by using a ref cursor type in PL/SQL is intended to provide a mechanism to pass the handle of real cursor SQL cursor created in this session, the client (for example Java or .net). Nothing more. So, why even care that PL/SQL? a weak or strong Ref to the application layer slider

    so please tel me what is the best in terms of performance and maintainability above three conditions?

    I find always frustrating that there is this concept that some methods to create cursors, results in faster and better than other methods, the sliders. It is a concept of bs. All SQLs are analyzed as a SQL cursors. Each. Unique. One. By the SAME CBO.

    If the client code (Java, PL/SQL or other) you write for this SQL cursor DOES NOT change the source SQL.

    This therefore does not cause the CBO now compile a different SQL execution plan for her. The CBO does not care if your code uses a strong Ref Cursor or a weak Ref Cursor, or a slider DBMS_SQL, an explicit cursor, or whatever. Those are concepts of customer. And do not change the execution plan of cursor SQL on the server. Or its planned performance/cost.

    Yes, your client code (Java, PL/SQL, etc.) can use the SQL cursor on the server-side evil - and this can affect performance.

    But waiting for a weak Ref cursor will somehow cause a faster cursor or slower for the same SQL statement, that a strong Ref cursor is not understanding what SQL cursor is, and how the customer interacts with its data types, the classes of customers and its customer interfaces with this SQL cursor.

  • using plsql table and ref cursor in oracle's 10 g

    Hi all
    Can someone give me an example of a scenario where we need to create a form manually based on a stored database procedure.
    And in this process, I created a pl/sql table and a Ref cursor at the database level.

    CREATE OR REPLACE PACKAGE SCOTT. TYPE BONUS_PKG IS bonus_rec
    IS (RECORD
    EmpNo bonus_EMP.empno%TYPE,
    Ename bonus_EMP.ename%TYPE,
    employment bonus_EMP.job%TYPE,
    SAL bonus_EMP.sal%TYPE,
    Comm bonus_EMP.comm%TYPE);

    TYPE b_cursor IS REF CURSOR RETURN bonus_rec;
    TYPE bontab IS TABLE OF bonus_rec INDEX DIRECTORY.

    PROCEDURE bonus_refcur (bonus_data IN OUT b_cursor);
    PROCEDURE bonus_query (bonus_data IN OUT bontab);
    END bonus_pkg;


    CREATE OR REPLACE PACKAGE BODY SCOTT. BONUS_PKG IS
    PROCEDURE bonus_query (bonus_data IN OUT bontab) IS
    II NUMBER;
    CURSOR bonselect IS
    SELECT empno, ename, job, sal, comm bonus_EMP ORDER BY empno;
    BEGIN
    OPEN bonselect.
    II: = 1;
    LOOP
    Look FOR bonselect IN
    .EmpNo bonus_data (ii),
    .ename bonus_data (ii),
    .job bonus_data (ii),
    .Sal bonus_data (ii),
    .comm bonus_data (ii);
    EXIT WHEN bonselect % NOTFOUND;
    II: = ii + 1;
    END LOOP;
    END bonus_query;

    PROCEDURE bonus_refcur (bonus_data IN OUT b_cursor) IS
    BEGIN
    Bonus_data OPEN to SELECT empno, ename, job, sal, comm bonus_EMP ORDER BY empno;
    END bonus_refcur;

    END bonus_pkg;

    I want to fill in the data in the forms manually is not using Forms data block Wizard and by program.

    Please answer...

    Can someone give me an example of a scenario where we need to create a form manually based on a stored database procedure.

    In general, you will use a block of proceedings based when you have a collection of data from several tables presented in a form and your username must be able to update the information displayed.

    In your sample code, looks like you are using Oracle Support document "Melting a block on a Stored Procedure - examples of Code [ID 66887.1]". If this is the case, continue to follow the document - it guides you through all the steps. There is no need to manually configure things that the data block Wizard will work for you!

    I want to fill in the data in the forms manually is not using Forms data block Wizard and by program.

    Why? Let the wizard block configuration data of your block based on a procedure for you. There is no need to manually browse the data! I did what you're trying, and it's more work needed. Leave forms to do the work for you. :)

    If you absolutely have to do things manually, I recommend that you use the PROCEDURE bonus_query (bonus_data IN OUT bontab) instead of bonus_refcur (bonus_data IN OUT b_cursor) . Then, in your code create a variable of type BONTAB, and then call the bonus_query procedure. Then, it's a simple case of a loop in the table of records returned by the bonus_query procedure. For example:

    DECLARE
       t_bonus    bonus_pkb.bontab;
    BEGIN
       bonus_pkg.bonus_query(t_bonus);
    
       FOR i in 1 .. t_bonus.count LOOP
          :YOUR_BLOCK.EMPLOYEE_NUMBER := t_bonus(i).empno;
          :YOUR_BLOCK.EMPLOYEE_NAME := t_bonus(i).ename;
          :YOUR_BLOCK.EMPLOYEE_JOB := t_bonus(i).job;
          :YOUR_BLOCK.EMPLOYEE_SALARY := t_bonus(i).sal;
          :YOUR_BLOCK.EMPLOYEE_COMMISSION := t_bonus(i).comm;
       END LOOP;
    END;
    

    This code example shows the basics, but as is the sample code - you will need to adapt to your situation.

    Also, I highly recommend that you look at the article inol listed. It is a very thorough debate on the REF CURSOR. If you have set up using a procedure based on the data source - it is more effective to spend the record table to your form that it must pass a ref cursor Using a ref cursor, you might as well just using a standard called cursor and loops on your named cursor. The effect is the same (a line returned at the same time creating lots of network traffic). Using the table of records is more efficient because the data set is returned if the network traffic is reduced.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • Ref Cursor on implicit and explicit cursors

    Hello

    In my company the drafting of PL/SQL procedure, everyone uses "Ref Cursor",
    But the article below, said implicit is the best, then Explicit and Ref Cursor...

    [http://www.oracle-base.com/forums/viewtopic.php?f=2 & t = 10720]

    I'm a bit confused by this, can someone help me understand this?

    Thank you

    SeshuGiri wrote:

    In my company the drafting of PL/SQL procedure, everyone uses "Ref Cursor",
    But the article below, said implicit is the best, then Explicit and Ref Cursor...

    [http://www.oracle-base.com/forums/viewtopic.php?f=2&t=10720]

    I'm a bit confused by this, can someone help me understand this?

    It has performance and it has performance...

    To explain. There is one type of cursor in Oracle - that is the cursor which is analyzed and compiled by the SQL engine and stored in the shared the database pool. The "+ client +" then receives a handle (called a SQL statement handle of many APIs) that can be used to make reference to this slider in the SQL engine.

    The performance of this slider is not determined by the customer. It is determined by the execution plan and how much enforcement of this slider cost ito of server resources.

    The customer can be Java, VB, .net - or a PL/SQL program. This client language (SQL client), has its own structures dealing with this from the SQL engine cursor handle.

    It can hide by the developer all together - so that they can't even see that there is a statement handle. That's what the implicit cursors in PL/SQL.

    It can allow the developer to manually define the structure of slider - this is what the explicit cursors, ref Cursor and DBMS_SQL cursors in PL/SQL.

    Each of these client cursor structures provides the programmer with a set of features to address different SQL cursor. Explicit cursor in PL/SQL constructs do not have the use of dynamic SQL statements. REF CURSOR and cursors DBMS_SQL do. REF CURSOR does not allow the programmer determine, at runtime, the structure of the projection of the cursor SQL. DBMS_SQL sliders do.

    Only ref Cursor can be created in PL/SQL and then handed over to another client (for example, Java/VB) for treatment. Etc.

    If each of the works of art/customer interfaces gives you a different feature for SQL cursors.

    Choose the implicit cursors for example does not the SQL cursor move faster. The SQL engine does not know and does not care, which customer construct you use to deal with the SQL cursor handle, he gave you. It does not matter. It does not affect his performance of cursor SQL.

    But on the client side, it can matter - if your code when dealing with that SQL cursor determines how fast your interaction with this SQL cursor is. How many context changes you make. How you use and reuse the SQL (for example hard vs soft analysis vs analysis reusing the same cursor handle). Etc.

    Are there any unique client cursor construction which is better? N °

    It's ignorant views. The customer's language provides a box tool, where each tool has a specific application. The competent developer will use the right tool for the job. The stupid developer will select a tool and use it as The Hammer to 'solve' all problems.

  • How could a routine walk-run? Inside, Indoor walk or another run? I do this routine outdoors with Gps first so that I'm not kidding my calibration data? Help please and thank you!

    How could a routine walk-run? Inside, Indoor walk or another run? I do this routine outdoors with Gps first so that I'm not kidding my calibration data? Help please and thank you!

    Hello

    Choose indoor walk or run Indoor (it does not matter which) to an indoor walk-run routine.

    Even if Apple Watch does not currently offer as a workout interval training, choose one of these allows the most appropriate data sources (which are the same for market and short) to use to track your training.

    If walking or running, the accelerometer is used to estimate pace and the distance (allow your arms swinging naturally) as well as the frequency heart sensor for the estimation of calories burned.

    Run or walk inside will not affect your calibration data. Calibration is based on the GPS of the iPhone data and is only held during the outdoor walking training or race outdoors when the iPhone combined is taken along.

    More information:

    Use of the workout on your Apple Watch - Apple Support

    Calibrate your Apple Watch for better accuracy of training and activity - Apple Support

  • How to get an external drive officially used with a Mac to be recognized and usable with a PC running Windows 7

    I have an Iomega 500 GB external hard drive that I bought about 2 years ago I used exclusively with an iMac, until this computer crashed irreparably affordable last month.  My new computer is a HP Pavilion PC running Windows 7 and when I connect the drive I see in devices and printers that he acknowledged that an Iomega hard drive is connected to a USB port, but in the computer, it shows internal hard drive of the computer and the DVD player with their respective letter designations.  However, the external hard drive is not displayed.

    Fast disk information: I buy the player on the Apple store online in early ' 08, and when I unpacked it initially, I saw no written information not specifying that it was somehow a Mac version of this Iomega drive, there was anything about it either by declaring that use it with a Mac it format to use Mac only.   When I first plugged into the Mac, I was never invited on implementation shape or anything else specific to the Mac, actually, I was never even asked about the pilots.   To plug into it, he behaved as the USB flash drive and external 40 GB drive I have - a small orange icon appears on the desktop, with the name of the drive and the USB symbol.   So for two years, I moved the files between the player and the Mac with no problems, until now, when I try to use the drive with my current PC.

    So far it was suggested to me that makes the Mac * fact * format the drive in a way that makes Mac only, and I can't reformat because I have given, I must first of all get moved to the new computer.  Another theory is that since entering at Apple, even though it is an Iomega product, it might have been shipped with a tweak specific to Mac-maybe it was already formatted for Mac use.  A third theory advanced for me, is that it could be that the cable company somehow makes the PC is not quite completely recognize it.

    Any info would be greatly apprecitated.   Worse, I can find someone with a Mac and we can move files from the Iomega to the Mac hard drive, then the 40 GB drive which * fact * work with both types of BONE, and that several times until everything is moved safely to the new computer, then can do what I do with the Iomega is usable with the PC.

    What I find a bit confusing, it's the 40 GB has never had problems of compatibility with any computer with which I have connected.  In the course of graphic design, I've been in we have Mac and PC in the same building and that player never cared that it was connected to.

    There is a format uses Apple (don't remember what it's called...? Trip...? Journal... something like that) that Windows cannot yet see.  So once you have the files and folders saved on something like the DVD, do not format NTFS for Windows can see it.  The good thing is that Apple may also see NTFS, once it is formatted and files/folders copied on it, you will be able to use all the PC under Windows or OS.

  • I installed windows 7 on a mac with boot camp and then used parallels to create a virtual machine to run windows inside Mac os10.6. Now he says I need to activate windows again, but he said I need a new activation key. Any ideas would be appreciated

    I installed windows 7 on a mac with boot camp and then used parallels to create a virtual machine to run windows inside Mac os10.6.  Now he says I need to activate windows again, but he said I need a new activation key.  Any ideas would be appreciated

    Yes, you must purchase a full license for the second installation of Windows 7 product key.  1 activation allows only one Windows 7 product key.  Apparently, you now have a second facility that requires a second product key. Carey Frisch

  • Recovery of DNG issue: I have photos stored on an external hard drive which have previously been imported into Lightroom and converted to DNG.  The laptop on which I was running Lightroom died and I had to replace the hard drive and rebuild the

    Recovery of DNG issue: I have photos stored on an external hard drive which have previously been imported into Lightroom and converted to DNG.  The laptop on which I was running Lightroom died and I had to replace the hard drive and rebuild the computer.  In the process of my Lightroom program and catalog related to these images have been lost.  When I re-associate these photos with my new installation of Lightroom and a new catalogue is there a way to retrieve the keywords or other changes or metadata catalogue Mountaga?  Is any of this information embedded with the imge DNG file or was it only in the cataloght lost on my failing hard drive? I re-import just as if it were new images with no prior treatment of Lightroom?

    By default, LR saves all changes in the catalog, and that applies to any type of file.

    Optionally, you can save changes to the file as well, for raw files owners, this will create a xmp file - for DNG that changes are going to be cooked in the file, without additional xmp file.

    But it does not default. Go to the catalog and parameters under the control of metadata automatically save changes to XMP.

    Unless you do this, the changes are saved only in the catalog.

    Hope this makes things clearer.

  • Running Snow Leopard and Mavericks, MBP 2009

    I have a MacBook Pro mid-2009 (4 GB of RAM, 2.26 GHz, 160 HD) which is running Mavericks (10.9.5). I have problems with iTunes (12.3.1) find my library since I copied the files to my Time Capsule to an HD station. I have researched and followed the instructions, but my library, but cannot be found on the disc, and also he will not find on my Time Capsule or other.

    I thought I would downgrade to Snow Leopard, but opening (3.5.1) should Mavericks. Now I think running two Mavericks for when I need to use Aperture and Snow Leopard for iTunes and most everything else, because it seems to play more enjoyable with my MacBook.

    How would be better in this respect? My Aperture library and iTunes are on a 4TB post HD all is supported with a second to 4 post HD. I'm a newb when it comes to such things. I read that "performing two partitions or drives multiple is the best way to handle this and provide most compatibility as opposed to virtualization". Someone said as I could "boot from the DVD and use disk utility to create a new partition on the internal drive. Install Snow Leopard. You can start and then in what operating system never desired. "I guess that means that two partitions on my hard drive or an OS on my HD and the other on the ext HD.? If so, what would be better? Could I put the Mavericks on the HD Ext. and Snow Leopard on my MacBook HD?

    To complicate matters, I live in America where Macs are rare. I know that in my city of 1 million a Mac tech. My Spanish is good, but I don't speak well, even in English, computers and looking for advice or ideas before you have the tech to do anything, thinking that he can just do everything is faster and more convenient for him. I also wonder if I can do it myself, since I have backups Time Machine going back to before I installed the Mavericks, but would probably have a tech do it anyway. I just want to know what precisely I would ask him to do.

    As you say, your options are either have multiple partitions on your internal drive OR install the OS 2nd on an external drive.

    [EDIT]

    If you have multiple partitions on your internal drive...

    • You can run lack of disk space on one or two partitions according to what you save on partitions
    • It is convenient because you do not have to carry another device with you.
    • If a disk fails, you lose the two partitions

    If you install 2nd OS on an external hard drive...

    • you will have more disk space for the two operating systems work with
    • less convenient, because you will need to have the external drive to use OS 2
  • I get the 0x8078012D error code when I run the Windows backup on an external hard drive.

    I get the 0x8078012D error code when I run the Windows backup on an external hard drive.  I have Windows 7 Professional.  That suggests this error code is the problem and how can I solve the problem?

    For people who read this thread, I offer the following information.  I solved the problem by noticing that the problem could have been caused, when the system image is created.  So I did a backup without creating the system image and backup is complete without error.

    Then I used the backup program to create a system image.  This time error (0x8007045D) was displayed.   The error report says "the operation failed for a device error encountered with the source or the destination. If the volume of the source or the destination is on a disk, run CHKDSK /R on the source volume or destination and then try again using. »

    So I ran chkdsk/r, and this program is a bad sector on the hard drive of my computer and fixed the error.  It took about an hour to run the program.  Now, the image of the system and the backup of data file work again.

    So I think that the main cause of error (0x8078012D) is deborahgarbe of i/o error (0x8007045D).  So if you get the first error code you can search for fixes for the second error code fix the root cause.

  • Run script .jsx and/or the Actions button in HTML extension?

    Hi all

    I'm quite a novice at things .js, .jsx, and HTML.  I use scripts of JSX one former co-worker created and Photoshop actions for many years.  I looked through and have managed to modify the JSX scripts with a few minor changes, but that's all.  Using the Configurator, I created a custom for use in CS6 Panel.  We are moving finally CC2015 team and I'm the only person in our team who has experience and/or desire to convert compatible with CC 2015 Configurator easily created CS6 bench.  I got all of the HTML developed, interface extension runs within Photoshop and I have the buttons either launch an alert or by creating a new document in Photoshop.  The function of coding was all found code.  Now I need to figure out how to make these buttons work our various actions and some to run our scripts JSX.


    Configurator makes it is easy to select a button and tell it to perform an action or launch an external script file.  Is there an easy way to do this now using actions and JSX files that we have already created?

    And just a reminder, I'm a NEWB, so take it easy on me... if possible. In addition, it is only a sign used internally so I need power to market/sell it.  This is specific to our company of workflow and needs.

    Thank you!

    SMM

    for stocks, you can use this command

    ---

    Application.doAction (action: string, to: string)

    Object Adobe Photoshop CC 2015 library

    Playing the action specified in the Actions palette.

    Action: Data Type: string

    The name of the action to play. (Note that the action name is case-sensitive and must match the name in the Actions palette).

    of: Data Type: string

    The name of the action set that contains the action being played. (Note that the defined action name is case-sensitive and must match the name in the Actions palette).

    ---

    Make sure they are loaded in photoshop

    Another way is to convert action scripts (I see people often using this tool http://www.tonton-pixel.com/blog/scripts/utility-scripts/convert-actions-file/)

    and run the scripts, you put them on the .jsx file, where they will be evaluated, if you used standard mat and then call them by the name of the function

    I suggest you check out the samples, if you still have questions

  • How to run commands inside a virtual machine?

    Hey,.

    I train hard run commands inside a machine virtual on vSphere (batch scripts) and could not find a good way to do it,

    in ESX 3.5 "vmrun.exe" did the job, but it does not work on vSphere for some reason any.

    I also tried to do with PowerCLI but could not find any help for this command.

    Am I missing something?

    Maybe my syntax of the command is wrong and someone can give me the proper syntax?

    Im sure there is a way to do it and would appreciate any help that anyone can give me.

    Thank you very much in advance,

    Omer

    vmrun must work with vSphere, in fact, vSphere is the only version of ESX that vmrun (and the VIX API, on which is built vmrun) officially supports. ESX 3.5 is only experimental support.

    Please make sure you have the latest version of VIX installed; You can find it at www.vmware.com/go/vix.

    Once you have installed, if you still see an error, please post what this error is and what kind of host you are using vmrun.

  • Run the report to PL/SQL with the branch to another page

    I have an application which, at various times, I run a PL/SQL procedure to perform an action, and then we must run a report while also navigating away from the current page. The actions are performed on a button click.

    I tried several methods, but for the life of me cannot get the system to do the two things (ie. run the report and the direction to another page). I tried to put in page 0 (to be executed after the treatment on the click of a button) a branch with a request line to print the report, followed by a branch to the other page (also to run after the treatment on the button click) - and only the branch page 0 runs in fact. Also tried a branch to the other page only, with the print in the request parameter request - but only runs the report, do not create a branch to the other page.

    I also tried to put the call to run the report in the PL/SQL code, using utl_http.start_request (url), but that came with a "Bad Request" error. Also tried to use the owa_util.redirect_url call, but also no chance.

    I'm pulling my hair out at this time, especially because I am under pressure to get the system in very short time.

    Any suggestion would be appreciated.

    You can run queries report of their URL (f? p = & APP_ID.: 0: & SESSION.: PRINT_REPORT =)

    So one approach would be to
    The button click, call a JS function which

  • 1 use the Ondemand/recall process in order to perform the processing workflow (file selection box)
  • 2 open the report in a popup (from your IR page)
  • 3 redirect leaves the IR page to another page?
    ------
    Another approach:
  • 1. IR report submits the page
  • 2. in the PLSQL block, you do the treatment
  • 3. the branch redirects to a URL that would point to the report URL.
    OR
  • 3. do you have a JS onload which runs only when demand is demand for BUTTON and opens a page that points to the report.
    ------

    Still another way is to use htp.p in PLSQL block which made the treatment of workflow
    So your code PLSQL

    BEGIN
      --Do the workflow processing here
      --End workflow processing
      htp.p('');
    END;
    
  • REF cursor in sql dynamic help to run immediately

    Hello

    How can we get the Ref cursor out a dynamic sql statement by executing immediate proceedings
    for example, immediately run ' open CROR for select * from dynamicTable'

    in this area, CROR is a dynamic cursor and table name is dynamic (known at run time), and we can't write static sql statement.

    Thank you

    I don't know what exactly you are after but here is a sample of what can be done.

    SQL> VAR r REFCURSOR;
    SQL> BEGIN
      2          OPEN :r FOR 'SELECT * FROM DUAL';
      3  END;
      4  /
    
    PL/SQL procedure successfully completed.
    
    SQL> PRINT r
    
    D
    -
    X
    

    You can use the OPEN... FOR education with a dynamic string.

  • Casting table PL/SQL for the type of existing table and back ref cursor

    Hello



    I have the problem of casting a pl/sql table for the type of an existing table and turning the ref cursor to the application. Casting a ref cursor back and number of pl/sql table works well.



    Declarant

    < strong > TYPE type_table_name IS TABLE OF THE package_name.table_name%ROWTYPE; < facilities >

    within the stored procedure, fill in a table of this type temp_table_name and returning the ref cursor help

    < strong > results OPEN to SELECT * FROM TABLE (CAST (temp_table_name AS type_table_name)); < facilities >

    generates an error. type_table_name is unknown in this distribution. According to me, this happens because of the declaration of the type locally.



    Statement type_table_name inside the package specification does not work neither. Incredible, cast to the said dbms_sql.number_table to specify ref cursor back and dbms_sql package works very well!



    < strong > CREATE TYPE type_table_name IS TABLE OF THE package_name.table_name%ROWTYPE; < facilities > deals without any error but creates an invalid type complain a reference to package_name.table_name



    I don't want to declare every column in the table in type_table_name, because any change the table_name table would result in an inconsistent type_table_name.



    Thanks in advance!

    Edited by: user6014545 the 20.10.2008 01:04

    In any case you are right that there is a problem around anchorage (or maintaining) types of objects persistent to match the table structures, they may represent.

    In the case you describe, you might be better off just open the refcursor immediately the using one of the techniques described in the http://www.williamrobertson.net/documents/comma-separated.html to manage the delimited list.

    In the more general case where the line of treatment is necessary, you may make the pipeline functions.

    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    
    SQL> CREATE TABLE table_name
      2  AS
      3     SELECT ename column_name
      4     FROM   emps;
    
    Table created.
    
    SQL> CREATE OR REPLACE PACKAGE package_name
      2  AS
      3     TYPE type_name IS TABLE OF table_name%ROWTYPE;
      4
      5     FUNCTION function_name_pipelined (
      6        parameter_name IN VARCHAR2)
      7        RETURN type_name PIPELINED;
      8
      9     FUNCTION function_name_refcursor (
     10        parameter_name IN VARCHAR2)
     11        RETURN sys_refcursor;
     12  END package_name;
     13  /
    
    Package created.
    
    SQL> CREATE OR REPLACE PACKAGE BODY package_name
      2  AS
      3     FUNCTION function_name_pipelined (
      4        parameter_name IN VARCHAR2)
      5        RETURN type_name PIPELINED
      6     IS
      7     BEGIN
      8        FOR record_name IN (
      9           SELECT table_alias.*
     10           FROM   table_name table_alias
     11           WHERE  table_alias.column_name LIKE parameter_name) LOOP
     12
     13           PIPE ROW (record_name);
     14        END LOOP;
     15
     16        RETURN;
     17     END function_name_pipelined;
     18
     19     FUNCTION function_name_refcursor (
     20        parameter_name IN VARCHAR2)
     21        RETURN sys_refcursor
     22     IS
     23        variable_name sys_refcursor;
     24     BEGIN
     25        OPEN variable_name FOR
     26           SELECT table_alias.*
     27           FROM   TABLE (package_name.function_name_pipelined (
     28                     parameter_name)) table_alias;
     29
     30        RETURN variable_name;
     31     END function_name_refcursor;
     32  END package_name;
     33  /
    
    Package body created.
    
    SQL> VARIABLE variable_name REFCURSOR;
    SQL> SET AUTOPRINT ON;
    SQL> BEGIN
      2     :variable_name := package_name.function_name_refcursor ('%A%');
      3  END;
      4  /
    
    PL/SQL procedure successfully completed.
    
    COLUMN_NAME
    -----------
    ALLEN
    WARD
    MARTIN
    BLAKE
    CLARK
    ADAMS
    JAMES
    
    7 rows selected.
    
    SQL> ALTER TABLE table_name ADD (new_column_name VARCHAR2 (1) DEFAULT 'X');
    
    Table altered.
    
    SQL> BEGIN
      2     :variable_name := package_name.function_name_refcursor ('%A%');
      3  END;
      4  /
    
    PL/SQL procedure successfully completed.
    
    COLUMN_NAME NEW_COLUMN_NAME
    ----------- ---------------
    ALLEN       X
    WARD        X
    MARTIN      X
    BLAKE       X
    CLARK       X
    ADAMS       X
    JAMES       X
    
    7 rows selected.
    
    SQL>
    

Maybe you are looking for