Using the slider as a procedure parameter

Hello

I'm new in PL/SQL, but I need to build the procedure and trigger to check for a condition.
I scoured the web, but I can't find something similar as my problem (maybe that I can not describe it well, or I'm doing something I shouldn't...)

Well, I am designing a database that will manage the groups. A group can include another, so I need to check that there is no recursion.

Let's say I have this table INC. where GID is my GroupID and INCLUDES the ID of the groups included in the first.
 GID   INCLUDES
---- ----------
  13         12
  13         14
  13         15
  16         11
  16         13
I have also a subgroups procedure which lists all the groups included in that given:
CREATE OR REPLACE PROCEDURE subgroups(cur OUT SYS_REFCURSOR, parent_id IN NUMBER)
IS
BEGIN
  OPEN cur FOR
    SELECT includes
    FROM inc
      START WITH gid= parent_id
      CONNECT BY PRIOR includes=gid ;
END ;
/
This procedure will also be used in a PHP script, so I would keep independent.
Now my problem is in this trigger:
CREATE OR REPLACE TRIGGER t_inc_check_recurs
  BEFORE INSERT OR UPDATE ON inc
  FOR EACH ROW
DECLARE
  cur SYS_REFCURSOR ;
  --i cur%ROWTYPE ;
  i inc%ROWTYPE;
BEGIN
  subgroups(cur, :NEW.gid) ;
  LOOP
      FETCH cur INTO i ;
      EXIT WHEN cur%NOTFOUND;
      dbms_output.put_line('Test '||i.includes);
  END LOOP;
  CLOSE cur;
END ;
/
In this case, it seems that I have trouble with the types used:
SQL> insert into inc values(12,13) ;
insert into inc values(12,13)
            *
ERROR at line 1:
ORA-06504: PL/SQL: Return types of Result Set variables or query do not match
(1) is there anyone who could tell me how I should send the cursor as a parameter?
It works fine:
SQL> var cur refcursor ;
SQL> exec subgroups(:cur, 13);
SQL> print cur ;
(2) do you know how can I declare 'i' in this genre: I heart % ROWTYPE?


Thank you very much!

>
In this case, it seems that I have trouble with the types used:
>
No.-you have problems because you're trying to extract a value in a rowtype that requires TWO values

Your procedure uses a cursor which is only expecting a SINGLE value

  OPEN cur FOR
    SELECT includes
    FROM inc

But your trigger defines a rowtype for the entire line

  i inc%ROWTYPE;
BEGIN
  subgroups(cur, :NEW.gid) ;
  LOOP
      FETCH cur INTO i ;

And if you get this error
>
ORA-06504: PL/SQL: return variables of the game results or the query types do not match
>
Also - you can also declare and define a cursor in a package specification, and then use this cursor definition in the procedure and the trigger.

Tags: Database

Similar Questions

  • The images appear tense when played using the slide show in full screen

    The images appear tense when played using the slide show in full screen in Windows Vista Basic. That means that a picture of resolution 1920 x 1200 appears full screen covering although a 1920 x 1080 image seems letterbox in fullscreen. My screen resolution was put to the native resolution of 1920 x 1080. It is clear that this slide show program only keeping the proportions of the image. Earlier this problem wasn't there. I think that the slide show program addresses in such a way that my monitor could have 16:10 display of report resolution l / h. thanks for giving me a solution.

    This happens usually when the image resolution is high.

    Keep your screen resolution of 1024 x 768 and it should work fine.

  • When I try to edit a room photo in photoshop elements 12, I'm not able to use the slider or one of the drop down menus. All I have is a black circle with a line through it.

    When I try to edit a room photo in photoshop elements 12, I'm not able to use the slider or one of the drop down menus. All I have is a black circle with a line through it.

    Most likely, the images are 16-bit/channel.

    Go to Image > Mode and click on 8-bit/channel and see if that solves the problem.

  • Change the Volume using the Slider component

    I am using the slider (aSlider) to control the volume for mySound, which is a class called PlaySound. Created an addEventListener for aSlider with an execution of a function called changeVolume SlideEvent.CHANGE. All other works, but I can't get the cursor to control the volume for mySound. Need help. Here's the current code. TY in advance.


    import flash.events.Event;
    Import fl.controls.Slider;
    Import fl.events.SliderEvent;
    Import fl.controls.Label;

    var mySound:PlaySound = new PlaySound;

    stage.addEventListener (Event.ENTER_FRAME, clock);

    var OFF: Boolean = true;

    function clock(event:Event):void
    {
    var currentdate:Date = new Date();

    arc_mc. Visible = false;
    secondHand_mc.rotation = currentdate.seconds * 6;
    minuteHand_mc.rotation = currentdate.minutes * currentdate.seconds + 6 / 10;
    hourHand_mc.rotation = currentdate.hours * 30 + currentdate.minutes / 2;

    If (secondHand_mc.rotation >-60 & & secondHand_mc.rotation < 0)
    {
    arc_mc. Visible = true;
    If (OFF)
    {
    OFF = false;
    mySound.play ();
    }

    }
    on the other
    {
    arc_mc. Visible = false;
    SoundMixer.stopAll ();
    OFF = true;

    }


    }


    aSlider.addEventListener (SliderEvent.CHANGE, changeVolume);

    function changeVolume(event:SliderEvent):void
    {
    var volumeLevel:Number = 5;
    volumeLevel = event.target.value / 100;
    valueLabel.text = event.target.value + 'percent';
    }

    you follow all the instructions.  use:

    import flash.events.Event;
    Import fl.controls.Slider;
    Import fl.events.SliderEvent;
    Import fl.controls.Label;
    import flash.media.SoundTransform;

    import flash.media.SoundChannel;

    var mySound:PlaySound = new PlaySound();

    var mySoundChannel:SoundChannel;

    stage.addEventListener (Event.ENTER_FRAME, clock);

    var OFF: Boolean = true;

    function clock(event:Event):void
    {
    var currentdate:Date = new Date();

    arc_mc. Visible = false;
    secondHand_mc.rotation = currentdate.seconds * 6;
    minuteHand_mc.rotation = currentdate.minutes * currentdate.seconds + 6 / 10;
    hourHand_mc.rotation = currentdate.hours * 30 + currentdate.minutes / 2;

    If (secondHand_mc.rotation >-60 & secondHand_mc.rotation)<>
    {
    arc_mc. Visible = true;

    If (OFF)
    {
    OFF = false;
    mySoundChannel = mySound.play ();  delcare mySoundChannel outside all functions
    mySound.play ();
    }
    }
    on the other
    {
    arc_mc. Visible = false;
    SoundMixer.stopAll ();
    OFF = true;
    }
    }

    aSlider.addEventListener (SliderEvent.CHANGE, changeVolume);

    function changeVolume(event:SliderEvent):void
    {
    valueLabel.text = event.target.value + 'percent';
    var st:SoundTransform = mySoundChannel.soundTransform;
    St.volume =(event.target.value-event.target.minimum) / (event.target.maximum - event.target.minimum);
    mySoundChannel.soundTransform = m;
    }

    TX 1 million

  • Preview screen turns black when you use the slider to soften ultra key

    Hello

    I'm working on a video, including a greenscreen. That is why I use the ultra key to make the transparent green screnscreen. Whenever I touch the slider "soften" Ultra key, windos preview blackens. I can't get it back to normal until I restart the first. Version 2015.4.

    This issue is being investigated. So far it has been reproduced with acceleration GPU on Windows. What is the case on your system? Also, could you provide your operating system, graphics card and if you use CUDA or OpenCL?

    A possible solution is to go into project settings > General and set the Mercury Playback Engine software only, when you use the parameter to soften.

    Thank you.

  • Creation of XML report using the PL/SQL stored procedure

    Hi friends,

    I'm working on a report xml with the xml source as a PL/SQL stored procedure.

    I mean the fiscal year indicated in the following link to understand the process:

    http://orclapp.blogspot.com/2012/02/developing-xml-publisher-report-using.html

    In the example shown in the link above, I did not understand the following:

    (1) in the following procedure, setting out "retcode" is not used at all.

    What is the importance of this parameter.

    REPORT PROCEDURE (errbuf OUT VARCHAR2, retcode OUT VARCHAR2, p_product_id in NUMBERS)

    (2) after the xml data are prepared and updates 'l_result' variable Clob, what follows

    Loop is executed. I am not able to understand why the following loop is required.

    LOOP

    EXIT WHEN l_length = l_retrieved;

    IF (l_length - l_retrieved) < 32000

    THEN

    SELECT SUBSTR (l_result, l_retrieved + 1) IN l_xmlstr FROM DUAL;

    l_retrieved: = l_length;

    fnd_file.put_line (fnd_file.output, l_xmlstr);

    ON THE OTHER

    SELECT SUBSTR (l_result, l_retrieved + 1, l_offset)

    IN l_xmlstr

    FROM DUAL;

    l_retrieved: = l_retrieved + l_offset.

    fnd_file.put_line (fnd_file.output, l_xmlstr);

    END IF;

    END LOOP;

    (3) in the example it is not explained how the concurrent program gets the xml data?

    I guess that it is written to a file by using the following line of code:

    fnd_file.put_line (fnd_file.output, l_xmlstr);

    I would be grateful if someone can shed some light in my questions above so that I can well understand the process.

    Thanks and greetings

    Hawker

    Hi 32000 in the code is a 'safe' than 32767 available max mesh, loops is intended to get around the entire thing into pieces that can be managed within the limits of the data type.

    BTW; If you are in the following Oracle e-business, you can also use the Oracle reports very simply to create the XML output.

    If you have reports developer all you need to do is put raw sql (create XML without any "Fireworks") in the SQL report and then set reporting in XML format in the definition of program in Oracle e-business.

    Best regards

    Robert.

  • How to pick up the procedure and the slider for oracle procedure

    How to pick up the procedure and the slider for that?

    SELECT aktualne_notowania.aspolka_id,
    aktualne_notowania.Notowanie * spolki.ilosc_akcji as total
    To aktualne_notowania, spolki
    WHERE aktualne_notowania.aspolka_id = spolki.spolka_id;
    something like

    create or replcae procedure test_proc() is
    v_es_id polski_table.id%type;
    number of v_mult_val;

    cursor c1 is
    Select q.id, (q.quantity * p.price) as total_amount
    the quantity q
    price p
    where q.itemId = p.itemId

    Start

    Open c1
    loop
    Fetch c1 into v_es_id, v_mult_val;
    When exit c1% notfound;

    Update table_target
    total value: = v_mult_val
    where id: = v_es_id;

    end

    Something like this:

    merge into table_target t
    using (select select q.id, (q.quantity*p.price) as total_amount
           from   quantity q
                , price p
           where q.itemId = p.itemId
          ) s
    on    (t.id = s.id)
    when  matched then update
          set t.total = s.total_amount;
    
  • delete the data using the slider to tape

    Hello

    I have some log files that I need to deal with. For some of these files, I'll have to remove the beginning and the end of them. For this I intend to draw the newspaper and set of 2 sliders, and then the user move the sliders in a way that he would leave the unwanted data out of the band and then it would be a button to continue to delete the unwanted data of all channels within the group.

    So far I traced the data and set the band using the following script:

    view. ActiveSheet.Cursor.Type = "band".

    view. ActiveSheet.Cursor.Mode = "graphPoints".

    view. ActiveSheet.Cursor.X1 = CMin ("Y_Accel") + 0.25 * (CMax("Y_Accel")-CMin("Y_Accel"))

    view. ActiveSheet.Cursor.X2 = CMin ("Y_Accel") + 0.75 * (CMax("Y_Accel")-CMin("Y_Accel"))

    Now, I would use the positions where the sliders have been moved by the user to remove data but I don't know how to read the position of the cursor. With it, I would use a function like DataBlDel or similar.

    Does anyone have an idea how to do that?

    I'm just starting with DIAdem so if anyone found out that there is an easier way to do it please let me know.

    Thank you

    Leo

    Hi Leo,

    If you're just starting with DIAdem and scripts then the following article is a great resource. It examines interactions between users and the cursor data.

    DIAdem - using scripts to run the dialog box file, intervention by the user, using the data of frame slider and good even more!

    https://decibel.NI.com/content/docs/doc-5771

    Good reading and let me know if you have any questions.

    Best regards

    Chris

  • Using the slider to display time

    Hello!

    I am trying to use a vertical scroll bar to represent my dataset of 72 hours. I also added two additional cursors, to represent an interval of time inside the dataset object. My problem is that when I try to connect the cluster with timestamps for the slider, he says ' Cluster-> output_timestamp 1 d of timestamp, conflicts with cluster slide, a double [real 64-bit]»

    I understand that there is a conflict of input type expected in the slider to actual entries, my question is to know how to solve this problem? Do I have to convert all the data, or there at - it options for the cursor that I don't have right?

    I have attached a picture to show what I want to do my slider.

    Greetings

    Kristoffer

    This support allows you to get what you need?

  • How to use the NVL function to a parameter with comma delimited values

    Gurus,

    It is confusing to me.  I am trying to use the NVL function, but the setting that I'm passing in my cursor contains multiple values with commas.  The NVL function is confused when analyzing the values.

    'Where' cursor clause...

    and nvl (sn.c_attribute1,'x@#$%') in nvl (p_desig,'x@#$%'( )

    translated parameter values...

    and nvl (sn.c_attribute1,'x@#$%') in nvl ('SPRT''GOOD' 'BAD' 'x@#$%') -NVL does not parse the value correctly

    Any idea on how to get NVL recognize 'x@#$%' , if p_desig is null?

    Thank you

    Scott

    HI, Scott.

    Whenever you have a problem, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements) of all the tables involved, so that people who want to help you can recreate the problem and test their ideas.

    Also post the results you want from this data, as well as an explanation of how you get these results from these data, with specific examples.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

    My best guess, based on what you posted bone is present, that your problem is discussed in the following:

    http://tkyte.blogspot.com/2006/06/varying-in-lists.html

    http://www.Oracle-base.com/articles/Misc/DynamicInLists.php

  • How to use the slider to avoid movements of keys?

    Hello

    first of all, I must say, I'm not a native English speaker, so please forgive me in advance. In any case, I want to solve this particular problem: I created a project in After effects, where you can add your own text, logo or anything else in the composition... What is the after effects project does, that it transforms your text or logo in metal 3D result. Also cooked up camera which moves from one position to the other. Take a look:

    The text of the inscription is "add content" (I have 4 cameras together, but I shows an example only on the first, so that you will not see the full text. The rest of the cameras are also in other publications)

    firstone.jpg

    Here you can see the exact movement of the camera. However, if someone inserts a logo or a text, which for example has 7 letters (in the next picture, it is just "content") it will look like this:

    secondone.jpg

    Here you can see how much space we have. Also, it is not appropriate to change the original size of the text in the composition to achieve the smallest gap, as we can see here. The height will be huge.

    If I could change it by myself, I could do this:

    -I'd clicked on the "2 views" button and choose display in the "front".

    -I want to select all the keyframes and after that i would go into the left window 'front' and the mouse I would move all the camera to the position I want to:

    thirdone.jpg

    The great thing about this, is that as I've selected all the keyframes and then define the line red on one of them, the cameras works even at the beginning! So that's how it will look after the fix.

    fourthone.jpg

    What the problem is, that, after the small edit I want to send this project to a small number of friends. Then, they can easily set their text or logo in. The text must at different heights, width... it will be shorter or longer. I was just wondering if you could help with some phrases, joints and so on, for in the end result, one of my friends might move with the whole camera (not only with a keyframe) using the CONTROL SLIDER. At least for x and is the axis, if the z axis is also possible, it would be awesome. Also, it does not matter the sliders how there will be .

    So basically with the help of sliders, they should achieve:

    fifthone.jpg

    So I need some useful measures. Please help me. It is very important to me. I will be so grateful! Really! (Thanks for the potential aid )

    You're average over the thought of your problem and potentially headed on a path that will cause more problems that it solves.

    If you have a camera that is already busy road and you want to change the position of the camera as a path together the best way to do this would be to create a null value and parent then the camera for the null value. Pass null and all camera movements, you have put in place will follow. None of the expressions are required. It is the best way to change all aspects of a trajectory, turning the entire path, the path to the scale or move the path on any axis.

    If you really want to use 3 sliders position to move existing keyframes to a new value value + the values of the expressions will allow you to do. Just add a sliders control of three expression for the camera layer (or any layer as the null that you use as a parent) select the name of the cursor in the ECW and press on enter and rename it. Something like this will be the result.

    Note that I also rotation and controls are resized to this configuration. Now that you have 3 sliders, you can separate the position property to null in individual values allow expressions in each property, and the value type +, then use the pickwhip to drag your cursor named which (in my example) value of X and repeat for each operation. The value + will add the value of the slider to the current value of the position of the keyframes. The expression would look like this for X:

    value + effect("x position")("Slider")
    

    If you want to use the sliders that I would use a null value, add expression controls to null to keep position, scale and rotation, the unified camera position property and then use your sliders control of expression of the null value to change your existing path. I suggest not to do it directly on the position of the camera with separate X, Y and Z values because it will change the shape of your camera path and would be more difficult to control. You'll probably also want to create a POInull camera and use this preset to bind the point the camera of interest for the null value.

    Here's a preset , you can apply to a null value which will give complete control to the trajectory of any layer animation make you the child of this null. Search Animation preset in the field of search After Effects help, if you don't know how to use, create them, then save them.

    As a final gimme, here's a project CS6 using this animation preset to control the position of null is used to change a path animation camera.

  • Using the slider for and BULK COLLECT INTO

    Hi all
    in this case we prefer to use the cursor AND the cursor with the LOOSE COLLECTION? The following contains two block this same query where used FOR the slider, the other is using COLLECT LOOSE. The task that is running better given in the existing? How do we measure performance between these two?

    I use the example of HR schema:
    declare
    l_start number;
    BEGIN
    l_start:= DBMS_UTILITY.get_time;
    dbms_lock.sleep(1);
    FOR employee IN (SELECT e.last_name, j.job_title FROM employees e,jobs j 
    where e.job_id=j.job_id and  e.job_id LIKE '%CLERK%' AND e.manager_id > 120 ORDER BY e.last_name)
    LOOP
      DBMS_OUTPUT.PUT_LINE ('Name = ' || employee.last_name || ', Job = ' || employee.job_title);
    END LOOP;
    DBMS_OUTPUT.put_line('total time: ' || to_char(DBMS_UTILITY.get_time - l_start) || ' hsecs');
    END;
    /
     
    declare
    l_start number;
    type rec_type is table of varchar2(20);
    name_rec rec_type;
    job_rec rec_type;
    begin
    l_start:= DBMS_UTILITY.get_time;
    dbms_lock.sleep(1);
    SELECT e.last_name, j.job_title bulk collect into name_rec,job_rec FROM employees e,jobs j 
    where e.job_id=j.job_id and  e.job_id LIKE '%CLERK%' AND e.manager_id > 120 ORDER BY e.last_name;
    for j in name_rec.first..name_rec.last loop
      DBMS_OUTPUT.PUT_LINE ('Name = ' || name_rec(j) || ', Job = ' || job_rec(j));
    END LOOP;
    DBMS_OUTPUT.put_line('total time: ' || to_char(DBMS_UTILITY.get_time - l_start) || ' hsecs');
    end;
    /
    In this code, I put a timestamp in each block, but they are useless, since they both launched virtually instantaneous...

    Best regards
    Val

    (1) bulk fired fresh primary use is to reduce the change of context between sql and pl sql engine.
    (2), you should always use LIMIT when it comes with bulk collect, this does not increase the load on the PGA.
    (3) and the ideal number of BOUNDARY lines is 100.

    Also if you really want to compare performance improvements between the two different approaches to sql pl try to use the package of runstats tom Kyte

    http://asktom.Oracle.com/pls/Apex/asktom.download_file?p_file=6551378329289980701

  • Healing Brush spot Editor by using the slider to adjust the size

    "Is anyway to do the 'size slider" more visible when using the Spot Healing Brush Editor "?

    On my system, the scroll bar is black and against the dark grey of the Editor screen"that makes it very difficult for me to see.

    Try to use the keys on the keyboard hook.

    [to decrease the size

    ] to enlarge

  • Using the TRIM output as a parameter for IN

    I have a CLOB containing column (for example):
    ,1074,1075,1076,1077,1078,1050,
    The idea is to use values of this field in another query as a parameter for IN selection (basically something like this:)
     SELECT columns FROM table WHERE column IN (values from previous field);
    If I run:
     SELECT columns FROM table WHERE column IN (1074,1075,1076,1077,1078,1050);
    (values entered in the statement) everything is ok. But the problem is that this original area also contains comas at the beginning and at the end.

    In order to deal with them, I tried:
    TRIM(',' FROM column)
    but I received:
    ORA-00932: inconsistent datatypes: expected - got CLOB
    00932. 00000 -  "inconsistent datatypes: expected %s got %s"
    I also tried many TO_ functions as well as CAST funtion - does not work.

    In addition, I tried
    SELECT DBMS_LOB.SUBSTR(TS_FAULT_REPORTS,DBMS_LOB.GETLENGTH(column)-2,2)  FROM table;
    but received error
    ORA-01722: invalid number
    01722. 00000 -  "invalid number"
    No idea how to solve this problem?

    Hello

    Welcome to the forum!

    So, you have a subquery which produces a string separated by commas, like ', 1074,1075,1076,1077,1078,1050,': is that correct?

    The best solution might be to change the subquery so that produce a result set with each item on a separate line. Who can actually do the subquery simpler and more effective.

    If you don't really have to use the comma-separated string, see the following links for dynamic IN-lists:
    http://tkyte.blogspot.com/2006/06/varying-in-lists.html
    http://www.Oracle-base.com/articles/Misc/DynamicInLists.php

    You coul also convert your string table number and use INSTR to see if it exists in the list:

    WHERE     INSTR ( comma_delimited_string
               , ',' || column_x || ','
               ) > 0
    

    Extra commas are to avoid the problem of 'the mother's in chemotherapy If column_x is 1 (or 0, 107, or 7, or 74 or 4) you don't want that corresponding to '1074'.
    This assumes that comma_delimited_list already begins and ends with the delimiter, as in your example. If this isn't the case, you can add them manually.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all tables and also post the results desired from these data.
    Always tell what version of Oracle you are using.

    You will find the answers better faster if you always provide this information whenever you post a question.

  • How to use the type of packages, procedures and functions in another schema?

    I have two schema target in an OWB project, such as A and b. In a map of A, I would use some packet types, functions and procedures of B. I tried the method of the suggested such synonym, but I couldn't find the metadata of these when importing... The only type of synonym I can import is the synonym for the table. Y at - it a bug for synonym?

    If I can't use a synonym for that matter, is there another way to solve the problem?

    Now, in some cases you will absolutely need to create the second module as Carsten described, but it should also be noted that you can reference objects in things like Expressions even if you have not loaded the metadata. It's only when you need strong bonding that it becomes necessary to import objects. For everything else, as long as the reference can solve during the compilation so you are good to go.

    For example, I target a function in a schema (S1) and a synonym private that it in another (s2). A mapping of the S2 schema has an expression object that uses the synonym of the function in the expression property for a couple of the attirbutes of output. The synonym has not been loaded in metadata - OWB has indeed no knowledge of its existence. But she is resolved at compile time if the mapping validates and generates successfully.

    Mike

Maybe you are looking for