Cursors in VIEWS

Hi...I have created a VIEW, currently I am using static values for some comparisons but now I need to get these values from a variable, is it possible for me to make use of a implicit cursor to get these values..if not is there any other way to do so.
I am using views bcus the details in the table are millions of records so I cannot make a procedure or function for the same.And based on these Views result I am making use of another Main Query which makes my retrieval faster.

> See I have a View which is selecting some records now inside that I am passing a
Date value in a where clause which is static at the moment which i need to change to a
cursor.
Why? Each and every single SQL that hits the SQL engine are parsed - and if successfully parsed, turned into a cursor. View or no view.
So what is the problem that you need to define an explicit cursor?
Also, wanting to pass "input values/parameters" via the SQL language is missing the fact that SQL is NOT a procedural language!
One pass values to SQL using (bind) variables inside the SQL statement - typically used in the WHERE condition. That is how SQL has been designed. That is how it is to be used. Not as parameterised procedural units.
You need to put aside your "procedural programming skillz" when it comes to SQL. SQL simply does not work that way. And likely why so many developers keep on getting SQL horribly wrong as they never understand and appreciate the nature, power and flexibility of this special language.

Similar Messages

  • Z-Cursor aus View-Kontu​r mit Script auslesen

    Hallo.
    Ich würde gerne den Z-Cursor-Wert (VIEW => Kontur / Diadem 2010) auslesen.
    Die X und Y Werte kann ich mit VIEW.Active.Sheet.Curser.X1 bzw Y1 auslesen. Für den Z Wert ist diese Funktion nicht verfügbar
    Gibt es eine Lösung?
    Danke für die Hilfe

    Hallo Jost1,
    einen solchen Cursor gibt es auch nicht. Der Z-Wert wird mit der Funktion ChVXYZValue bestimmt. Weitere Infos findest du in der Hilfe.
    Gruß
    Walter

  • 26.4 Basing an entity Object on a PL/SQL Package API - Ref Cursor, no View

    I am hoping that I could get some help in the details of a problem. I am trying to follow the directions in the Oracle Application Development Framework Developer's Guide for Forms/4GL Developers, Section 26.4 - Basing an Entity Object on a PL/SQL Package API.
    There is example code in the downloadable AdvancedEntityExamples - EntityWrappingPL/SQLPackage
    The question is, how will the implementation change if the entity is based entirely on PL/SQL - simply stated - no view is available, just ref cursors and insert,update,delete procedures.
    In the example code, there are two procedures, lock_product and select_product. This is where things get more complicated. I can create a function to return a single record ref cursor, instead of the list of OUT variables defined in both functions (select_product and lock_product). It makes sense that I just return one cursor and get all of the columns from that instead of lots of OUT variables.
    So what's stopping me you may ask... There is one difference between select_product and select_lock. Select_lock has a select that includes "FOR UPDATE NOWAIT". I don't have that as an option when creating my ref cursor. I am not sure what the impact of "FOR UPDATE NOWAIT" is? Can I ignore it?
    In the problem I am working with, (getting data from Oracle Portal 10.1.4) I return the following:
    function getRefCursor return ref_cursor is
    v_tab wwsbr_all_items_object_type := wwsbr_all_items_object_type();
    p_recordset wwsbr_types.cursor_type;
    l_results wwsrc_api.items_result_array_type;
    begin
    wwctx_api.set_context(<username>,<password>);
    l_results := wwsrc_api.item_search(.. parameters..);
    <snip>
    ... Loop through the objects and populate v_tab
    <snip>
    open p_recordset for
    select * from table(cast(v_tab as wwsbr_all_items_object_type));
    return p_recordset;
    end getRefCursor;
    With this sample, it would be easy to return a single row by passing the masterid as a parameter.
    So I am still left with, how should the implementation of callLockProcedureAndCheckForRowInconsistency() and callSelectProcedure() be changed in order to use a ref cursor instead of a view? The user guide was missing that extra section <bg>.
    What would be REALLY helpful, is an example, say 26.4A that demonstrates creating an entity object from a ref cursor and procedures from PL/SQL only without a view.
    Thank you, Ken

    The lock procedure is expected to obtain a row-level lock on the row, given its key.
    Depending on the setting of jbo.locking.mode, the entity object's lock() method will be invoked either as soon as the first persistent attribute is successfully modified by the user (in the case of jbo.locking.mode=pessimistic), or it will be called during commit processing just before the row is updated in the database (with jbo.locking.mode=optimistic).
    Usually 2-tier Swing applications use pessimistic mode, while web applications use optimistic mode.
    The FOR UPDATE NOWAIT is the Oracle clause that can be appened to a SELECT statement to acquire a row-level lock on the selected rows. The NOWAIT modifier means that rather than hanging, waiting for a row locked by another user to free up, it will raise an exception if any of the rows being selected-and-locked are not available to lock.
    If you're not able to work the FOR UPDATE NOWAIT into the syntax of the ref cursor, perhaps you can initially perform the lock using a different cursor inside the stored procedure, then return your ref cursor.

  • Child Report Cursors Are Not Being Closed

    A SQLDeveloper report with a running defined child report with a Refresh rate of 5 or more seconds will eventually exhaust the session's max_open_cursors and will crash with "ORA-01000 maximum open cursors exceeded". This is true whether it is the parent or child report which is refreshed.
    In my case, max_open_cursors is set to 600 and the refresh rate is 5 seconds; it takes approximately 50 minutes or less for SQLDeveloper to crash.
    Tracking the open cursors by viewing V$OPEN_CURSOR for the report SID clearly shows that the number of child report cursors keeps growing at approximately one cursor per refresh rate. From this it is very clear that SQLDeveloper is not closing those child report cursors and I have found no way to work around this problem.
    BTW, congratulations to the SQLDeveloper team for an overall really good product at an excellent price. Still a bit buggy but otherwise quite enjoyable to use.
    Jerry

    How are they connecting? What Service?
    Any particular APPs that do this? Adobe perhaps?

  • Obtaining a weakly typed cursor variable's field list

    In a situation where a weakly typed cursor variable is passed to a procedure, after having been previously opened, is there any way to find out what the field names or aliases are that make up the underlying cursor? Is this information available in some dynamic view?

    Try:
    select view_name from dba_views where view_name like '%CURSOR%';
    The views you may be interested in are gv_$open_cursor and v_$open_cursor. Both have a column named SQL_TEXT that will at least give the statement the cursor is executing.
    Hope this helps.

  • Programati​cally set flags in a DIAdem View

    Is there a command to set flags for a 2D axis system in a view? I would like to automate the process of setting flags for a curve, copying the points, and creating a report with a graph of the copied data and a table of that data. I can do the report I just need to be able to set the flags prgramatically once the users sets the band cursors where he/she wants.
    Thanks,
    AJL

    Hi AJL,
    Currently it is not possible to set VIEW flags via script. But, if your customer has selected the band width you know all necessary parameters.
    View.ActiveSheet.Cursor.X1
    View.ActiveSheet.Cursor.X2
    With pno you can determine the row in a data channel with contents closest to a given value. Example:
    iRowStart = pno(NameOfXChannel, View.ActiveSheet.Cursor.X1)
    iRowStop = pno(NameOfXChannel, View.ActiveSheet.Cursor.X2)
    Then you can use DataBlCopy to copy the selected area.
    Greetings
    Walter

  • Moving Markers with Clips in Multitrack View?

    Say for example I want to set a marker at 10:50 on a clip in Multitrack view, but then I move the clip forward by 5 minutes.
    To my knowledge, the only way I can set a marker is if I set it on the Multitrack itself, and not the clips within the multitrack...which results in the marker staying at 10:50 even though I'd like it to move to 15:50
    Is there a way to set a marker on the clip (without going into the clip's waveform) so that it'll move around with any changes?
    Basically, I'm looking for the same functionality present in After Effects when you press Numpad * on a layer and it creates a marker relative to that time in the layer, rather than an 'objective' marker in the scheme of the entire multitrack.
    Thanks!

    No, I think the only way to do it is to add the Marker in the Waveform Edit view. But make sure that Synchronize Clips with Waveform Editor is turned on in Preferences/Multitrack Clips so that the Play Head cursor and view remain synced in both views.

  • Moving multiple markers at once in multitrack view

    I've got a track I'm cutting an animation to in AE - it's actually a mix of two different tracks so I've created it in the multitrack view. I've put markers for the start of each bar so that when I export it as a WAV file I can see these in AE and use them as guides.
    I've had to chop four bars out of the mix during a breakdown section which was a bit ambient and didn't have markers in it, which now means that all my markers are 4 bars too late. I don't think it's possible to move a bunch of them at once, is it? The ideal thing would probably be to select them all in the markers window, and then be able to roll back the timecode on any of them so that all of them move by that amount (a bit like repositioning a load of layers in AE).
    In this instance it's not a biggie because none of the markers are named so I can just create a few to fill in the gap, but it'd be a useful little feature to have.

    No, I think the only way to do it is to add the Marker in the Waveform Edit view. But make sure that Synchronize Clips with Waveform Editor is turned on in Preferences/Multitrack Clips so that the Play Head cursor and view remain synced in both views.

  • Cursor cache - Time. what is this time

    Administration -> manage session -> Cursor cache - > Time.
    I have a question about this time?
    I ran a report and viewed its log through(Administration -> manage session -> Cursor cache-> View Log) . This report had no previous cache entries, because I cleared them all.
    The time shown for this report under (Administration -> manage session -> Cursor cache - > Time) says 18 seconds.
    I am sure when I clicked on the tab that has this report it took less than 4 seconds for the page to load with this report on it.
    So I wasn't sure what this time actually is? When I look into the log ( for this particular report), one of the line at the end of the log says
    [2012-03-09T15:50:04.000+00:00] [OracleBIServerComponent] [TRACE:2] [USER-33] [] [ecid: d01cd216d41a2bc8:bf26dbb:13549056e05:-8000-00000000005b8cad] [tid: 44ded940] [requestid: 7ee0096] [sessionid: 7ee0000] [username: -2327690837] -------------------- Logical Query Summary Stats: Elapsed time 23, Response time 18, Compilation time 1 (seconds) [[
    But the report gave back results surely in less than 18 seconds, so what this time indicates?

    Hi I had this on my bank statement too. I believe TCCP stands for Town Centre Car Parks. I parked near the Royal Armouries for several hours which cost me £10. If it had said carpark on my statement it would have saved me a lot of exploring on google as I, like you had forgotten what the charge was for. Hope this helps.
    The carparks run by TCCP are as follows and you may have visited one of them and payed by debit card:
    Merrion Centre & First Direct Leeds Arena
    Templar Street & Edward Street, Leeds
    7 Whitehall Road, Leeds
    9 Whitehall Road, Leeds
    Clarence Dock, Leeds
    1 Port Street, Manchester
    33 Tariff Street, Manchester
    30 Tariff Street, Manchester
    21 Ducie Street, Manchester
    75 Dale Street, Manchester

  • DIAdem view scroll mode

    Hello,
    I am currently working with DIAdem 9.1 and would like to perform the following task in DIAdem VIEW but am not sure how:
    I want to be abble to zoom into a section of my plot and once I'm zoomed in I want to be able to scroll along to the end of the plot. In version 8.0 there use to be a selection in the "View" menu for doing this but can't seemed to find the equivalent in 9.1...I found some instructions in the help file about performing a "dynamic" zoom but have not been able to get that to work either.
    Thanks
    Lancer

    Hi Lancer,
    Before using Dynamic Zoom (Menu -> View -> Zoom in cursor area) you must select Band or Frame Cursor (Menu -> View -> Cursor) first.
    Christian

  • Long vertical forms that scroll with the tabbing to keep cursor on screen

    I have a tall vertical form that is roughly 2000px in height.
    If the user tabs through the fields they will 'fall off' the bottom
    of the screen. Meaning, the cursor will move to a field out of view
    but the scrollbar will not nudge down automatically to compensate
    and keep the cursor in view. Ideally the scrollbars would move with
    the cursor as they do when tabbing through a traditional html form.
    Any help is appreciated. Thanks.
    --Lokesh

    I have had to do this very thing myself. Kinda wish it were
    part of the normal framework...
    anyway, here is an example application that does what you are
    trying to do:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    private function checkPos(target:Object=null):void {
    var yPos:Number = target.y+target.height;
    debug.text = "";
    var shiftAmt:Number = 0;
    if (yPos>cont.verticalScrollPosition+cont.height) {
    shiftAmt = yPos-(cont.verticalScrollPosition+cont.height);
    debug.text+="move down: "+shiftAmt+"\n";
    } else if (yPos<=cont.verticalScrollPosition) {
    shiftAmt = yPos-(cont.verticalScrollPosition+target.height);
    debug.text+="move up: "+shiftAmt+"\n";
    cont.verticalScrollPosition+=shiftAmt;
    debug.text+="yPos: "+yPos+" view space:
    "+cont.verticalScrollPosition+" -
    "+(cont.verticalScrollPosition+cont.height);
    ]]>
    </mx:Script>
    <mx:Text id="debug" width="200" height="200" />
    <mx:Canvas id="cont" width="200" height="200">
    <mx:Button label="blorch1" y="0"
    focusIn="checkPos(event.currentTarget)" height="20" />
    <mx:TextInput focusIn="checkPos(event.currentTarget)"
    y="100" height="20" />
    <mx:Button label="blorch2" y="200"
    focusIn="checkPos(event.currentTarget)" height="20" />
    <mx:TextInput focusIn="checkPos(event.currentTarget)"
    y="300" height="20" />
    <mx:Button label="blorch3" y="400"
    focusIn="checkPos(event.currentTarget)" height="20" />
    </mx:Canvas>
    </mx:Application>
    If your form has a TON of controls, then you might want to
    just make a function to automatically attach the listener in
    actionscript... dunno which is easier. Writing onFocus="blahblah"
    for each component is a drag but it's simple...
    If there is an easier way to do this, I hope someone will say
    so because this is how I have to do it and it's not very
    fun.

  • Link editor to video playback?

    Does anyone know how to link edit functions with playback from the video track? In Pro Tools and Soundtrack Pro you can move or trim a clip and the video playback immediately jumps to where you're performing your edit. This way you can get spot effects in exactly the right place really quickly. I'm a total beginner in Audition, so forgive me if this is really obvious and basic. (I have spent three hours on this now, though!)

    Have you successfully opened and inserted the video on a separate video track in Audition's Multitrack view? You have to be editing the audio in the Multitrack view in order for your editing cursor to be in sync with the video. Although there are some settings in Audition's Preferences to synchronise cursors across views which might help you achieve what you want. "Preferences/General/Synchronize selection etc. across files in Waveform view" and "Preferences/Multitrack Clips/Synchronize clips with Waveform editor".

  • Arrangement of icons in a folder not saving on reboot....

    Hello - I'm posting this here as recommended - didn't get an answer on another forum.
    Hi - first problem with my year old mac, and first question here. Apologies if this one has been answered already - I looked through a few pages of the forum, but not all of them.
    For some reason one or maybe 2 of my folders has stopped remembering how I've arranged the icons. This only happens when I restart the computer - otherwise the icons stay where they are. Also the background gets reverted to the default state on reboot. This only happens with my main hd folder - the one in the top right of the screen, and maybe my applications folder, although I haven't checked that one thoroughly.
    It could be that the ds.store file is getting hosed somehow on reboot - any ideas why this might be happening?
    This is a single user computer, btw.
    Steve

    Hi Again Steve!
    Same answer in other thread.
    See if this Making Finder window views persistent, authored by Scott Radloff, helps.
    Also, positioning icons, too close to the edge of the window, will cause them to reposition themselves on restart.
    Positioning them too close to each other, will cause this as well.
    Depending on how many icons are displayed, the Size of the icons, as well as the Text size & Label position can also factor in. Experiment with these settings.
    My folder icons usually do not reposition themselves, and this is how I have my View Options set.
    Icon size: 32 x 32
    Text size: 12 pt
    Label position: Bottom
    I have none of the following options selected.
    Snap to grid
    Show item info
    Show icon preview
    Keep arranged by
    A different configuration may work for you. Experiment with the options until you find something suitable.
    With the folder window open,
    From the Finder's Toolbar, position your cursor over "View" and pull down to "Show View Options", and click. Or use the Command + J keys.
    ali b

  • Need help in multisim 11? I want to get the transient response of RL circuit....

    Need help in multisim 11?
    I want to get the transient response of RL circuit....i can get the increasing exponential graph in multisim 7 during simulation.....but i am getting a decreasing exponential curve(i.e,decay response) in multisim 11 when i do the same procedure as i did in multisim 7.....how can i get the initial or growth transient response for RL circuit in multisim 11 so that i can get increasing exponential curve....which satisfies time constant = L/R

    Hello,
    The process is the same for any circuit (in this case it is an RC circuit which you sent me). You can find the response on the voltage (which I think it's what you're looking for) at any point of the circuit, as well as any parameter really (R,V,I,L..etc).
    Please refer to the image attached (an analysis on the voltage at an inductor and the wires connected to it).
    The way to set it up (once you're in the transient analysis set up) is, select the Output tab, under Variables in circuit, you can select which parameters to take. V(1) and V(2) refer to the voltage in the circuit at Net 1/2 (or wire 1/2).
    This differs from the voltage change within the capacitor/inductor/resistor. If you would like to see the voltage change of an inductor/capacitor/resistor/etc, you can select under the More options box, the button Add device/model parameter, which will take you to a window to select the device type, its name (in the circuit) and the parameter which you wish to analyse. Once you click on Simulate, you can select Cursor >> Show Cursors, to view information for y and x axis (like rise time, decay time, voltage difference...etc)
    Hope this helps,
    Miguel V
    National Instruments
    Attachments:
    untitled.jpg ‏178 KB

  • How to find sql causing "enq: TX - row lock contention"

    Hi,
    In one of our database we keep finding "enq: TX - row lock contention" for 2-3 days. But, then it stopped. The time it happened it blocked other sessions for some long time and it got resolved automatically. Now from ADDM report we got sql queries which waited for this but, we can not find which query from which module was causing the issue. What I should look for that past information. Please help.
    Database is 10gR2 on AIX.
    Regards,
    Gourab

    moreajays wrote:
    Try executing below query real time
    alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';
    SELECT  vp.spid,c.inst_id,b.session_id sid,c.serial#,a.object_name,
    a.owner object_owner,
    Decode(b.locked_mode, 0, 'None',
    1, 'Null (NULL)',
    2, 'Row-S (SS)',
    3, 'Row-X (SX)',
    4, 'Share (S)',
    5, 'S/Row-X (SSX)',
    6, 'Exclusive (X)',
    b.locked_mode) locked_mode,
    b.oracle_username,
    c.program,
    d.event,
    c.status,
    c.last_call_et,
    c.sql_address,
    e.sql_text, c.logon_time
    FROM   all_objects a,
    gv$locked_object b,
    gv$session c,
    gv$session_wait d,
    gv$sqlarea e,
    gv$process vp
    WHERE  a.object_id = b.object_id
    and b.session_id=c.sid
    and c.sid=d.sid and c.paddr=vp.addr
    and e.address=c.sql_address and lower(d.event) like '%enq%'
    ORDER BY 1;
    The OP asked for a way of find a historic blocker, not a current blocker.
    This query - apart from being one that no-one should want to run on a production system - doesn't say anything about the past, and doesn't identify a blocker.
    It reports the sessions that are being blocked, and EVERY table that is currently locked by each session whether or not the table is involved in the current statement.
    You're using the gv$ (RAC) views but haven't put in any suitable join predicates on the instance (inst_id) columns; the OP is on 10g so you don't need to join to v$session_wait to pick up the wait information; and the join to v$sqlarea forces a "full tablescan" of the library cache (child cursor derived view) because you're joining on address rather than sql_id.
    Regards
    Jonathan Lewis

Maybe you are looking for

  • How do I get the artists name to appear under the song?

    In the iTunes it is not showing the artists name under the song if I type anything different like my name or some other artist It is shown but when I type the artist it is not shown how do I fix this problem?

  • How to open PageMaker files in InDesign?

    It seems that this possibillity is taken away although it is told in the helpfile that it is possible. You can´t chose PM file type in Open files.

  • Canon CRW Raw files not supported in Preview, Nikon supported

    With Panther and Jaguar, Canon RAW files in crw format were supported in Preview. In Tiger, these files are not. Also, when importing these files from camera or CF reader, canon raw files tagged with .thm! What is this? an 8 kb "document" that render

  • SUS PO response in status 'out of date' SRM 7.0

    hello, after creation of PO response by vendor on SUS it always goes into status 'out of date'  and the message occurs when buyer wants to confirm this PO response - "PO XXXXXXX  has change version, hence POR changes cannot be copied to PO".  however

  • Putting a date in two calendars?

    here's one more question i have about 8 different calendars set up in ical. one for business appointments that apply to both myself and my associate, one for family appointments etc. I have it set up so that they sync via my .mac account. what i ofte