SPEEDING UP YOUR PL/SQL DEVELOPMENT

제품 : SQL*PLUS
작성날짜 : 1997-01-09
=================================
Speeding up your PL/SQL development
=================================
By Jeff Warner
If you're doing Oracle database or application development, then you're probably using PL/SQL. Every PL/SQL programmer is familiar with
using SQL*Plus to develop PL/SQL programs. Developer/2000 offers a better way: Procedure Builder. In this article we'll explore how
Procedure Builder can improve your PL/SQL development.
It has a GUI
==========
The first feature you'll notice in Procedure Builder is the graphical user interface (GUI). Procedure Builder provides separate windows for the
Object Navigator, the PL/SQL interpreter, and the program unit editor. By the way, if you think the program unit editor looks familiar, you're
probably right. Oracle uses it inside the other tools in Developer/2000 (Forms, Reports, and Graphics). Using the Object Navigator, you can
view the relationship between your code and the library and packages. Object Navigator also provides the references and referenced-by
information, as well as giving you the ability to examine the procedures and functions that make up packages and libraries. This makes it very
easy to take advantage of existing code.
The PL/SQL interpreter is just what you'd expect. You can use normal SQL and PL/SQL commands and see the results in the output
window. You create your PL/SQL in the program unit editor window. As with any text editor, you can cut, copy, and paste as well as search
and replace text. You can also use the editor to import and export source files. However, the editor's best feature is the Compile button. Click
the Compile button, and Procedure Builder will compile your code and display any errors in the bottom of the window. Click on the error,
and your cursor will move to the offending line. This will radically improve the compile-debug-run sequence. Speaking of debugging,
Procedure Builder has something that will really make life easier for you.
A PL/SQL debugger
================
Yes, Procedure Builder includes a real debugger for PL/SQL. Its features include breakpoints, triggers, variable inspection, variable
modification, step into, step over, and step out.
Having a graphical and easy-to-use debugger can dramatically improve code development. For example, to set a breakpoint in your code,
simply bring the PL/SQL interpreter window to the front and double-click on the line where a breakpoint is needed.
Once you've set a breakpoint and executed the code, the debugger will stop the program at the breakpoint. From here, you can use Object
Navigator to view and change the variables in the program. To resume execution, you can use Procedure Builder to step into, step over, or
step out of a routine. Procedure Builder also provides an option to simply continue execution.
A powerful feature of Procedure Builder's breakpoints is the capability of adding trigger code. Trigger code is a piece of PL/SQL that
executes when the breakpoint is hit. You can use this feature to log the value of a variable to the screen or a file.
If you need a conditional breakpoint, you can use a trigger. For example, let's say you want to stop execution only if the local variable i is
greater than zero. First, select the line where you want the check to occur and create a trigger by clicking the right mouse button on the line
and selecting Trigger. This will open the PL/SQL Trigger window. In the Trigger Body area, enter the following command to halt execution:
if debug.geti('i') > 0 then
raise debug.break;
end if;
Now the program will stop execution only when this condition is valid. You can also use the Trigger Body of a trigger to log information to a
file or a screen.
Debugging server-side programs
===========================
The version of Procedure Builder shipped with version 1.2 of Developer/2000 is V1.5.5.7.0. Unfortunately, it doesn't allow you to directly
debug programs on the server (this is planned for a future version). However, with the click-and-drag partition feature of Developer/2000,
you can use Object Navigator to drag the program unit from the server to the local program unit and debug it there.
Lots of help
=========
Procedure Builder includes extensive help under Windows. In addition to the normal help available on program features, Procedure Builder
provides help on the built-in packages as well as the PL/SQL commands to maintain libraries, program units, and packages. Also, version 1.2
or later of Developer/2000 provides the Cue Cards and Quick Tour.
Conclusion
=========
As you can see, Procedure Builder is a very powerful tool for development. The debugger is first-rate and the extensive help is a great
addition. One other nice feature of Procedure Builder is that Oracle will license it separately from Developer/2000 if you have users who don't indeed the other parts of Developer/2000. If you're doing PL/SQL programming, you should take advantage of what Procedure Builder has to
offer.

micwic --
I logged bug6508875 for this.
One suggestion in the meantime until we can get compile errors directed to the log window for offline objects...
You can open the Database Navigator to point to the same db connection. After generating the offline PL/SQL to the db, refresh the connection in the DB navigator. You will see any invalid objects flagged with an error icon. Then you can right-click on the PL/SQL with the error, and "Make" it. This will display the errors in the log window, similar to SQL Developer.
-- Brian

Similar Messages

  • Different results on timestamps in SQL developer

    Hi
    I have this table with a TIMESTAMP column in it.
    CREATE TABLE my_table ("TID" TIMESTAMP (6) NOT NULL ENABLE);
    I use this query in SQL developer:
    SELECT tid from my_table;
    There is one row in the table, that has a timestamp in the hour of the change to european summertime.
    The timestamp of this row is displayed differentliy in SQL developer:
    - when the query is run by 'run stamement' (Ctrl+enter) the result is
    11-03-27 03:17:00,000000000
    - when the query is run as a script (F5) the result is
    11-03-27 02:17:00,000000000
    Notice the difference in the hours of the timestamp.
    Why this difference? (It only occurs for timestamps within the hour of 2 am to 3 am on that date - the hour that should'nt exist as the clock advances from 2 am to 3 am that night...)
    What is actually stored in the database? (the 3.17 am or 2.17 am value)
    Is there a conversion taking place when running as a script in SQL developer, but not when just running the single stamement?
    Regards Søren

    Hi Søren,
    This is rather an "edge" condition error, but I have posted an internal bug for it:
    Bug 13088622 - FORUM: RUN SCRIPT/STATEMENT TIMESTAMP VALUE DIFFERS DURING DT/ST CHANGEOVER
    Please provide some version information about your environment: SQL Developer, Java JDK, OS, etc.
    Regards,
    Gary
    SQL Developer Team

  • SQL developer

    Can anybody help me out with setting a repository in SQL developer... for version controlling. What i want is to set a repository connection on a server with the repository folder in another server. Any answers that would be helpful ...

    There is a forum dedicated to SQL Developer. Try asking your question SQL Developer.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • SQL Developer BRIDGE command from command line on Windows environment

    Is it possible to call SQL Developer BRIDGE command from command line on Windows environment?

    Hi <please supply your name>,
    SQL Developer Worksheet is not available from the command line.
    The BRIDGE command is only supported in the Worksheet.
    Its an interesting idea though. Are you trying to script data move from a non Oracle database to an Oracle database using the BRIDGE command?
    The BRIDGE command was initially done to allow a simple data move from a non Oracle database to Oracle. We then build the "Copy to Oracle" feature out of it.
    http://dermotoneill.blogspot.com/2010/11/cross-database-bridge-statement.html
    http://dermotoneill.blogspot.com/2010/11/copy-to-oracle.html
    Since the BRIDGE command references connection names, which have to be defined in UI of SQL Developer any solution to run this on the command line would have to work this out.
    There are number of ways you can do this without using the BRIDGE command.
    1) Perform a capture/convert of your non Oracle database and then generate the "offline" data move scripts.
    Theses scripts use SQL*Loader and your non Oracle database tool (Ex: Sybase BCP).
    These are run from the command line and can be modified ....
    2) Use a database link from your Oracle database to your non Oracle database and reference /query the data that way.
    I would interested to hear your thoughts.
    Regards,
    Dermot
    SQL Developer Team.

  • MSVCR100.dll missing on your computer when starting SQL Developer

    Hello,
    I receive the error MSVCR100.dll is missing on your computer when I try to start SQL Developer.
    I completed the following installations:
    - Windows Server 2008 R2
    - Oracle DB Express Edition
    - Java JDK 1.7.0_02
    When I now try to start SQL Developer I receive the error message that MSVRC100.dll is missing on my computer.
    Does anybody experience the same problem and how can it be resolved.
    Thanks
    Bernd

    Hi,
    Not sure what happened to that link, but I as far as I know it should make absolutely no difference for security purposes if one chooses the latest Java 7 update or the the latest Java 6 update. I would guess both code lines are patched to same level.
    Perhaps you are referring to recent press about vulnerabilities in Java 7 updates _06 and _07? Those issues only apply to browser plug-ins, totally unrelated to SQL Developer, and those can be disabled easily without removing Java.
    The official recommendation is to use the latest Java 6 update (jdk1.6.0-35) for SQL Developer. We recommend avoiding Java 7 due to bugs, but bugs unrelated to security.
    Regards,
    Gary

  • SQL Developer 4.0 Early Adopter 2 - avoid "Please amend your code to something like this" message

    When I edit PL/SQL packages or sql queries in SQL Developer 4.0 Early Adopter 2,
    when i copy/paste SQL code, sometimes "Please amend your code to something like this: "select * from when", or "begin when; end;" appears.
    Sometimes SQL Developer freezes.
    Can I avoid that message (turn off some kind of checks in SQL Developer properties)?

    This has been raised/documented fixed in future releases here:
    EA42 - Ambiguous Context Pop-up

  • SQL developer some minor anoying problems.

    Hello,
    can someone please explain to me why i have this problems in SQL developer.
    First problem is with search db objects.
    When i type in search string and i tick all objects all shemas it starts search ... finds nothing
    because search changes "search in all schemas" to "search only under connected user".
    Then i have to manually select all schemas and run search again and then it searches under all schemas.
    http://s29.postimg.org/p2vdaqxs7/shema_search.jpg
    Second problem is (i dont know if this is intended or not) that if i mix upercase letters in search string
    with lower case it wont find anything.
    http://s21.postimg.org/ke3k8icpz/found_nothing.jpg
    Third problem is when search finds something and i click on a table for example from found resoults
    it always opens up 2 tables (with same name) and again i have to manually close one of them.
    http://s12.postimg.org/s7fwmd1hp/two_tables.jpg
    4th problem is speed is there a way to really optimize SQL developer for speed. By that i mean
    that finding db objects forks really fast ... switching between tables and stuff like that?
    Is there a guide of settings that explains stuff like that?
    At each problem i have posted a screen shot for better understanding.
    I hope someone will try to help me solve those anoying problems.
    Thank you!
    PS my sql developer version is 4.1.0.17 problems like these started in 3.x version already.

    The first thing to try, if you haven't already, is to update your video driver.

  • SQL DEVELOPER cut and paste does not work, slow and cannot work fast.

    I have lots of difficulties using SQL Developer, the cut/paste does not work properly, when I type search in he code editor it just paste or type the test in the source code not in the serach box. Very hectic I'm pallning to swicth to TOAD until they a a good version.

    Hello Aukhez,
    I'm sorry to hear that you're having problems with SQLDeveloper - personally, I've never had any problems with cut/copy/paste and searching, and I've been using SQLDeveloper from v1.0 to the current version, on practically every version of the JDK from 1.5-1.6u16 on both Windows and Linux.
    Sorry to state the obvious, but perhaps if you could provide a bit more specific information - such as platform, version, etc - and details of what you tried to do, someone here might be able to help...? Regarding speed, there are quite a few things you can do to make this better, but again, without knowing your setup, it's hard to give you proper directions. Plus, you'll find numerous threads here and on google about what you can do to improve speed.
    Regards,
    John

  • SQL Developer responding slowly

    Hi,
    I am connecting to Oracle DB from SQL Developer using remote connection through LDAP. I work with sql server management studio regularly but through sql developer this is my first time.
    I find SQl developer slow compared to sql server management studio- IS this true or is it because of the remote connection.?
    What steps can I take to improve its speed . Are there any tools or settings that I need to change?
    I have a simple insert query into a temporary table which ran for 5 hours.The application does not stop executing after that and I need to end it from task manager. I think this is to do with the buffer size, so I need to commit data in batches to process it more speedily.Are there any settings to do to run data in batches?
    Thanks for your time and help

    >
    I find SQl developer slow compared to sql server management studio- IS this true or is it because of the remote connection.?
    What steps can I take to improve its speed . Are there any tools or settings that I need to change?
    I have a simple insert query into a temporary table which ran for 5 hours.The application does not stop executing after that and I need to end it from task manager. I think this is to do with the buffer size, so I need to commit data in batches to process it more speedily.Are there any settings to do to run data in batches?
    >
    Based on the code you posted in a later reply this does NOT appear to be a sql developer issues at all and should be posted in the SQL and PL/SQL forum.
    PL/SQL
    Before you post there please read the thread 'How to post a tuning request' located at
    HOW TO: Post a SQL statement tuning request - template posting
    That thread discusses the information that you need to provide in order for volunteers to be able to make meaningful suggestions. That information includes
    1. the DDL for the tables and indexes involved
    2. the row counts for the tables
    3. the row counts for the query predicates
    4. the execution plan for the query
    5. the expected row count of the result set
    Based of this code that you posted
    INSERT INTO Temp
    SELECT
    VisitNo,
    EmployeeNo,
    (SELECT EmployeeNo FROM Employee e WHERE e.CaseNo = clin.CaseNo) emp,
    ROW_NUMBER() OVER (ORDER BY VisitNo, CaseNo) rnum
    FROM
    ClinicVisit clin
    ORDER BY
    VisitNo,
    CaseNo;the query will simply be sent by sql developer to Oracle for processing. Sql developer will play no further role until the query is actually completed. So based on this example code there is no basis at all for saying:
    1. sql developer is slow
    2. the application does not stop executing - please clarify what you mean by 'application' and by 'does not stop'
    3. I think this is to do with the buffer size
    4. I need to commit data in batches to process it more speedily
    5. the remote connection is in any way involved
    The code (insert into temp) suggests that you are using the typical sql server practice of populating a temporary table whose data will then, typically, be used for further processing and population of the target table.
    In Oracle you rarely need to use temporary tables and when you do use them you use them differently than the way they are used in sql server.
    The SQL and PL/SQL forum is the place to gets answers about tuning queries but you will get better help if you provide additional information about what you are really trying to do.

  • SQL Developer Java Extension possible?

    Hello,
    I need to parse Oracle SQL queries (to get information about tables used in queries and kind of filtering criteria) for some project.
    So, I would like to know if SQL Developer exposes such features in the context of Java extensions.
    Moreover, I've read a thread dealing with SQL Devloper java extensions but the sample does exist anymore, are there some docs available somewhere else?
    Thanks for your comments.
    Regards,
    Loïc

    Hi,
    If you get JDeveloper and download the ESDK (extension SDK), there are a set of sample extensions that you will find helpful in getting up to speed with some of the terms used (commands, actions, the different parts of the IDE, etc) - quite a few of them "just work" with SQL Developer without any fiddling.
    It would be nice to have a bit more visibility of the SQL Developer specifics, though...
    HTH,
    John

  • Oracle SQL Developer 1.0 is easy to install and use, and is portable

    I have tried the latest version of Oracle SQL Developer 1.0 and would like to share my experience of using it.
    Installation of Oracle SQL Developer 1.0
    Download from
    http://www.oracle.com/technology/software/products/sql/index.html?_template
    Unzip the Oracle SQL Developer for Windows (55.8 MB) to C:\sqldeveloper (103MB)
    Advantages: The unzip folder can be your removable disk and you can access Oracle
    anywhere provided that there is an Internet connection to Oracle Server.
    Unzip sqldeveloper-1557.zip to C:\ with folder name;
    double-click on sqldeveloper.exe in c:\sqldeveloper
    Click on [No]
    Tick all check boxes
    Click on [OK]
    Right-click on Connections, New
    Database Connection…
    Enter User name: SCOTT
    Password: TIGER
    Hostname: 127.0.0.1 (or IP of your Oracle Server on the Internet)
    SID: orcl
    If you want to connect to local Oracle user SYS,
    Enter User name: sys
    Password: ora10g_manager_password
    Hostname: 127.0.0.1
    SID: orcl
    Select Role: SYSDBA
    Click on [Connect]
    Right-click on Tables, Create Table
    Click on [Add Column]
    Select Type: NUMBER for COLUMN2
    Click on [OK]
    Table1 is created
    Click on TABLE1, click on “Data” tab
    Click on the “Green Plus” icon to insert record
    Click on “Commit Changes” icon
    Click on “DBConnection1” tab
    Enter: select * from table1;
    Click on “Execute Statement (F9)” icon
    To exit: Click on File, Exit

    Have you noticed that there's a forum dedicated to SQL Developer?
    C.

  • Top 10 Obstacles to Sql Developer Becoming a World-class Tool

    I've been working with Sql Developer day and night for the last 6 months.
    On a positive note, the SqlDeveloper team has been the most responsive Oracle product team I've worked with in the 19 years I've been working with Oracle tools. They pay attention to their customers. It's noticed and much appreciated!
    I thought I would share the biggest problems that I face with the tool on a daily basis, the kind of problems that make me want to work with a different tool each and every day.
    My intent isn't to gripe, it's to focus attention on the biggest productivity drains I face using the tool. Others may have a different list, based on their needs. Without further ado, here is my top 10 problems list:
    1) Quality Control.
    I cannot count on critical portions of the tool working correctly. This includes an oracle database development tool that is incapable of extracting oracle ddl correctly and which is incapable of correctly displaying information about SQL Server data and database objects. It also includes destroying connection files and losing keyboard settings. When the product was installed, it was incapable of properly displaying code in a worksheet when I scrolled thru the code. The details are listed in other postings of mine.
    2) Quality Control.
    See #1.
    3) Quality Control.
    See #1.
    4) Very badly done threading.
    The tool locks up on a constant basis when it does a many tasks. Rather than let me work on some other task, I have to wait for it to complete. My current work-around is to have two or three sql developer windows open. That sucks life out of my RAM supply, but at least I can get some work done. And, of course, it will often completely lock up and never return, which means I lose all unsaved worksheets. This forum is full of postings about these issues.
    5) Memory Leaks / Internal memory corruption.
    If I've had the tool open for a few days, or really worked it hard for a day, I will get bizarre compilation errors that make no sense. If I exit the tool, re-enter the tool, and compile the exact same code all will be well.
    6) Awkward and slow data entry interface for frequently performed tasks.
    Example: I create a new table and want to start defining columns for it. I remove my hands from the keyboard to press the + button, then I have to set focus on the column name field (it should do that for me!). Now that my hands are back on the keyboard, I have to backspace the dummy "column name" value in the column name field (it should ditch that dummy value for me). Only after all that can I actually enter a column name. When I want to add a new column, it's back to the mouse again, for the same drill. The down arrow key should take me to a new column record, as should pressing return at the end of the last field in the column row.
    7) Destroys code
    Changing a column datatype from varchar2 to nvarchar2 destroys the length of the column. Changing a field on a view destroys the instead of triggers. This is bad. There is no warning that this this is about to happen, which would at least give us a chance to avoid the problem. Better still, of course, would be not destroying that data.
    8) Inaccurate checking for record locking.
    When I try to edit records in a data grid for a table, I often get an error message telling me the data was modified in another session. It is simply not true. A hand-written update statement in a sql worksheet will work just fine. I've seen posts in the forum discussing this issue. An Oracle database development tool unable to reliably update oracle data tables is embarrassing. See Obstacle #1.
    9) Unicode support
    Sql Developer is heads above all the other tools I've tried out on this topic.
    However, the configuration of the tool to provide unicode support needs to be simplified.
    The tool needs to recognize the encoding of the files that are being opened up. On Windows Vista, Notepad seems to infallibly pick the right encoding for the file when I open it. Sql Developer should do the same. Files have specific encodings, the tool should have a default encoding (that I can override). Right now, the tool has a specific encoding and expects all files to match it. Extracting ddl to a worksheet does not respect the encoding choices of the tool, either. It only works with a limited set of tool encoding choices.
    10) Resources
    Does the sql developer team have the resources they need to compete with vendors like Microsoft? One really big reason for picking sqlserver over oracle is the ease of use of the Microsoft front-end tools. It's not until later that they may realize that Oracle has more capability, but that's still a lost sale.

    We are acutely aware of quality and with each release work at improving this. Providing a polished, professional and ultimately user friendly and useful tool is our constant goal.
    The broader our customer base grows, the more demands we have. This is a good and exciting position to be in, although it might mean that we need to slow down on our release cycles.
    Release 2.0 should address more of the threading and memory leaks displayed as the team have rewritten some of the sections. As for resources, it's true we're a small team and we get on with the work that we do.It might be a little slower than some would like, but I'm not convinced that having large team is necessarily always the answer.
    As ever, some of the points mentioned could be added to the Exchange. We'll be reviewing and updating the Exchange again in the New Year.
    I think there is another point to add to your list. A lot of what the tool is and will become is from a positive customer interaction we have had to date. While we continue to grow this, I think the product will grow and improve. The forum and all the positive interactions that happen here are key to taking the product forward.
    Regards
    Sue

  • Unable to connect to a remote db using Sql Developer

    hi,
    I have 2 systems (A and B) both running on RHEL 6. A has Oracle 10G installed while B has Oracle 11G, and on both I have SQL Developer. A and B are cable networked with static IPs as below.
    A 192.168.1.1
    B 192.168.1.2
    I am trying to connect to database on A from SQL Developer on B. On B, I open SQL developer, enter the connection name, username, password, hostname( or IP) of A, port #, and instance name and hit connect. It shows error about network adapter. I cannot connect.
    Listners on both system are active, I can ping each system from each other. No issues with /etc/hosts either.
    I am not sure then why it does not work. Would like to know if I can / should be able to connect like above ? What else should I look at to fix?
    Shashi

    Hello Sir,
    Can you telnet to the server on 1521? (telnet A 1521)- failed. with no route error
    However, I could telnet B from A without any prob. I then came across a workaround at
    TNS-12560: TNS:protocol adapter error
    which suggests to :
    Go into the Security Level Configuration on your Linux server. In Other Ports, specifically enter <port>:tcp, (example 1521:tcp.
    and it worked :)
    I am still not sure, why I had to take the workaround route when there was no difference between 2 systems, in terms of route tables, host file entries, sqlnet.ora,listner.ora, etc . I am glad that the issue is resolved and I am able to connect from SQL Developer on A to db on B and other way round, but the the question still remains... :)

  • Cannot see table in sql developer or sql plus

    I have created a record in application designer. I have then built the table. I can close the record and then find it again in application designer. But if I go to sql plus or sql developer, I cannot see it. Am I missing a step?

    You probably can see all the tables of sysadm because someone else give you proper grant for that on existing sysadm's objects.
    For the new or modified object (drop+create) you should :
    1. connect as sysadm and run
    grant select on new_table_name to your_own_user;2. connect with your own user and run
    create synonym new_table_name for sysadm.new_table_name;Then you'll be able to query that table without using schema name alias.
    Some admin have also a ddl trigger to make it automatically.
    You could also work through a role and public synonym if more than one user needs to access sysadm's objects.
    Nicolas.

  • Using REF with object table in SQL Developer

    When i create object tables and fill them with data, then in SQL Developer de REF value isn't displayed.
    I did the following:
    CREATE TYPE adres_type AS OBJECT
    (straat VARCHAR2(20)
    ,nummer VARCHAR2(10)
    ,postcode VARCHAR2(6)
    ,plaats VARCHAR2(50));
    CREATE TABLE adressen of adres_type;
    CREATE TYPE locatie_type AS OBJECT
    (nr NUMBER
    ,naam VARCHAR2(20)
    ,adres REF adres_type);
    CREATE TABLE locaties OF locatie_type;
    CREATE TABLE locaties OF locatie_type
    (SCOPE FOR (adres) IS adressen);
    insert into adressen values (adres_type('Arnhemsestraatweg', '33','6881ND','Velp'));
    insert into locaties values (1,'Directie', (select ref (a) from adressen a where a.plaats = 'Velp'))
    Then in SQL Developer de REF(A) column is empty, while in SQL*Plus it displays the REF value:
    In SQL Developer: SELECT a.*, REF(a) FROM adressen a;
    STRAAT NUMMER POSTCODE PLAATS REF(A)
    Arnhemsestraatweg 33 6881ND Velp
    In SQLPLUS: SELECT a.*, REF(a) FROM adressen a;
    STRAAT NUMMER POSTCODE PLAATS REF(A)
    Arnhemsestraatweg 33 6881ND Velp 0000280209C70341FBB96B4F77813B27B50E53BB4332382E22ADD64AD9B755F651D416B6DA010134
    Is this a bug or is there another reason why the ID doesnt display in SQL Developer.
    (this didnt work in all the previous SQL Developer releases and still not in de 2.1 E.A. version)

    Hi <not sure of your first name>,
    I have replicated the issues and logged a bug against this
    Bug 9102579 - FORUM: REF FUNCTION NOT RETURNING CORRECT RESULT
    Regards,
    Dermot O'Neill
    SQL Developer Team

Maybe you are looking for