SQL developer to debug a cursor data ?

In the SQL Developer, how to debug a cursor ? In the debug mode, can I see its data what the cursor points to ?
Thanks
CURSOR C_EMP (DEPT_NUM_1  NUMBER)
    IS
    SELECT E.EMPLOYEE_ID, E.LAST_NAME, D.DEPARTMENT_NAME
    FROM EMPLOYEES E JOIN DEPARTMENTS D on(D.DEPARTMENT_ID = E.DEPARTMENT_ID)
    WHERE 
    D.DEPARTMENT_ID = DEPT_NUM_1;

>
In the SQL Developer, how to debug a cursor ? In the debug mode, can I see its data what the cursor points to ?
CURSOR C_EMP (DEPT_NUM_1 NUMBER)
IS
SELECT E.EMPLOYEE_ID, E.LAST_NAME, D.DEPARTMENT_NAME
FROM EMPLOYEES E JOIN DEPARTMENTS D on(D.DEPARTMENT_ID = E.DEPARTMENT_ID)
WHERE
D.DEPARTMENT_ID = DEPT_NUM_1;
>
A cursor is a definition and not executable code so there is nothing to 'debug'. That would be analogous to saying you want to 'debug' a query. What does that even mean?
What do you mean by 'see its data what the cursor points to'?
Do you mean see the query underlying the cursor? Then no - you cannot do that.
You can fetch the data or, using dynamic sql you could describe the result set to see what column names and datatypes will be returned but there would be no information about where that data actually came from.
This question isn't really a sql developer question but when you have one of those you should post in the sql developer forum at
SQL Developer

Similar Messages

  • SQL Developer can't commit edited data in Table Data pane

    When I try to commit changes in "Data" pane for selected table SQL Developer gives me a strange error:
    One error saving changes to table "TABLENAME".:
    Row XXX: Data got commited in another/same session, cannot update row.
    I can see in the log that SQL Developer tries to do something like:
    UPDATE "TABLENAME" set "COLUMN"="value1" where ROWNUM="xxxx1" and ROW_SCN=nnn1;
    UPDATE "TABLENAME" set "COLUMN"="value2" where ROWNUM="xxxx2" and ROW_SCN=nnn1;
    UPDATE "TABLENAME" set "COLUMN"="value3" where ROWNUM="xxxx3" and ROW_SCN=nnn2;
    If I update the same rows in SQL window by other condition and do commit - all is OK. Why so strange behaivour?
    My table has not a primary key and no other users try to change it. SQL Developer version 3.0.04 and Oracle 10.2.0.4 Linux.
    Best regards,
    Sergey Logichev

    That's because the inaccuracy of ROW_SCN.
    I suggest you turn off Preferences - Database - ObjectViewer - Use ORA_ROWSCN (as I did the very moment we got the option).
    Have fun,
    K.

  • Error in sql developer while debugging

    Hi
    When Iam trying to debug my procedure in sql developer tool
    I getting this below error.
    *Connecting to the database Prodcopy Connection.
    Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
    Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '172.16.35.228', '4000' )
    ORA-30683: failure establishing connection to debugger
    ORA-12535: TNS:operation timed out
    ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
    ORA-06512: at line 1
    Process exited.
    Disconnecting from the database Prodcopy Connection.*
    I given privilage to the following cases .
    grant debug connect session to PRODCOPY;
    GRANT DEBUG ANY PROCEDURE to prodcopy;
    Please help me to resolve this problem.

    It probably means that there is a firewall between the database server and your PC. The database needs to be able to communicate with your PC on the address and port number specified. '172.16.35.228', '4000' .
    Confirm that the address is actually your PC and then see what you can do about getting the 4000 port opened on a firewall.

  • Just downloaded SQL Developer today, need help copy data

    How do I import data from Oracle XE to an Oracle server by using SQL Developer?

    Probably a better option would be use the export and import utilities provided with the database.
    From within SQL*Developer you can export data as either a csv file (and then use sql*loader to load it), or as insert statements which you can run in in either sql*developer or sql*plus.
    To export data in sql*developer, right-click on a table or a result set.
    Search for Export Table Data in the help system

  • SQL DEVELOPER 1.5.3: Export Data options for using SQL to write SQL?

    I write a lot of SQL that generates SQL. In a competitor's product, I can export query results (Export > Save As > Tab Delimited) to the clipboard, paste the generated SQL into a new window, then execute the generated SQL.
    In SQL Developer, using Export Data > Text to the clipboard, it's delimiting each row with double-quotes. Is there any way to turn this behavior off to achieve what I want? Or should I be choosing a different export format?
    For now, I can do a search/replace to eliminate the double-quotes,
    Thanks.
    Dana

    Dana,
    I probably haven't done this with generating thousands of SQL lines, but I have certainly used the Ctrl-A, Ctrl-C (or Ctrl-Shift-C to get headers) to copy thousands of records of result data. Note that the Ctrl-A forces a fetch of all remaining records that have not yet been fetched, which may add to the time taken by the process - for example, running the query fetches the first 50 records and then Ctrl-A will fetch the remaining records as well as selecting them all, however long that takes. Also, there is a noticeable delay with the Ctrl-C for thousands of records - only rough counting but I was seeing a UI freeze for ~ 4 seconds when copying 10000 records from a query with around 30 columns in it (pasting the clipboard into a file produced a file just under 4MB).
    theFurryOne

  • Sql developer could not fetch any data while running queries?

    I have  downloaded  SQL Developer , install jdk1.5.0_22  from the website. Then I run sqldeveloper.exe browse the jdk folder. After that i established the connection but it continuously showing loading..No tables No procedures are loaded . what should i do?

    Be careful... SQL Developer requires a JDK or the server JRE (which I believe only comes in 64-bit, so go with the JDK if you are on a 32-bit OS).
    Prior to 4.0, the SetJavaHome line in your install directory's sqldeveloper.conf (or sqldeveloper-Darwin.conf on the Mac) must be set, but in 4.0 and above that changes to product.conf under your OS's user settings.  For Windows 7, that would be in...
    C:\Users\<your-userid>\AppData\Roaming\sqldeveloper\1.0.0.0.0\product.conf
    Hope this helps.  If not, assuming Windows, run sqldeveloper.exe in the bin directory from a command line console so you can see any standard error output in the console, or do a Ctrl-Break to get a full thread dump of what's happening in the JVM.

  • SQL Developer: How do I copy data with Column Headers from the output grid?

    Hello,
    I am using Version 2.1.1.64.
    I run a SQL query, I get the results grid in the "Query Result" window down below. Say I get 10 rows returned, with 5 columns.
    I want to Copy this entire grid, plus the column headers/names, to the clipboard. So I can paste it under the original query to document the results of that query.
    I can't find any way to do this. I can copy/paste the results grid, but it doesn't copy the headers.
    The only way I see to do it is to go through numerous steps to Export to a TXT file, then paste that. Unfortunately, that is a lot of wasted steps if I need to do this over and over, plus, the output gets pasted in an ugly format with double quotes, etc.
    It seems like the simplest functionality is to copy/paste the entire results grid, and of course you might the headers. Why is this so complicated/impossible to do?
    (I believe Toad has the same problem. DBArtisan allows you to copy/paste the entire results, plus headers, though.)
    Any assistance would be appreciated!
    Thanks,
    John

    Ah, ok...
    I had tried that before, and it didn't work, it seemed to copy the path of filename I was using. But I think that was because I had clicked on a Column Header first, and it had asked me if I wanted to filter. I think then it lost track that it was in the grid. It's a little flukey.
    What I did now was to click on an individual cell in the output, then hit CTRL-A to select all, then hit SHIFT-CTRL-C. That gives me exactly what I want.
    Thanks very much for your quick solution, I appreciate it!
    John

  • SQL Developer - viewing table data while debugging

    Apologies if this is in the wrong forum.
    I'm using SQL Developer to debug a complex stored procedure line by line. There are a lot of inserts / updates / deletes in the procedure and I'd like to be able to view the data in the relevant tables after each statement has been run to see the effect of each statement.
    Trouble is, when I try to do this, SQL Developer shows the contents of the tables as if they have been unaffected by the stored procedure. Is there a setting somewhere or some type of locking I can use to see the data changes as they happen?

    Only the session that is inserting the data can see that new data until the session issues a commit, so I would doubt that you could do this. You probably want to a) view the data before the insert or b) (ugly but should work) put a trigger on the table being inserted so it inserts a copy of the data to a tracking table. This procedure will have to have the AUTONOMOUS TRANSACTION pragma in order to not be held until your debug session commits.

  • Oracle SQL Developer Data Modeler Versus SQL Developer

    Friends,
    I'm trying to understand the differences between Oracle SQL Developer Data Modeler and the ability to use the Data Modeler in SQL Developer.
    I've looked at both products home pages on OTN, http://www.oracle.com/technology/products/database/datamodeler/index.html & http://www.oracle.com/technology/products/database/sql_developer/index.html and would appreciate your comments on my findings so far
    1) The Oracle SQL Developer Data Modeler is a stand-a-lone chargeable product whereas the use of the Data Modeler functionality of SQL Developer is free
    2) The Data Modeler functionality within SQL Developer is basically a "viewer" I can create ERD's of my existing tables by dragging them into the modeler from the object navigator but that's about it. I can't save the diagram for later use or use it to change the structure of the table(s)
    3) If I need to have "Oracle Designer" like ERD capabilities then I need to use Oracle SQL Developer Data Modeler (after purchase!)
    4) Are there any other differences I have missed?
    Thanks in advance

    You can open any diagram created in the stand-alone product in the SQL Developer Data Modeler Viewer and navigate through all property dialogs and the full navigator, just like you can in the stand-alone product, but with no update capabilities. This allows developers to fully review the model and all properties, without making changes.
    Sue

  • 30EA2 - SQL-Developer 3.0.02 Another Table Data Sort Order Bug

    Although the "30EA1 - SQL-Developer 3.0.02 Table Data Sort Order Bug" still exists in 30EA2, there is a new substantial mistake.
    How to see it:
    Open table1 (Preference "Automatically Freeze Object Viewer Windows" is set). Click data.
    Open table2. Click data.
    Go back to table1. Click Sort. => You see the columns of table2. The is no way to sort table1, before you close the table2 window (tab).
    Edited by: oestreicher1 on 01.12.2010 04:54

    Logged Bug 10358797 - ea2: grid sorter shows wrong columns
    -Raghu

  • Viewing CLOB data in sql developer

    In SQL Developer 1.1, if CLOB data was returned from a query, you could place your mouse over the column and get most of it.
    But in 1.2, all you get is "(CLOB) <some data> ...", and nothing else. Is there something I need to set?

    You should look in the SQL Developer forum. I think your question is answered here:
    How to view the entire CLOB in results table?
    Regards Nigel

  • Will SQL Developer support data type anydata

    Will SQL Developer support datatype sys.anydata in future releases?
    Currently SQL Developer will not show any data for columns of type anydata.
    Example:
    create table t1 (id number, col1 sys.anydata);
    insert into t1 values(1,sys.anydata.convertvarchar2('TEST'));
    IF I export data from this table something like
    Insert into T1 (ID,COL1) values (1,'SYS.ANYDATA'); will be generated.
    The grid will display 'sys.anydata' for this column
    Versions:
    WINXP SP3
    SQL Developer Version 2.1.1.64
    Build MAIN-64.39
    Ernst

    I added a feature request:
    https://htmldb.oracle.com/pls/otn/f?p=42626:39:528125578772603::NO::P39_ID:25161
    Regards,
    Ernst
    Edited by: Ernst Leber on May 31, 2010 12:36 PM

  • No more Data to read from socket from SQL Developer

    Hi,
    When I run the below query from SQL Developer, I get "No more data to be read from socket" error. The Oracle trace shows "Address not mapped".
    select LDateDayPrec, LDateMonPrec, LDateOrder, LDateOrder_cd, LDateSep, LDateYearPrec,
    LanguageCode, LanguageCode_cd, NegNumPres, NegNumPres_cd, NullNumPres, NullNumPres_cd,
    NumDecimalChar, NumUnitSep, NumUnits0, NumUnits1, NumUnits2, NumUnits3, NumUnits4,
    NumUnits5, ProfileName, SDateDayPrec, SDateMonPrec, SDateOrder, SDateOrder_cd, SDateSep,
    SDateYearPrec, TimeFlg, WeekDayPres, WeekDayPres_cd, ZeroPres, ZeroPres_cd,Nls_profile_ver
    FROM NLS_PROFILE WHERE NlsProfileId =1"
    When I run the same query on the server through SQL Plus session, the result is getting fetched properly.
    Next thing , when I select only 28 columns from the table in the above query, then also the row is getting fetched. I tried interchanging the columns. In that case also, the result is same. Also, when I do a "select * from NLS_PROFILE " , the row is getting fetched..
    Can somebody help ?

    SQL> SELECT * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE 11.1.0.7.0 Production
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    One more info: This table "NLS_PROFILE" is not on the DB where I am running the query. It is on a remote DB which is accessed via a synonym created over a DB link
    Edited by: 840203 on Feb 28, 2011 9:57 PM

  • SYS_REFCURSOR in SQL Developer

    Hello! I'm trying to execute function which returns sys_refcursor. Code is generated by Sql Developer Run command
    DECLARE
    P_DATE_FROM DATE;
    P_DATE_TO DATE;
    P_OUT_ERROR_CODE VARCHAR2(200);
    v_Return SYS_REFCURSOR;
    BEGIN
    P_DATE_FROM := SYSDATE - 10;
    P_DATE_TO := SYSDATE;
    v_Return := MONITORING.GET_MONITORING_DATA(
    P_DATE_FROM => P_DATE_FROM,
    P_DATE_TO => P_DATE_TO,
    P_OUT_ERROR_CODE => P_OUT_ERROR_CODE
    :P_OUT_ERROR_CODE := P_OUT_ERROR_CODE;
    :v_Return := v_Return; --<-- Cursor
    END;
    Function body:
    FUNCTION get_monitoring_data
    ( p_date_from IN DATE
    , p_date_to IN DATE
    , p_out_error_code OUT VARCHAR2
    RETURN SYS_REFCURSOR
    IS
    v_cursor SYS_REFCURSOR;
    BEGIN
    OPEN v_cursor FOR
    SELECT * FROM person_case;
    RETURN v_cursor;
    END get_monitoring_data;
    Unfortunately I'm receiving error every time:
    ORA-06550: line 18, column 20:
    PLS-00382: expression is of wrong type
    Line 18 is: :v_Return := v_Return;
    Everything works fine in VS Developer Tools and PL/SQL Developer
    What I'm doing wrong? Thanks in advance!

    I don't use SQL Developer, though I'm sure it must have a way of handling ref cursors.
    In SQL*Plus you would do something like...
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE
      2  FUNCTION get_monitoring_data(p_date_from IN DATE
      3                              ,p_date_to IN DATE
      4                              ,p_out_error_code OUT VARCHAR2
      5                              ) RETURN SYS_REFCURSOR IS
      6    v_cursor SYS_REFCURSOR;
      7  BEGIN
      8    OPEN v_cursor FOR
      9      SELECT * FROM emp;
    10    RETURN v_cursor;
    11* END get_monitoring_data;
    SQL> /
    Function created.
    SQL> var p_out_error_code varchar2;
    SQL> var v_return refcursor;
    SQL> ed
    Wrote file afiedt.buf
      1  DECLARE
      2    P_DATE_FROM DATE;
      3    P_DATE_TO DATE;
      4    P_OUT_ERROR_CODE VARCHAR2(200);
      5    v_Return SYS_REFCURSOR;
      6  BEGIN
      7    P_DATE_FROM := SYSDATE - 10;
      8    P_DATE_TO := SYSDATE;
      9    v_Return := GET_MONITORING_DATA(
    10                  P_DATE_FROM => P_DATE_FROM,
    11                  P_DATE_TO => P_DATE_TO,
    12                  P_OUT_ERROR_CODE => P_OUT_ERROR_CODE
    13                 );
    14    :P_OUT_ERROR_CODE := P_OUT_ERROR_CODE;
    15    :v_Return := v_Return;
    16* END;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> print v_return;
         EMPNO ENAME      JOB              MGR HIREDATE                    SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-1980 00:00:00        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-1981 00:00:00       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-1981 00:00:00       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-1981 00:00:00       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-1981 00:00:00       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-1981 00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-1981 00:00:00       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-1987 00:00:00       3000                    20
          7839 KING       PRESIDENT            17-NOV-1981 00:00:00       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-1981 00:00:00       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-1987 00:00:00       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-1981 00:00:00        950                    30
          7902 FORD       ANALYST         7566 03-DEC-1981 00:00:00       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-1982 00:00:00       1300                    10
    14 rows selected.
    SQL>So that SQL*Plus has the variables that the returned values are going to be bound to (the ones signified by the ":")
    SQL Developer should have something similar I would guess to allow the returned values to be bound out so that it can then fetch and display the contents of the ref cursor itself.

  • SPOOLing in sql developer does not take into consideration SET ECHO OFF

    I'm running SQL Developer 3.1.07.42 on Windows 7 64 bit with java 1.7
    I have the following very simple script just to show the problem:
    SET ECHO OFF;
    SET FEEDBACK OFF;
    SET SERVEROUTPUT ON;
    SET VERIFY OFF;
    SET PAGES 0;
    SET HEAD OFF;
    SPOOL c:\test.sql
    SELECT 1, 2, 3 FROM DUAL;
    SPOOL OFF;
    /if I run it in TOAD 10.6.0.42 it creates the file with
             1          2          3This is as expected (by me)
    if I run the exact same query in SQL Developer 3.1.07.42 , it creates the file with:
    < SELECT 1, 2, 3 FROM DUAL
    1 2 3(the < above is actually ">" but the CODE formatting software is screwing ">")
    but I don't want the ECHOed command to be spooled. For the life of me, I cannot find a way to disable the ECHO from spooling in sql developer.
    Tried the same in 3.0.4 and 2.1.1 with the same (bad) result (plus some warning on some of the unsupported SET commands).
    Am I missing something obvious? Cause like this, the spool command cannot be used in sql developer to generate a CSV file for example, because of the echoed command. And windows doesn't come with SED by default so that is out. (plus that my original script is integrated into a much larger and complex set of scripts and the main script using them is executed from SQL Developer as a company policy (so that everybody uses the same tool and the code runs the same for everybody))
    Any ideas/suggestions are welcome
    Thanks.

    Hi Gary, you seem to have some extensive knowledge. I'd like to follow-up on this thread and try to understand why SQL Developer won't hide the code even though I'm already running the code as a Worksheet (I assume you mean Run Script F5 button in SQL Developer).
    I generally develop in SQL Developer that does a lot of dbms_output to echo data using a Spool command. When I'm in SQL Developer I can't get the code NOT to spool, it typically is echoed directly in the spool file at the top followed by the dbms_output data. If I save the sql file and run in in sqlplus it only outputs the data (good). If I use @C:\xyz_script.sql and hit F5 in SQL Developer it only outputs the data (per your previous answer) -- good.
    So why can't I hit F5 in SQL Developer in the script file and have it only output the data? It just doesn't work no matter how many "SETs" you turn-off.
    Looks like Echo, Term, Feed are supported in SQL Developer, maybe supported means something other than work.
    http://www.oracle.com/technetwork/developer-tools/sql-developer/sql-worksheet-commands-097146.html

Maybe you are looking for

  • Shopping cart error regarding length

    Hi All, The user is getting an error " document name exceeds allowed length" and when checked, the length of the Shopping Cart is less that 20 characters even. Do you guys have any idea, what leads to this error? Regards, Ssingh

  • Skipping changes in Streams

    We're using CDC (built on Streams from what I can tell) to replicate changes from OLTP system to a data warehouse. There is a need to correct a value in a column as a mass update which will affect many rows, but we don't want to send those changes to

  • PDF export loses some hyperlinks

    Hi, I'm exporting a online magazine to PDF and some of my hyperlinks work, and others turn to text. I've noticed that the links that work are text/URLs (http://www......) and the ones that don't work are normal text (Click here to....). I'm pretty su

  • CS6 operating very slow and buggy

    A year ago in August 2013 I purchased a new Mac 12 core three point something megahertz 12 gig RAM one gig video card. I began running CS6 which I had been running for over year on my old computer no problems after upgrading I believe to maverick, so

  • How to save a TCP session ID opened and use it in another VI?

    what i want to achieve:    open a TCP session in a VI, save the session ID to Teststand, then after certain process, write/read/close the same TCP session in another VI. my question:    1. how to pass TCP session ID between labview and Teststand    2