How to debug a Package / function in PL SQL developer ??

How can we debug a Package / function in PL SQL developer ??
i want to debug a code line by line

Karthick_Arp wrote:
This question does not belong to this fourm. We have a {forum:id=260} forum for such question.Not even there Karthick. PL/SQL Developer is a 3rd party tool, not Oracle's SQL Developer, so it doesn't even belong on the Oracle forums.

Similar Messages

  • How to open a package body in Oracle sql developer

    How to open a package body in Oracle sql developer..any shortcut for that

    I need another way to get to my package body. I'm on a locked down system, so the only way I can reference anything is if I already know the name of it. I accidentally overwrote my text document that I was using to work on it and I closed out of the package body in sqldeveloper. There must be a command, like an alter or some such. Anyone know the old fashioned way of looking at a package?

  • How to know the packages,functions,triggers owned by schema

    I got the script to find the tables,columns and indexes belonged to a schema
    how to find the packages,functions triggers owned by a schema.
    I need to compare schema of PROD with UAT
    Any help will be appreciated

    is it possible to find the source of all those
    objects in a single scriptWhat do you mean?
    user_source will give the script?Yes.
    You can get script more easily with DBMS_METADATA
    SQL> drop FUNCTION "HR"."F11";
    Function dropped.
    SQL> CREATE OR REPLACE FUNCTION "HR"."F11" return varchar2
    as
    v_date varchar2(1000);
    begin
    select to_char(sysdate,'mmddyyyy') into v_date from dual;
    return v_date;
    end;  2    3    4    5    6    7
      8  /
    Function created.
    SQL> set pagesize 0
    SQL> set long 90000
    SQL> select DBMS_METADATA.GET_DDL (
    'FUNCTION',
    object_name,
    'HR')
    FROM    all_objects
    WHERE owner = 'HR'
    AND object_type ='FUNCTION'  3    4    5    6    7
      8  /
      CREATE OR REPLACE FUNCTION "HR"."F11" return varchar2
    as
    v_date varchar2(1000);
    begin
    select to_char(sysdate,'mmddyyyy') into v_date from dual;
    return v_date;
    end;
    Is there any script to identify source for all those
    objects

  • How to start or shut down database using sql developer in windows

    Dear Sir/Madam,
    how we start or shut down database using sql developer in windows
    we are using oracle 11g release2, unix, java & oracle oracle weblogic administration
    Thanks & Regards
    Manish Kumar
    Datbase Team
    TCS Ltd.

    HI, Welcome to OTN form,
    SHUTDOWN is not a SQL statement but a SQL*Plus command . You cannot use SHUTDOWN in PL/SQL.
    Check following link:
    http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve042.htm#i2699551
    More Information please check OTN discussion: https://forums.oracle.com/thread/2349159
    Thank you

  • How to execute a packaged function from within DML

    Hi
    can someone explain in how many ways can we execute a packaged function from within a DML statement.
    examples will help.
    Thanks

    Hi,
    There's no difference between using functions in DML and using functions in any other SQL statement. Almost any place where a literal is allowed, you can have any kind of expression, including a an expression involving one or more functions.
    For example, in
    UPDATE  table_x
    SET     column_a = 0
    WHERE   column_b > SYSDATE;You could use functions instead of 0, column_b, or SYSDATE. (Actually, SYSDATE is a function.) You can not use functions instead of table_x or column_a (since it is to the left of the "=" sign).

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

    I have two target schema in one OWB project, such as A and B. In a mapping of A, I would like to use some types, packages, functions, and procedures from B. I have tried the method of synonym as suggested, but I could not find the metadata of these when importing ... The only type of synonym I can import is the synonym for table. Is there a bug for synonym?
    If I cannot use synonym for this issue, is there another way to solve the problem?

    Now, in some instances you will absolutely need to create the second module as Carsten describes, however it should also be noted that you can reference objects in things like Expressions even if you have not loaded up the metadata. It is only when you need strong binding that it becomes neccessary to import objects. For everything else, as long as the reference will resolve at compile-time then you are good to go.
    For example, I have a function in one target schema (S1) and a private synonym to it in another(s2). A mapping in the S2 schema has an expression object that uses the synonym to the function in the expression property for a couple of the output attirbutes. The synonym has not been loaded into metadata - indeed OWB has no knowledge of its existance. But it resolves at compile time so the mapping validates and generates successfully.
    Mike

  • How to debug a RFC function  when the user is non-dialog type? Please help!

    hi Experts,
      I am calling a RFC FM residing in B from R/3 system A.
    R/3 A -
    Call FM residing in B----
    > R/3 B
    The user attached to the remote destination is a non-dialog type.
    I cannot change the user type of this user.
    Therefore how to debug the RFC FM in System A?
    Are there any alternatives?
    Please help
    Thanks
    Gopal

    in your RFC FM, code an endlees loop.
    something like:
    data: gv_x  type xfeld value 'X'.
    do.
      if gv_x = space.
        exit.
      endif.
    enddo.
    now you can catch the mode in TA SM50, go in it, change gv_x to space and debug what is coming further.

  • How to test procedures and functions of pl/sql

    I am working as a QA basically i got a new assignment of testing functions and procedures, and packeged bodies. Can any one help me in this matter.
    Please help me.
    Hi i am new to oracle I want to test procedures and functions,
    and packaged bodies of pl/sql.

    It depends on what you meant by "testing". I guess you need to check that routines (functions, procedures, packages etc) in valid state and execute without errors. The simpliest way is to get some development tool like TOAD (http://www.quest.com), Oracle Maestro (http://www.sqlmaestro.com) or PL/SQL Developer (http://www.allroundautomations.com). You can connect with them to database and look at the routine state VALID or INVALID. You can recompile them, run and even debug. I guess this should be enough.
    Alternatively you can do same thing from sqlplus. Of course with lesser comfort. You need to write certain SQL statements. For example i want to find invalid procedures:
    SQL> select OBJECT_NAME, OBJECT_TYPE from USER_OBJECTS where STATUS='INVALID';
    To check how procedures work you need to execute anonymous PL/SQL block like this:
    declare
         /* local variables declaration */
         NAME VARCHAR2(4000);
         PRESIDENT_ID NUMBER(38);
         ID NUMBER(38);
    begin
         /* setting up variables */
         NAME:='MICROSOFT';
         PRESIDENT_ID:='BILLY';
         ID:=NULL;
         /* calling routine */
         GEOMETRY.ADD_COMPANY(NAME,PRESIDENT_ID,ID);
    end;

  • Calling a package function inside a sql

    Hi friends!!!
    First of all happy Christmas! And them please help! :)
    We have a query calling a package function:
    SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR ('0000000000000000');There is a primary key just with one column DW025H_NR and the problem is that is not accessing by INDEX UNIQUE SCAN,
    it's accessing by TABLE ACCESS FULL.
    May be the problem is that we are calling a procedure inside the query?
    I have been able to run that query accessing by primary key from my computer but a workmate hasn't!
    We both are connecting the same data base 10.2.0.4 and using Oracle SQL Developer!
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 5343K| 1406M| 15670 (7)| 00:02:43 |
    |* 1 | VIEW | DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
    |* 2 | FILTER | | | | | |
    | 3 | TABLE ACCESS FULL| DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
    Predicate Information (identified by operation id):
    1 - filter("DW025H_NR"="MPPCI"."ENCRIPTAPAN"('0000000000000000'))
    2 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
    SYS_AUDIT('OPS$SISINFO','DW025H','CMINFOGR001',3) ELSE NULL END IS
    NULL)
    The correct path would be:
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 276 | 3 (0)| 00:00:01 |
    |* 1 | FILTER | | | | | |
    | 2 | TABLE ACCESS BY INDEX ROWID| DW025H | 1 | 276 | 3 (0)| 00:00:01 |
    |* 3 | INDEX UNIQUE SCAN | PK_DW025H | 1 | | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
    SYS_AUDIT('OPS$SISINFO','DW025H ','CMINFOGR001',3) ELSE NULL END IS NULL)
    3 - access("DW025H_NR"="MPPCI"."ENCR"('0000000000000000'))
    Please any ideas!?!?!
    Thanks a lot!
    José
    Edited by: jamv on Dec 20, 2011 10:50 AM

    Hello
    Have a read of this and try to pull together the information in it and post it up here. That will help immensely with getting to the root of your problem...
    HOW TO: Post a SQL statement tuning request - template posting
    In the mean time:
    From the execution plan you have extra predicates that aren't present in the query you supplied, so that's either not the SQL or you have something like VPD switched on.
    Anyway, there could be lots of reasons for the difference in execution plan. Sorry if this is very basic and possibly patronising question but it's always worth checking the basics I think - are you both definitely connecting to the same database? If so, have a look in v$sqlarea for this SQL statement and find the SQL_ID, use this to query v$sql and look at the child_number column.
    select
        sql_id
    from
        v$sqlarea
    where
        sql_text like '%SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR%(''0000000000000000'')%'
    and
        sql_text not like '%v$sqlarea%'
    select child_number from v$sql where sql_id='<enter the sql id returned by the query above>'as an example...
    XXXX> select /* my sql statement*/ rownum id from dual;
            ID
             1
    1 row selected.
    Elapsed: 00:00:00.10
    XXXX> select sql_id from v$sqlarea where sql_text like '%my sql statement%'
    and sql_text not like '%v$sqlarea%';
    SQL_ID
    a6ss4v79udz6g
    1 row selected.
    Elapsed: 00:00:03.56
    XXXX> select child_number from v$sql where sql_id='a6ss4v79udz6g'
      2  /
    CHILD_NUMBER
               0
    1 row selected.   If you have more than one row in v$sql there could be differences in the optimiser environment. The supplied like shows you how to gather the information that should help find what the differences are if any.
    Also as a side note if you're calling PL/SQL functions from SQL, you can take advantage of subquery caching to help reduce the number of calls (depending on your version). As it stands, your function is most likely going to be called for every row - when there is only a single row returned, that's not necessarily a problem but for multiple rows, the overhead can quickly grow. If there's no way to get rid of the function call, select the function from dual instead i.e.
    SELECT * FROM DW025H WHERE DW025H_NR= (SELECT MPPCI.ENCR%('0000000000000000') FROM dual);This also (as I learnt a couple of weeks ago) works when you're using columns in the table your selecting from as parameters to the function.
    HTH
    David

  • How to find built-in functions for PL/SQL

    Hi everyone,
    Please can someone help me, I am running version 8i, and I am trying to find out how I can access all the built-in functions for PL/SQL.
    I am new in ORACLE environment and I just want to know all the built-in functions and their usage.
    Thanks
    Maikiki1
    null

    Use the 'Documentation' selection on the left side of the OTN page.
    All of the documentation for Oracle is available.
    You can also purchase the documentation CD-ROM from the Oracle Store.
    The functions are explained in the SQL reference manual.
    null

  • Not able to debug package procedure using PL/SQL Developer 7.0.3

    Hi Guys,
    I am debugging one of procedure of my package which is calling many procedure for different package
    I am using PL/SQL Developer 7.0.3., Iam not able to debugger , whenever I run debugger it makes all the dependent package as invalid
    Please advice me what to do,
    Thanks
    Nav

    PL/SQL Developer has it's own forum @http://forums.allroundautomations.com/ubb/ubbthreads.php?ubb=postlist&Board=3&page=1&PHPSESSID=13b3aab3b0281796203ac9eca9db0f82
    You have an old version, by the way, why not upgrade?

  • How to write procedure or function or any sql statement for requirement

    Hi,
    i have a table named letter,it contains 2 columns named as letter_id and letter_content.
    select * from letter;
    letter_id letter_content
    103 Dear MFR
    103 This is in regards to the attached DM List
    103 Please Credit us after reviewing it.
    103 Thanks
    103 Regards
    103 xxxx
    108 Dear customer
    108 This is to inform that ur DM List is as follows
    108 Credit us according to the Dm after reviewing it.
    108 Thanks
    108 Regards
    108 xxxx
    now my requirement is,i need send a parameter as letter_id to a procedure or function in pl/sql in oracle,the output should be as follows:
    if we will pass parameter(letter_id) = 103 then it displays as follows:
    Dear MFR
    This is in regards to the attached DM List.Please Credit us after reviewing it.
    Thanks
    Regards,
    XXXXX.
    if we will pass parameter(letter_id) = 108 then it should displays as follows:
    Dear customer,
    This is to inform that ur DM List is as follows. Credit us according to the Dm after reviewing it.
    Thanks
    Regards,
    XXXXX.
    ---------------------------------------------------------------------------------------------------------

    i am really appriciate ur help.
    thank u so much for ur suggestions.
    when i am uning line_seq its giving an error
    ORA-00904: "LINE_SEQ": invalid identifier
    so,in my table i had created a sequense named content_seq.
    select * from letter;
    content_seq letter_id letter_content
    1 103 Dear MFR
    2 103 This is in regards to the attached DM List
    3 103 Please Credit us after reviewing it.
    4 103 Thanks
    5 103 Regards
    6 103 xxxx
    7 108 Dear customer
    8 108 This is to inform that ur DM List is as follows
    9 108 Credit us according to the Dm after reviewing it.
    10 108 Thanks
    11 108 Regards
    12 108 xxxx
    then i had used ur code as follows:
    select linefrom ( select content_seq , letter_content || case content_seq when 2 then ' ' || lead(letter_content) over (partition by letter_id order by content_seq) end as line from letter where letter_id = 103 )where content_seq <> 3;
    LETTER_CONTENT
    Dear MFR
    this is in regards to the attached DM List Please credit us after reviewing it
    thanks
    Regards
    EXP
    but when i take letter_id = 108 the format is comming different.it was unable to combine 2lines.
    Message was edited by:
    user579585
    Message was edited by:
    user579585

  • View a function in PL/SQL developer

    I'm a sql developer, quite new to oracle.
    I'm using PL/SQL developer tool. Now I would like to view how a function is defined.
    But don't know how to open it.
    I can see the function, when right click it I have the option of the following: Refresh, copy comma separated, Test, and describe.
    How can I view the function contents?
    Thanks

    Hi,
    You can double click on that function name, you can watch one window in left side.
    If you want the bebug the fuction(first you should have the debug rights) just click on test and select ok for debug result, you watch the result step by step.
    Regards
    Sree

  • How to know the ORACLE version from PL/SQL developer

    Guys,
    I wanted to know the version of ORACLE that i am using currently. How should i get it ? is there any functions available ?
    Note: I am using PL/SQL Developer tool.

    select * from v$version

  • How i found listener o tsnames in oracle sql developer

    Jelou, i have some troubles with the Oracle SQL Developer, i have a server with Oracle 11g, but the client (sql developer) dont connect to the server, they give me a error, the oracle error i try to search in the search pages, but they dont have a answer.
    I try to search the listener and the tsnames files, but i dont found the files, i working in Windows 7 in 32bits,
    The Oracle error is ORA-12518.
    I put a picture about error,
    [http://picasaweb.google.com/lh/photo/2dpHUn5kEIfxMDqPFM9DxpmLdaXzuCybZLuf45HwREU?feat=directlink]
    Thanks for the help,
    Edited by: user13373417 on 07-Jul-2010 08:50

    user13373417 wrote:
    Your answer is about the function to database, or for the client, because i have the trouble with the client, i used Oracle sql Developer (the last version put in oracle) in windows 7
    ok, but how i found the listener o the tsnames, because i searching in all disk (c) but i dont found them, or how i can turn on the listener o whe is the directory when i put the files, because the installation dont have the /network/adm for put the files
    Edited by: user13373417 on 07-Jul-2010 09:06It appears you don't have a very clear understanding of how the client and the server are configured to communicate with one another.
    ============
    A couple of important points.
    First, the listener is a server side only process. It's entire purpose in life is to receive requests for connections to databases and set up those connections. Once the connection is established, the listener is out of the picture. It creates the connection. It doesn't sustain the connection. One listener, running from one oracle home, listening on a single port, will serve multiple database instances of multiple versions running from multiple homes. It is an unnecessary complexity to try to have multiple listeners. That would be like the telephone company building a separate switchboard for each customer.
    Second, the tnsnames.ora file is a client side issue. It's purpose is for address resolution - the tns equivalent of the 'hosts' file further down the network stack. The only reason it exists on a host machine is because that machine can also run client processes.
    Assume you have the following in your tnsnames.ora:
    larry =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = curley)
      )Now, when you issue a connect, say like this:
    $> sqlplus scott/tiger@larrytns will look in your tnsnames.ora for an entry called 'larry'. Next, tns sends a request to (PORT = 1521) on (HOST = myhost) using (PROTOCOL = TCP), asking for a connection to (SERVICE_NAME = curley).
    Where is (HOST = myhost) on the network? When the request gets passed from tns to the next layer in the network stack, the name 'myhost' will get resolved to an IP address, either via a local 'hosts' file, via DNS, or possibly other less used mechanisms. You can also hard-code the ip address (HOST = 123.456.789.101) in the tnsnames.ora.
    Next, the request arrives at port 1521 on myhost. Hopefully, there is a listener on myhost configured to listen on port 1521, and that listener knows about SERVICE_NAME = curley. If so, you'll be connected.
    What can go wrong?
    First, there may not be an entry for 'larry' in your tnsnames. In that case you get "ORA-12154: TNS:could not resolve the connect identifier specified" No need to go looking for a problem on the host, with the listener, etc. If you can't place a telephone call because you don't know the number (can't find your telephone directory (tnsnames.ora) or can't find the party you are looking for listed in it (no entry for larry)) you don't look for problems at the telephone switchboard.
    Maybe the entry for larry was found, but myhost couldn't be resolved to an IP address (say there was no entry for myhost in the local hosts file). This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe there was an entry for myserver in the local hosts file, but it specified a bad IP address. This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe the IP was good, but there is no listener running: "ORA-12541: TNS:no listener"
    Maybe the IP was good, there is a listener at myhost, but it is listening on a different port. "ORA-12560: TNS:protocol adapter error"
    Maybe the IP was good, there is a listener at myhost, it is listening on the specified port, but doesn't know about SERVICE_NAME = curley. "ORA-12514: TNS:listener does not currently know of service requested in connect descriptor"

Maybe you are looking for