Debugging PL/SQL procedures
Why cannot execute the PL/SQL procedure on the SQL Script Page?
You're sure that the compile went ok? At least in your post, you're missing a ";"
CREATE OR REPLACE PROCEDURE "CREARATE" (
importo IN NUMBER,
pagoid IN NUMBER,
oidconv IN NUMBER,
anno IN NUMBER
AS
noid NUMBER;
data_scad DATE;
CURSOR scadenza
IS
SELECT TO_DATE ((giorno || '/' || anno), 'DD/MM/YYYY') AS giorno
FROM ratexpag
WHERE (tipopag = pagoid);
BEGIN
SELECT MAX (oid_2)
INTO noid
FROM pagamento_convenzionetable;
IF noid IS NULL THEN
noid := 0;
END IF;
LOCK TABLE pagamento_convenzionetable IN EXCLUSIVE MODE;
OPEN scadenza;
WHILE NOT (scadenza%NOTFOUND)
LOOP
FETCH scadenza
INTO data_scad;
noid := noid + 1;
INSERT INTO pagamento_convenzionetable
(oid_2, anno_contabile, data_scadenza, importo_preventivo
VALUES (noid, anno, data_scad, importo
INSERT INTO convenzione_pagamento_convenzi
(convenzioneoid, pagamento_convenzioneoid
VALUES (oidconv, noid
END LOOP;
-- COMMIT TRANSACTION --
COMMIT;
CLOSE scadenza;
END;
[pre]
C.
Similar Messages
-
Debugging PL/SQL procedures with JDeveloper ?
Hi,
does anyone know if it is possible to debug PL/SQL procedures and packages with JDeveloper ? I'm using a 9.0.1.2.0 database but JDeveloper returns the error "The target VB_TEST could not be started because the database version does not support debugging." when I try to debug a PL/SQL procedure.
If it is not possible, does anyone know a good alternative ?Oracle Script Debugger is not available anymore at technet.I need to retrive data from PL/SQL stored procedures. I am using the DynamicSQL component (2nd workaround) to retrive data from PL/SQL stored procedures. <br><br>
I am having some problems.<br><br>
This is the code I am running in Fuego Studio 5.5 SP 11 Build #71108:<br><br>
dynamicSQL as Fuego.Sql.DynamicSQL<br>
iterator as Iterator(Any[Any])<br>
sentence as String<br>
implname as String<br><br>
dynamicSQL = Fuego.Sql.DynamicSQL()<br>
implname = "conexionORBPAU"<br>
sentence = "var result REFCURSOR; " + <br>
"exec :result_cursor := pkg_audbpm_bpaasig_indicador.prgetsingle(9999);";<br>
iterator = executeQuery(DynamicSQL, sentence, implname, inParameters : []);<br><br>
And, this is the error:<br><br>
java.sql.SQLException: Falta el parametro IN o OUT en el indice:: 1 <br>
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)<br> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)<br>
oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1681)<br>
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3280)<br>
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)<br>
at fuego.jdbc.FaultTolerantPreparedStatement.executeQuery(FaultTolerantPreparedStatement.java:579)<br>
at fuegoblock.sql.DynamicSQL.executeQuery(DynamicSQL.java:340)<br>
...<br><br>
This is the code of the PL/SQL in the Oracle DB:<br><br>
CREATE OR REPLACE PACKAGE PKG_AUDBPM_BPAASIG_INDICADOR IS<br>
TYPE cursor_type IS REF CURSOR;<br>
FUNCTION prGetSingle<br>
(<br>
p_ID_ASIG_INDICADOR IN NUMBER<br>
)<br>
RETURN cursor_type;<br><br>
END PKG_AUDBPM_BPAASIG_INDICADOR;<br><br>
is my code OK? Any ideas?<br><br>
Thanks in advance.<br> -
Step by step debugging pl/sql procedure
How can we debug a pl/sql procedure step by step
We know about this, for a workaround you can try editing jdev-Darwin.conf and adding a line like the following:
# Add our debug classes to the bootclasspath
AddVMOption -Xbootclasspath/a:../../rdbms/jlib/ojdi.jar
In short, ojdi.jar needs to be on the bootclasspath on the mac. I'm not sure how well this will work, but it's one of the changes we're planning for our 10.1.2 release of JDeveloper
Rob
Team JDev -
I have a PL/SQL, HTML, JavaScript procedure that is giving me a HTTP 404 error when I press the 'SUBMIT' button. I have tried to trap it in the procedure but am unable.
Does anyone know what parameter(s) need to be turned on in the Apache server to debug the PL/SQL procedure? I have heard that turning on this parameter will only affect the database I'm in and is not global.
It is suppose to show all the variable and whatever else is pertinent.
Thank you,thanks a ton! I'll give this a try. Does the dbs_debug_jdwp.connect_tcp(ip,port) have to be in the called procedure?
-
How do I debug pl/sql procedures from a bc4j application
Hi,
I would like to use jdevelopers pl/sql debugging capabilities to debug some code that is executed by triggers in the database, when inserting records through my bc4j client application.
I already found the remote debugging feature of jdeveloper, but that requires setting up a separate debugger listener, and it also requires me to put the following statement in the session:
DBMS_DEBUG_JDWP.CONNECT_TCP ('hostname_or_ip', port_number)
Where and how can I put this line of pl/sql code to make it execute each time I launch the bc4j application?
Or is it possible to use one debugger process (the one that's also using the java breakpoints) to debug both pl/sql and java code?
Greetings,
IvoI have the same problem.
I have a PL/SQL function that returns a number. This function receives 2 parameters. I use StoredProcedureCall plus ValueReadQuery.
Session aSession = SessionManager.getManager().getDefaultSession();
StoredProcedureCall call = new StoredProcedureCall();
call.setProcedureName("CIO_UTILS.COUNT_USER_ROLES_IN_MODULE");
call.addNamedArgument("p_persid");
call.addNamedArgument("p_module");
call.addUnamedOutputArgument("rolesnum", Integer.class);
ValueReadQuery query = new ValueReadQuery();
//query.bindAllParameters();
query.setCall(call);
query.addArgument("p_persid");
query.addArgument("p_module");
Vector parameters = new Vector();
parameters.addElement(persid);
parameters.addElement(theModule);
Integer rolesnum = (Integer) aSession.executeQuery(query,parameters);
aSession.release();
if(rolesnum.intValue()<=0)return false; else return true;
However, I receive the following error:
Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 96:
PLS-00312: a positional parameter association may not follow a named association
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Error Code: 6550
Call:BEGIN CIO_UTILS.COUNT_USER_ROLES_IN_MODULE(p_persid=>'SANCRA2791', p_module=>'PSL_MONITORING', ?); END;
bind => [=> rolesnum]
If comment the line
"call.addUnamedOutputArgument("rolesnum", Integer.class);"
Toplink is trating it as a procedure, and I also receive an error from PL/SQL.
There should have to be a way of make it to receive the resoult somehow, but I do not know what.
Thanks in advance. -
I am using Toad for Oracle. Is there any way within PL/SQL code to define a section or block of code as code that should only run when you are debugging PL/SQL procedures/functions?
I think the OP wants something more like this (tested in 11g, should work from 10.2 onwards if I remember correctly):
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create or replace procedure procedurewithdebug
2 as
3 begin
4 dbms_output.put_line('Start of procedure');
5
6 $if $$debug $then
7 dbms_output.put_line('Extra code section only called when $$debug is TRUE');
8 $end
9
10 dbms_output.put_line('End of procedure');
11 end procedurewithdebug;
12 /
Procedure created.
SQL> set serverout on
SQL> exec procedurewithdebug
Start of procedure
End of procedure
PL/SQL procedure successfully completed.
SQL> call dbms_preprocessor.print_post_processed_source('PROCEDURE','WILLIAM','PROCEDUREWITHDEBUG');
procedure procedurewithdebug
as
begin
dbms_output.put_line('Start of procedure');
dbms_output.put_line('End of procedure');
end procedurewithdebug;
Call completed.
SQL> alter session set plsql_ccflags = 'debug:true';
Session altered.
SQL> alter procedure procedurewithdebug compile;
Procedure altered.
SQL> exec procedurewithdebug
Start of procedure
Extra code section only called when $$debug is TRUE
End of procedure
PL/SQL procedure successfully completed.
SQL> call dbms_preprocessor.print_post_processed_source('PROCEDURE','WILLIAM','PROCEDUREWITHDEBUG');
procedure procedurewithdebug
as
begin
dbms_output.put_line('Start of procedure');
dbms_output.put_line('Extra code section only called when $$debug is TRUE');
dbms_output.put_line('End of procedure');
end procedurewithdebug;
Call completed.
SQL> alter session set plsql_ccflags = 'debug:false';
Session altered.
SQL>
SQL> alter procedure procedurewithdebug compile;
Procedure altered.
SQL> exec procedurewithdebug
Start of procedure
End of procedure
PL/SQL procedure successfully completed.Note this does not automatically detect whether a procedure is compiled for debug - you have to set a compilation directive explicitly. (There is nothing special about '$$debug' either - I could have used '$$banana'.)
As a variation, you can also use package constants:
SQL> create or replace package environment_settings
2 as
3 debug constant boolean := TRUE;
4 end environment_settings;
5 /
Package created.
SQL> create or replace procedure procedurewithdebug
2 as
3 begin
4 dbms_output.put_line('Start of procedure');
5
6 $if environment_settings.debug $then
7 dbms_output.put_line('Extra code section only called when environment_settings.debug is TRUE');
8 $end
9
10 dbms_output.put_line('End of procedure');
11 end procedurewithdebug;
12 /
Procedure created.
SQL> exec procedurewithdebug
Start of procedure
Extra code section only called when environment_settings.debug is TRUE
End of procedure
PL/SQL procedure successfully completed.
SQL> create or replace package environment_settings
2 as
3 debug constant boolean := FALSE;
4 end environment_settings;
5 /
Package created.
SQL> exec procedurewithdebug
Start of procedure
End of procedure
PL/SQL procedure successfully completed.Note that PL/SQL isn't just skipping the line like an ordinary IF statement, the PL/SQL compiler is actually excluding the section at compile time:
SQL> call dbms_preprocessor.print_post_processed_source('PROCEDURE','WILLIAM','PROCEDUREWITHDEBUG');
procedure procedurewithdebug
as
begin
dbms_output.put_line('Start of procedure');
dbms_output.put_line('End of procedure');
end procedurewithdebug;
Call completed.Edited by: William Robertson on Mar 26, 2009 7:18 AM -
Debug PL/SQL Stored Procedure
I am using JDevloper 10.1.3.4. As I am steppping through a servlet in debug and a call is made to a pl/sql stored procedure is it possible to seamlessly (or otherwise) have the debugger step into that pl/sql procedure and then step back into the servlet when exiting? I can run a pl/sql proc in debug seperately but it would be great if it could be done in line with the servlet call.
thanks a ton! I'll give this a try. Does the dbs_debug_jdwp.connect_tcp(ip,port) have to be in the called procedure?
-
How to get data from URL in a PL/SQL procedure
Hi!<br>
<br>
I want to pass values in APEX from a report with a link to a PL/SQL procedure through URL.
How can I make this?<br>
<br>
For example:<br>
<br>
I have a report:<br>
<br>
select<br>
id,<br>
name,<br>
akt,<br>
case<br>
when akt is NULL then '< a href="f?p=&APP_ID.:27:&SESSION.:START_PROCESS" name="test_link" >set< /a >'<br>
end choice<br>
from<br>
USERS;<br>
<br>
I want to pass the value "id" in the link ( named "test_link" ) . And want to use this value in a process like this:<br>
<br>
DECLARE<br>
v_user_id NUMBER(10);<br>
BEGIN<br>
--I want to read this value from the url<br>
if :REQUEST='START_PROCESS' then<br>
v_user_id := ????;<br>
<br>
...<br>
end if;<br>
END;<br>
<br>
<br>
Thanks!<br>
MartonHi,
1- Create a hidden item P27_USER_ID on page 27
2- Change your code :
SELECT ID, NAME, akt,
CASE
WHEN akt IS NULL
THEN '< a href="f?p=&APP_ID.:27:&SESSION.:START_PROCESS:NO::P27_USER_ID:'
|| ID
|| '" name="test_link" >set< /a >'
-- refer to f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
END choice
FROM users;
And then
DECLARE
v_user_id NUMBER (10);
BEGIN
--I want to read this value from the url
IF :request = 'START_PROCESS'
THEN
v_user_id := :p27_user_id;
--your code
END IF;
END;Hope this helps,
Grégory -
I cannot debug with SQL server 2008 SSMS asks for Firewall permission?
hi friends,
I run SQL server 2008 R2 developer edition on windows 8 basic edition. SQL server is installed in my local machine. when I tried to debug a sql script it asked the firewall permission as show on image
when googled I found this
Article from MSDN with fix tool but it cannot installed on my Windows 8 OS, is there way to fix it without giving any unauthorized access to my system?
thanks
I use Visual studio 2012 Ultimate and SQL server 2008 developer edition!Hi,
The hotfix you provide applies for Windows Server 2008.
The windows firewall on this machine is currently blocking remote debugging.
According the message, the following ports need to be enabled for remote debugging. Use the procedure that is described in the section
Configuring a Port in Windows Firewall to enable the following ports through Windows Firewall:
Ports
Protocol
135
TCP
Required
500, 4500
UDP
Required if your domain policy requires network communication to be performed through IPSec.
See the below article for more information:
How to: Enable Transact-SQL Debugging
http://msdn.microsoft.com/en-us/library/vstudio/s0fk6z6e(v=vs.100).aspx
Thanks.
Tracy Cai
TechNet Community Support -
Display data in log file using PL/SQL procedure
Just as srw.message is used in Oracle RDF Reports to display data in log file in Oracle Apps, similarly how it is possible to display data in log file using PL/SQL procedure?
Please also mention the syntax too.Pl post details of OS, database and EBS versions.
You will need to invoke the seeded FND_LOG procedure - see previous discussions on this topic
Enable debug for pl/sql
https://forums.oracle.com/forums/search.jspa?threadID=&q=FND_LOG&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
HTH
Srini -
Debugging pl/sql that uses htp calls
I'm trying to run debug against a procedure that has htp calls in it but whenever I hit a htp.xxx call I get
$Oracle.EXCEPTION_ORA_6502:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 356
ORA-06512: at "SYS.HTP", line 1368
ORA-06512: at "SYS.HTP", line 1443
ORA-06512: at "LUMWEB.DOHTP", line 3
ORA-06512: at line 2
Is there something that needs to be done to make this work? I'm able to debug the same procedure using pl/sql developer.Repost --> Can anybody help?
-
Debugging PL/SQL Functions - Aaghh help!
Hi. this is driving me nutz.
here is my function:
CREATE OR REPLACE FUNCTION MYPROC_GETCOMPID
COMPNAME IN VARCHAR2,
SITEID IN INTEGER
RETURN NUMBER IS
RVAL INTEGER;
LOCALVAR INTEGER;
BEGIN
SELECT COMPUTERID INTO LOCALVAR
FROM DATAUPLOAD.COMPUTER_LIST WHERE
COMPUTERNAME = COMPNAME AND
SITE = SITEID;
EXCEPTION
WHEN NO_DATA_FOUND THEN
LOCALVAR := 0;
RVAL:=LOCALVAR;
RETURN RVAL;
dbms_output.put_line('Local var');
dbms_output.put_line(LOCALVAR);
END MYPROC_GETCOMPID;
It gets created fine. My question is, how the F can I create a bit pl/SQL to debug this?
I tried:
begin
declare localin integer;
localin := MYPROC_GETCOMPID('MYPC1',1);
dbms_output.put_line('LOCALINT');
dbms_output.put_line(LOCALINT);
END;
... and I tried
begin
declare localin integer;
localin = MYPROC_GETCOMPID('MYPC1',1);
dbms_output.put_line('LOCALINT');
dbms_output.put_line(LOCALINT);
END;
but boy does neither of these work.
Could someone please tell me whats going wrong??
AND can you see that exception in the function? thats there because for some reason a simple is null statement fails. any guesses as to why that is happening?
many thanks for your time
IHi John,
Sorry, I didn't include the error output because I thought that it would be obvious to people what was wrong with how I was attempting to call the function. I'm a bit of an oracle newbie (I'm sure thats more than obvious)
Thanks for your help on the exception. I was just looking for reassurance that I was needing to handle the error like that. The data structure means that I shouldn't get too many rows (1:1 relationship between computername and computerID, thankfully!)
Heres the responses from SQL*Plus (this is Oracle8i by the way). The responses are the same whether 'MYPC1' exists in the computer_list or not, so I am guessing that there is just something I am doing not quite right in the syntax for calling this function. (infact, see below for a hello world example that also fails).
--here we see I have set up for screen output okay:-
SQL> BEGIN
2 dbms_output.put_line('Hello World!');
3 END;
4 /
Hello World!
PL/SQL procedure successfully completed.
SQL>
-- first failure:
SQL> begin
2 declare localin integer;
3 localin = MYPROC_GETCOMPID('MYPC1',1);
4 dbms_output.put_line('localin' );
5 dbms_output.put_line(localin );
6 END;
7 /
localin = MYPROC_GETCOMPID('MYPC1',1);
ERROR at line 3:
ORA-06550: line 3, column 9:
PLS-00103: Encountered the symbol "=" when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table LONG_ double ref
char time timestamp interval date binary national character
nchar
--- so I figure, this is a declarative syntax issue ( = as opposed to := ), so I try the following:
SQL> begin
2 declare localin integer;
3 localin := MYPROC_GETCOMPID('MYPC1',1);
4 dbms_output.put_line('localin' );
5 dbms_output.put_line(localin );
6 END;
7 /
localin := MYPROC_GETCOMPID('MYPC1',1);
ERROR at line 3:
ORA-06550: line 3, column 9:
PLS-00103: Encountered the symbol "=" when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table LONG_ double ref
char time timestamp interval date binary national character
nchar
The symbol "<an identifier>" was substituted for "=" to continue.
ORA-06550: line 4, column 12:
PLS-00103: Encountered the symbol "." when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table LONG_ double ref
char time timestamp interval date binary national charac
ORA-06550: line 5, column 12:
PLS-00103: Encountered the symbol "." when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table LONG_ double ref
char time timestamp interval date binary national charac
ORA-06550: line 6, column 1:
PLS-00103: Encountered the symbol "END" when expecting one of the following:
begin function package pragma
--- finally , 'hello world' failure :
SQL> begin
2 declare localst varchar(11);
3 localst = 'hello world';
4 dbms_output.put_line('localst');
5 dbms_output.put_line(localst);
6 END;
7 /
localst = 'hello world';
ERROR at line 3:
ORA-06550: line 3, column 9:
PLS-00103: Encountered the symbol "=" when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table LONG_ double ref
char time timestamp interval date binary national character
nchar -
How to Debug PL/SQL in SQL Developer?
I am not able to debug PL/SQL and i have following error please advice how I can enable privileges and I want to know the steps of debugging.
Connecting to the database My_connection.
Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
ORA-06512: at line 1
This session requires DEBUG CONNECT SESSION and DEBUG ANY PROCEDURE user privileges.
Process exited.
Disconnecting from the database My_connection.
Thanks for your timeYou need to get the DBA for the database to grant your account the privileges mentioned in the error message.
Once that is done it should just work.
Make sure you compile for debug
You need some way to stop the debugger from just running through the code to the end
- either set breakpoints
- or Use Tools|Preferences|Debugger|Start Debugging Option to Step Into. -
Read from Page Approval List Table in a PL/SQL procedure
Need help, I am new to OA Framework.
We have a requirement to validate the added requisition Approvers against some criteria.
The Approvers are added using Add approvers on the Requisition Creation page.
The source code shows: ApproverListRn.ApprListTable as the name of the table list which holds the approver names.
1) Is there a way to read the data from ApproverListRn.ApprListTable in a PL/SQL procedure?
2) How and when does this list of approvers get added to the po_approvallist_headers table? which package is used?
Please any help is greatly appreciated.
Thanks1) Is there a way to read the data from ApproverListRn.ApprListTable in a PL/SQL procedure?
Using OAF, you can read the value from the table and through OracleCallableStatement you can call a pl/sql procedure passing the read value.2) How and when does this list of approvers get added to the po_approvallist_headers table? which package is used?
This is page and code specific. You will have to debug and find out.--Shiv -
Debugging PL/SQL with parameters
Hi,
I can successfully debug a PL/SQL procedure that takes no parameters. However when I choose a procedure that takes parameters and choose "Debug", as soon as the dialog that builds the PL/SQL block that calls my procedure opens, it displays "An error was encountered performing the requested action"
Any ideas as to what I'm doing wrongCheck
http://www.oracle.com/technology/obe/obe9051jdev/plsqlobe/obeplsql.htm#t2
Frank
Maybe you are looking for
-
looking for an app or technique to record to dvd individual chapyers from a movie dvd that i own? not related to idvd or imovie
-
How can I convert Bigint value which produced with Timespan?
Below from MS SQL, tResultTime's datatype is Bigint Below from my C# project's UI and I need to get a result like "Elapsed Time". How can I get that?
-
Hi All Is that possible that we can use Arrays in PL/SQL. If yes, pls guide me how can we define dynamic array in pl/sql. Thanks & Regards Mani
-
Console window problems in browser
Is there any way to increase the size of the console window that contained in the browser form? It is not as large as the VM display and I have to constantly move the subset of the window that is displayed. Thanks
-
DTW error while uploading the GL account
Hi all I m trying to upload GL accounts from dtw with segment account and I created segment in sap but dtw uploaded the title account but active account is not uploading and its giving error ...enter valid code . please help Thanks \ ricky