FND_REQUEST PL/SQL procedure with parameters
Hi guys
I created a concurrent program, using the PL/SQL procedure that has 2 parameters. I try to call the concurrent program to help
v_req_id: = FND_REQUEST. SUBMIT_REQUEST ('INV', 'OMS_POP_INVVALUES_P',
NULL, SYSDATE, FALSE, l_on_date, l_org_id,.
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
);
COMMIT;
However, the competitor programming always fail with
* Starts * August 26, 2013 14:02:31 error ORACLE 6550 for Cause of FDPSTP: FDPSTP failed due to the ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in the call to 'OMS_POP_INVVALUES_P' ORA-06550: line 1, column 7: PL/SQL: statement ignored
and I doubt that it is because the database procedure call is not correct.
I put four parameters with the simultaneous program, as they were with the procedure itself, which are
p_on_date BY DATE, NUMBER, errbuff OUT VARCHAR2, OUT VARCHAR2 retcode p_org_id
Help, please
Kind regards
REDA
Okay I solved the problem of
1. change the order of the parameters in the procedure
CREATE OR REPLACE PROCEDURE OMS_POP_INVVALUES_P)
errbuff OUT VARCHAR2, retcode ON NUMBER, p_on_date AS, p_org_id in NUMBER)
IS
and by changing the call of simultaneous program as follows
l_req_id: =.
fnd_request.submit_request ('INV', 'OMS_POP_INVVALUES_P',
NULL, SYSDATE, FALSE, l_in_date, l_org_id, CHR (0));
: SYSTEM. Message_Level: = '25';
COMMIT;
After removing all the parameters of the list of program parameters. No need to pass a value for errbuff and retcode, just pass other parameters and put an end to the list of parameters with CHR (0). Hope it's useful for someone else there.
Kind regards
REDA
Tags: Oracle Applications
Similar Questions
-
Calling stored procedures with parameters with the database connectivity Toolkit
Hi all
I'm new to the forum and struggling to find a solution to a particular problem I have in this respect, using the LabVIEW Database Connectivity Toolkit on a project, I am currently working on my work. I have a database in which I tables and stored procedures with parameters. Some of these stored procedures have input, output and return parameters.
I tried to follow this example, but to no avail: http://digital.ni.com/public.nsf/allkb/07FD130746083E0686257300006326C4?OpenDocument
Such a stored procedure I am working on the implementation is named "dbo.getAllowablePNs", running "SELECT * from DeviceType" (DeviceType is the table). In this case, it requires no input parameter, it has an output parameter that generates the table [cluster] and has a return parameter that returns an integer value (status code for execution) to show if an error occurred. The DeviceType table has 3 columns; ID (PK, int not null), PN (nvarchar ((15), null) and NumMACAddresses (int, null).) I have surpassed many examples and I talk to the support OR try to implement this and similar procedures stored in LabVIEW but have not been successful. I am able to connect to the database with the VI of open connection without error, but spin in some confusion as a result of this step. I then try to use the VI of parameter query create to call the stored procedure and set the parameters. I guess I would then use the Set parameter value for each parameter that is connected to the entry of parameters on the previous query with parameters VI VI? I am also having some confusion during and after these steps as well. I would greatly appreciate advice or suggestions that anyone could have in this situation because I am not a SQL expert. Also, I would be happy to provide more information that might be useful.
Kind regards
Jon
Here's what I use to do this. I think I had to change him create parameterized query VI for him to work. There is a post on the forum about this somewhere.
-
Call the PL/SQL procedure with in out parameter of OIC clob
Hello
For a few days, I am facing a problem. I have to call the pl/sql procedure with colb parameter out. I use c ++ and OIC (don't ask me why :)).
I use a pl/sql problem test procedure:
create or replace function Test (longField outside clob) return number is
Number of result;
Start
longField: = 'prefix ';
Result: = 12;
Return (result);
end Test;
So I do all the stuff with the connection to the DB,
I prepare the statement: "start: res: = test(:param); end; »
So I OCIHandleAlloc (m_pCtx-> hpEnv,
(void *) & m_hpStatement,.
OCI_HTYPE_STMT,
0,
(NULL);
and
OCIStmtPrepare (m_hpStatement,
m_pCtx-> hpErr,
(...),
(...),
OCI_NTV_SYNTAX,
OCI_DEFAULT);
Before the binding I prepare parameters. For a clob I devote to the lob Locator:
OCIDescriptorAlloc ((dvoid *) m_pCtx-> hpEnv, (dvoid *) & m_pLobLocator,)
(ub4) OCI_DTYPE_LOB (size_t) 0, (dvoid *) 0);
OCILobEnableBuffering (m_pCtx-> hpContext, m_pCtx-> hpErr, (OCILobLocator *) m_pLobLocator);
that I bind parameters using OCIBindByName and OCIStmtExecute statement execution.
I get an error
---------------------------
Microsoft Visual C++
---------------------------
Unhandled exception in... (ORAOCIEI11. (DLL): 0xC0000005: Access Violation.
My question is: is it possible to call the pl/sql procedure with parameter BEAK clob?
If Yes, what steps I need to do to succeed?
Thank you for your response.Hello
Of course, it is possible :)
Show that you are your piece of code that is binding.
Are you sure you had correctly the lob descriptor in the call to bind? -
Call the PL/SQL procedure with different parameters?
I use PL/SQL for web development. I have a page of PL/SQL which collects information and returns the user off site with one return url (another PL/SQL procedure).
I have the return procedure with every documented return variable (default null) in order to always take the return. However, there are (reported... cannot reproduce because of the nature of the business) cases where a 404 error is returned because of the incompatibility of parameter.
Is it possible to proceed regardless of the parameters? Someone at - it suggestions?
Thank you!user2960509 wrote:
My problem is that they sometimes send back of settings that do not match what I expect.
Use the interface "+ flexible +" mod_plsql - see the Oracle® HTTP Server mod_plsql user's Guide for the documented details.
The signature of the procedure parameter is as follows (it is called by mod_plsql using tables of name value pairs):
create or replace procedure Scott.MyWebProc( name_array owa.vc_arr, value_array owa.vc_arr) is ...
In your code, you just browse the berries to get the name values passed query string. You can even filled an associative array in your code (a table indexed by string and no number, where the index string represents the name of param)-this approach can make it pretty easy for the code make reference to a parameter, with little effort on your part to provide an interface to query by name for code to get the value of a parameter name.
To enable the flexible (aka parameter 2) call interface, precede the call to web with an exclamation character. For example
http://my-webserbver.my-domain.com/pls/dad/!scott.mywebproc?name-1=val-1&name-2=val-2..,name-n=val=n
-
How to run a procedure with parameters in pl/sql collections?
I created a procedure with parameter from the collection. Can somone help me how to run a procedure in passing the parameters in the collection.
Package and how to create is successful. But I get the error message when executing the procedure.
ORA-06550: line 3, column 19:
PLS-00222: no function with name 'T_TAB' does exist in this scope
I gave the example of code here. Can someone please help me solve this problem.
-Spec package
create or replace package pkg_dist is
TABLE index IS THE NUMBER of t_tab_num TYPE of PLS_INTEGER;
procedure prc_test (a t_tab_num IN,
b IN t_tab_num,
c IN OUT t_tab_num);
end pkg_dist;
-Package body
create or replace package body is pkg_dist
procedure prc_test (a t_tab_num IN,
b IN t_tab_num,
c IN OUT t_tab_num) is
Start
IF (a (16) = 0) then
(16) c: = 0;
c (17): = 0;
c (18): = 0;
end if;
c (15): = (14)-(15)-a (16);
(16) c: = b (16) /b (17);
c (17): = 50;
(18) c: = a (16) * 2;
end prc_test;
end pkg_dist;
-executeing procedure
declare
TABLE index IS THE NUMBER of t_tab TYPE of PLS_INTEGER;
x t_tab: = t_tab (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
y t_tab: = t_tab (0,10,15,20,25,30,35,40,45,50,60,75,100,125,150,200,250,500);
z t_tab;
BEGIN
pkg_dist.prc_test (x, y, z);
dbms_output.put_line (z (18));
END;
Error:
--------------------------------------------------------------------------------
ORA-06550: line 3, column 19:
PLS-00222: no function with name 'T_TAB' does exist in this scopeMy suggestion would be:
CREATE OR REPLACE PACKAGE pkg_dist IS PROCEDURE prc_test (a IN SYS.odcinumberlist, b IN SYS.odcinumberlist, c IN OUT SYS.odcinumberlist); END pkg_dist; CREATE OR REPLACE PACKAGE BODY pkg_dist IS PROCEDURE prc_test (a IN SYS.odcinumberlist, b IN SYS.odcinumberlist, c IN OUT SYS.odcinumberlist) IS BEGIN IF (a (16) = 0) THEN c (16) := 0; c (17) := 0; c (18) := 0; END IF; c (15) := a (14) + a (15) + a (16); c (16) := b (16) / b (17); c (17) := 50; c (18) := a (16) * 2; END prc_test; END pkg_dist; / DECLARE x SYS.odcinumberlist; y SYS.odcinumberlist; z SYS.odcinumberlist; BEGIN x := sys.odcinumberlist (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); y := sys.odcinumberlist (0,10,15,20,25,30,35,40,45,50,60,75,100,125,150,200,250,500); z := sys.odcinumberlist (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); pkg_dist.prc_test (x, y, z); DBMS_OUTPUT.put_line (z (18)); END; /
See you soon,.
Manik. -
How to perform the procedure with parameters of type collection
Hello
I have the setting as the procedure
CREATE OR REPLACE TYPE NUMBERLIST AS TABLE NUMBER;PROCEDURE addGroup ( Id IN NUMBER, sId IN NUMBER, gIds IN NUMBERLIST)
/
could you help me by asking this type as a parameter the procedure...
Thank youThis is the type:
SQL> create or replace type NUMBERLIST is table of number; 2 / Type created.
This is the procedure:
SQL> create or replace PROCEDURE addGroup ( 2 Id IN NUMBER, 3 sId IN NUMBER, 4 gIds IN NUMBERLIST) 5 is 6 begin 7 null; 8 end; 9 / Procedure created.
And you call it this way:
SQL> declare 2 n numberlist := numberlist(1,2,3,4); 3 begin 4 addGroup(1,2,n); 5 end; 6 / PL/SQL procedure successfully completed.
Max
[My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/01/23/la-forza-del-foglio-di-calcolo-in-una-query-la-clausola-model/] -
I have about 35 with Select INSERT in a single script file (example below) and they all accept two parameters (username, location).
What is the best way to create a package in this case?
And, instead of coding in hard pass UserID and its location; How to pass those values to the package?
declare
sUserID varchar2 (6): = "ABC112";
Location varchar2 (6): = "US0009";
INSERT INTO MyTempTable (city, State, Zip)
SELECT City, State, zip from MyTable1
WHERE UserID = 'JDOE01' AND the location = "US0009".
commit;
INSERT INTO MyTempTable (city, State, Zip)
SELECT City, State, zip from MyTable2
WHERE UserID = 'JDOE01' AND the location = "US0009".
commit;
And so on...
Hello
881668 wrote:
I have about 35 procedures in a single script file (example below) and they all accept two parameters (username, location).
What is the best way to create a package in this case?
And, instead of coding in hard pass UserID and its location; How to pass those values to the package?
declare
sUserID varchar2 (6): = "ABC112";
Location varchar2 (6): = "US0009";
INSERT INTO MyTempTable (city, State, Zip)
SELECT City, State, zip from MyTable1
WHERE UserID = 'JDOE01' AND the location = "US0009".
commit;
INSERT INTO MyTempTable (city, State, Zip)
SELECT City, State, zip from MyTable2
WHERE UserID = 'JDOE01' AND the location = "US0009".
commit;
And so on...
The code you posted is not ' t have procedures. When you say 'procedure', do you mean 'anonymous block '?
Maybe you want a package body that looks like this:
CREATE or REPLACE PACKAGE BODY fubar
ASPROCEDURE insert_MyTempTable
(
sUserID in VARCHAR2
in_Location IN VARCHAR2
)
IS
BEGININSERT INTO MyTempTable (city, State, Zip)
SELECT City, State, zip
From MyTable1
WHERE UserID = sUserID
AND location = in_Location
UNION ALL
SELECT City, State, zip
From MyTable2
WHERE UserID = sUserID
AND the location = in_Location;commit; -Maybe
END insert_MyTempTable;Fubar END;
/
DISPLAY ERRORSBefore you create the package body, however, you must create a package specification, which can be just the names of procedure and lists of arguments of the package body, like this;
CREATE or REPLACE PACKAGE fubar
ASPROCEDURE insert_MyYempTable
(
sUserID in VARCHAR2
in_Location IN VARCHAR2
)
;Fubar END;
/
DISPLAY ERRORSNote that you can declare the types of the arguments (for example, VARCHAR2) in the package, but no details such as the maximum length (in other words, you don't tell VARCHAR2 (6).) The actual size is determined by the appellant.
If a variable is used in a SQL statement, make sure that there not exactly the same name as a column in any table used in this declaration. Since the argument is used in a SQL statement, and the statement references a table that has a column called location, location isn't a good name for the argument. That's why I called it in_location.
It may be better not to be INVOLVED in the procedure. It is better to give the appellant the opportunity to COMMIT or ROLLBACK later.
-
Hi all!
I learn PL/SQL on the book by Steve Bobrovsky (specified below, sample comes from it) and I have a question.
In the procedure of the below specified program used a currentElement integer variable to get the reference to the line in the nested table of data type % ROWTYPE.
Meanwhile, the program itself uses a common FOR... LOOP counter I have.
When I substituted a global variable of INTEGER type such for... The LOOP counter, an APEX have returned an error "ORA-01403: no data found.DECLARE TYPE partsTable IS TABLE OF parts%ROWTYPE; tempParts partsTable := partsTable(); CURSOR selectedParts IS SELECT * FROM parts ORDER BY id; currentPart selectedParts%ROWTYPE; currentElement INTEGER; PROCEDURE printParts(p_title IN VARCHAR2, p_collection IN partsTable) IS BEGIN DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE(p_title || ' elements: ' || p_collection.COUNT); currentElement := p_collection.FIRST; FOR i IN 1 .. p_collection.COUNT LOOP DBMS_OUTPUT.PUT('Element #' || currentElement || ' is '); IF tempParts(currentElement).id IS NULL THEN DBMS_OUTPUT.PUT_LINE('an empty element.'); ELSE DBMS_OUTPUT.PUT_LINE('ID: ' || tempParts(currentElement).id || ' DESCRIPTION: ' || tempParts(currentElement).description); END IF; currentElement := p_collection.NEXT(currentElement); END LOOP; END printParts; BEGIN FOR currentPart IN selectedParts LOOP tempParts.EXTEND(2); tempParts(tempParts.LAST) := currentPart; END LOOP; printParts('Densely populated', tempParts); FOR i IN 1 .. tempParts.COUNT LOOP IF tempParts(i).id is NULL THEN tempParts.DELETE(i); END IF; END LOOP; FOR i IN 1 .. 50 LOOP DBMS_OUTPUT.PUT('-'); END LOOP; printParts('Sparsely populated', tempParts); END; /
When I tried to manage this code in SQL * Plus, the following picture emerged:DECLARE TYPE partsTable IS TABLE OF parts%ROWTYPE; tempParts partsTable := partsTable(); CURSOR selectedParts IS SELECT * FROM parts ORDER BY id; currentPart selectedParts%ROWTYPE; PROCEDURE printParts(p_title IN VARCHAR2, p_collection IN partsTable) IS BEGIN DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE(p_title || ' elements: ' || p_collection.COUNT); FOR i IN 1 .. p_collection.COUNT LOOP DBMS_OUTPUT.PUT('Element is '); IF tempParts(i).id IS NULL THEN DBMS_OUTPUT.PUT_LINE('an empty element.'); ELSE DBMS_OUTPUT.PUT_LINE('ID: ' || tempParts(i).id || ' DESCRIPTION: ' || tempParts(i).description); END IF; END LOOP; END printParts; BEGIN FOR currentPart IN selectedParts LOOP tempParts.EXTEND(2); tempParts(tempParts.LAST) := currentPart; END LOOP; printParts('Densely populated', tempParts); FOR i IN 1 .. tempParts.COUNT LOOP IF tempParts(i).id is NULL THEN tempParts.DELETE(i); END IF; END LOOP; FOR i IN 1 .. 50 LOOP DBMS_OUTPUT.PUT('-'); END LOOP; printParts('Sparsely populated', tempParts); END; /
What's not in the code (or what I did not understand)? Help please!Densely populated elements: 10 Element is an empty element. Element is ID: 1 DESCRIPTION: Fax Machine Element is an empty element. Element is ID: 2 DESCRIPTION: Copy Machine Element is an empty element. Element is ID: 3 DESCRIPTION: Laptop PC Element is an empty element. Element is ID: 4 DESCRIPTION: Desktop PC Element is an empty element. Element is ID: 5 DESCRIPTION: Scanner -------------------------------------------------- Sparsely populated elements: 5 DECLARE * ERROR at line 1: ORA-01403: no data found ORA-06512: at line 14 ORA-06512: at line 35
Your error occurs because you are dealing with a sparsely populated collection and using an index for items that do not exist.
For collections of the low density of population, you must iterate through using FIRST and THEN as modeled not from 1 to COUNT.
The crucial difference between your code and the example is:
tempParts(i)
Which, as you have demonstrated, doesn't work very well (!) if there is no item (i).
The code example is a little unusual in my opinion.
currentElement := p_collection.FIRST; FOR i IN 1 .. p_collection.COUNT LOOP ... currentElement := p_collection.NEXT(currentElement); END LOOP;
It works, but it's an unusual way to iterate through a collection of rare which is perhaps most often done like this:
currentElement := p_collection.FIRST; WHILE(currentElement IS NOT NULL) LOOP ... currentElement := p_collection.NEXT(currentElement); END LOOP;
Which is perhaps less open to confusion.
In the end, the distinction between
tempParts(currentElement).id
and
tempParts(i).id
is crucial.
-
Calling batch file. SQL file with parameters
Hi all:
I may / may not have correct code, because I can't find a Google result for answering the question and cannot test this solution until it goes live, so I want to make sure I have it correct.
I have a batch (file1.bat) file that implements some variables. Inside this file, I call a .sql like this procedure:
sqlplus username/password@environment @c:\sql\export.sql cID %%d sID % % exportFilename %
How do I use these settings within the export.sql so they are passed to the oracle procedure?
I am currently using the following code:
BEGIN
sinterface. Export (1, 2 & 3);
EXCEPTION
WHILE OTHERS
THEN NULL;
END;
This code will work? I know that if I call another code file1.bat .bat file, I can get the settings such as:
SET of cID = %1
SET sID = %2
SET exportFileName = %3
OR
SET CompID = compID %
SET SiteID = siteID %
SET exportFileName = % exportFilename %
But I have no idea if / how this translates an oracle .sql file to call a stored procedure. I got a result of Google to show using the & 1 & 2 & 3 to set the parameters of this batch file, but as I can't test it, I have no idea if it would work.
Anyone would be able to confirm the correct method?
Thank you
AndyAndy,
Welcome to the Oracle Forums. Please take a few minutes to review the following:
This forum is for general issues Oracle Forms. Please post your question in the forum SQL and PL/SQL . If you have a general question of forms, by all means, ask it here! ;-)
That said, you asked...
How do I use these settings within the export.sql so they are passed to the oracle procedure?
I am currently using the following code:
BEGIN
sinterface.export(&1, &2, &3);
EXCEPTION
WHEN OTHERS
THEN NULL;
END;
Since you simply call a Script SQL of your batch file file is not really necessary to use an anonymous block to call your stored procedure. In addition, as you use the OTHER generic exception - you never know if there was a mistake. Really, you shouldn't use SO that OTHERS value NULL. This isn't a very good programming practice. As for your variables, I would recommend that you set the substitution variables in your script and set your settings to access these variables. For example:
DEFINE c_id = &1 (CHAR)
DEFINE s_id = &2 (CHAR)
DEFINE f_name = &3 (CHAR)
Execute sinterface.export(c_id, s_id, f_name);
I would not include an exception handler at this level that any exception must propagate to the calling program.
Craig...
How to move from records in a procedure with Table Type as a parameter block
HelloHow can I move all records in a block of PL/SQL procedure with argument of Type Table or Refcursor.
I created a procedure in the backend with a parameter of Type table. Of the form, I want to call this procedure with the argument that ALL of the records in BULK.
Y at - it a simple method for it.
Thanks in advance
Rizly
Rizly,
I recently put in place a level of forms audit process that uses this method very - package of database, which takes an array of Records as a parameter. Forms 10 G supports this nicely. We have sought to implement this through a set of database triggers (update, insert, delete) but due to our requirements, it was not the best place to do so that we have implemented this in forms.
Brief history on my form. The main block was based on a table, and the block has been marked NOT can, Insert and Delete. If the user wants to insert, update, or delete a record they clicked on Insert, Update, or Delete button that opens a popup form where they seized a reason Code and a Description of the transaction and then clicked a button Save.
Here's what I did.
Database side *.
1 package database with a Record of PL/SQL and PL/SQL records in the Table variable declared in the Package specification.
2. create INSERT_?, warning? and DELETE_? package procedures to manage integration, updates and deletions.
Secondary forms *.
1 create a table (control) Non-Base with all fields block
2. create a button that performs a loop on the block and all values assigns to the variable of records in the Table (ToR) forms (typed off the DB package)
3. pass the ToR to the appropriate database package procedure.
Here is an example of the code I wrote:
Package body *. Secondary forms * (all this coding was limited to the Insert, update or delete buttons.) The following example is the Insert button) I knew not when I started this process of forms if she was going to work because I tried to do something similar to this when I was working with Forms 6i and Oracle Enterprise Business Suite and Forms 6i supported not Ref Cursor and Table of documents very well so I didn't know at first if it would work. Search in forms documentation, I found that Forms 10 g has supported this type of functionality and this process works very well and it was surprisingly fast - at least in my usage, it is very fast. :) I hope this helps. If I or someone elses answer was useful, please mark accordingly
Database side *.
Package specifications * (Note: replace
CREATE OR REPLACE PACKAGE
-- Beginning of Package Body -------------------------------------------------------------------------
-- ---------------------------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE BODY
/* When-Button-Pressed Trigger */
DECLARE
vBlockName VARCHAR2(20) := 'REPORT_CATEGORIES';
vBlockItem VARCHAR2(61);
vCurrItem VARCHAR2(61);
nRecCnt NUMBER := 1;
/* Here is where you create your Forms Variable TYPEd off the Package Table of Records (ToR) */
/* Since it is a table of records, you could easily add multiple rows to the ToR if your form uses a multi-record block */
p_tlog cir.transaction_log_pkg.tbl_t_log;
BEGIN
vCurrItem := vBlockName||'.'||Get_Block_Property(vBlockName,FIRST_ITEM);
Go_Item(vCurrItem);
-- 1. Endure each field if populated.
-- 2. Check for Duplicates (Handled in W-V-I)
IF ( Name_In(:system.Cursor_Item) IS NULL ) THEN
--Fail the form at the field that is NULL
send_alert.msg('s','All fields are required. Please enter a unique value.');
RAISE Form_Trigger_Failure;
END IF;
WHILE ( vCurrItem IS NOT NULL ) LOOP
vBlockItem := :system.cursor_item;
-- Loop through the block and CALL Insert_Record for each Block Item.
/* 1 */ p_tlog(nRecCnt).table_name := vBlockName;
/* 2 */ p_tlog(nRecCnt).trans_type := Name_In(vBlockName||'.CAT_TYPE');
/* 3 */ p_tlog(nRecCnt).trans_key := Name_In(vBlockName||'.ID');
/* 4 */ p_tlog(nRecCnt).action := 'INSERT';
/* 5 */ p_tlog(nRecCnt).column_name := substr(vBlockItem,instr(vBlockItem,'.')+1,length(vBlockItem));
/* 6 */ p_tlog(nRecCnt).old_value := NULL;
/* 7 */ p_tlog(nRecCnt).new_value := Name_In(vBlockItem);
/* 8 */ p_tlog(nRecCnt).trans_date := sysdate;
/* 9 */ p_tlog(nRecCnt).user_id := :Global.userid;
/*10 */ p_tlog(nRecCnt).reason_code := Name_In(vBlockName||'.REASON_CODE');
/*11 */ p_tlog(nRecCnt).comments := Name_In(vBlockName||'.COMMENTS');
vCurrItem := Get_Item_Property(vBlockItem,NEXTITEM);
next_item;
nRecCnt := nRecCnt + 1;
END LOOP;
-- 3. Insert
-- Call TRANSACTION_LOG_PKG.Insert_Record
-- --------------------------------------
Craig...
How to get 2 out of procedure with sql dynamic param?
Hello
following my other question on the treatment in the ranks, so that I did a procedure defined ranges for the table I want to deal with;
I did another procedure to obtain a particular range for treatment and that's where I have a problem;
My data are:
{
CREATE THE TABLE PRECUBE. TEST_STG_TMO_RANGES
(
NUMBER OF GLASS FIBER,
MIN_RID VARCHAR2 (18 BYTE),
MAX_RID VARCHAR2 (18 BYTE)
)
tablespace UTI_DAT;
Insert into TEST_STG_TMO_RANGES (GRP, MIN_RID, MAX_RID) values (0, 'AABKSxAAEAACW3pAAA', 'AABKSxAAEAADqCICcQ');
Insert into TEST_STG_TMO_RANGES (GRP, MIN_RID, MAX_RID) values (1, "AABKSxAAEAADqCJAAA", "AABKSxAAEAAD + wICcQ");
Insert into TEST_STG_TMO_RANGES (GRP, MIN_RID, MAX_RID) values (2, ' AABKSxAAEAAD/QJAAA', 'AABKSxAAEAAECyICcQ');
Insert into TEST_STG_TMO_RANGES (GRP, MIN_RID, MAX_RID) values (3, 'AABKSxAAEAAEFQJAAA', 'AABKSxAAEAAEL8ICcQ');
Insert into TEST_STG_TMO_RANGES (GRP, MIN_RID, MAX_RID) values (4, 'AABKSxAAEAAEMSJAAA', 'AABKSxAAEAAEPwICcQ');
}
my package:
{
create or replace
PACKAGE C_UTI_BASIC AS
procedure P_GET_RANGE (table_owner_in in varchar2
TABLE_NAME_IN in varchar2
range_no number
Min_RANGE_OUT OUT varchar2
max_range_OUT OUT varchar2
);
END C_UTI_BASIC;
}
My procedure:
{
procedure P_GET_RANGE (TABLE_OWNER_IN in varchar2
TABLE_NAME_IN in varchar2
RANGE_NO number
MIN_RANGE_OUT OUT varchar2
MAX_RANGE_OUT OUT varchar2
)
is
DDL_STATEMENT varchar2 (4000);
Start
DDL_STATEMENT: ='select MIN_RID, MAX_RID in MIN_RANGE_OUT, MAX_RANGE_OUT in '. TABLE_OWNER_IN |'. ' || TABLE_NAME_IN | "_RANGES where PRV =' | RANGE_NO;
immediately run DDL_STATEMENT;
DBMS_OUTPUT. PUT_LINE (DDL_STATEMENT);
DBMS_OUTPUT. Put_line ('Min_RANGE_OUT :'||) Min_RANGE_OUT);
DBMS_OUTPUT. Put_line ('max_range_OUT :'|| max_range_OUT);
end P_GET_RANGE;
}
I tried to call the procedure with:
{
declare
V_MIN_RANGE_OUT varchar2 (30);
v_Max_RANGE_OUT varchar2 (30);
Start
C_UTI_BASIC. P_GET_RANGE (TABLE_OWNER_IN = > 'PRECUBE')
, TABLE_NAME_IN = > 'TEST_STG_TMO '.
, RANGE_NO = > '4'
, MIN_RANGE_OUT = > V_MIN_RANGE_OUT
, MAX_RANGE_OUT = > v_Max_RANGE_OUT
);
end;
}
but it ends with the error:
Error report:
ORA-06510: PL/SQL: not supported by the user-defined exception
ORA-06512: at "DWH_ADMIN. C_UTI_BASIC', line 2331
ORA-00905: lack of keyword
ORA-06512: at line 5
06510 00000 - "PL/SQL: not supported by the user-defined exception.
* Cause: A user-defined exception has been raised by PL/SQL code, but
not been processed.
* Action: Fix the problem that causes the exception or write an exception
Manager for this condition. Or you may have to contact your
Director of application or DBA.
When I jump the "run immediately" just to see what is output through DBMS output here it is:
{
Select MIN_RID, MAX_RID in MIN_RANGE_OUT, PRECUBE MAX_RANGE_OUT. TEST_STG_TMO_RANGES where PRV = 4
Min_RANGE_OUT:
max_range_OUT:
}
the select statmetent seems OK for me, but the parameters are not met and have the value null;
I would appreicate advice on where I went wrong here and how achieve a correct output
THS
Rgds
Rgds
Outside the use of SQL statements cr@p Dynamics (i.e. DML and not the DDL as implied by your code) and your total lack of variable bind...
And that is your problem. Your dynamic instruction seeks to select VARIABLES that are out of reach of the dynamic statement itself. The IN such statements should be part of the EXECUTE IMMEDIATE for example
EXECUTE IMMEDIATE ddl_statement INTO min_range_out, max_range_out;
Run the statement in a stored procedure with Out parameters and
Hi allI have a stored procedure that calls a select statement. Here it is...
CREATE OR REPLACE PROCEDURE BLABLA_VIEW_PROCEDURE
* (BLABLA_KEY IN NUMBER, *)
XML_OUTPUT ON VARCHAR)
AS
BEGIN
SELECT SYS. XMLTYPE.getStringVal (OBJECT_VALUE) in XML_OUTPUT FROM BLABLA_VIEW WHERE extractValue (OBJECT_VALUE, ' / BLABLA_TYPE/BLABLA_KEY ') = 2876;
END;
Is to have both IN and OUT parameters as described above. I am able to compile and run the procedure.
The problem I want to share with everyone is...
I want to run the stored procedure together with a single EXEC command.
I tried different ways using the EXEC command but of no use.
Could someone help me?
Thanks in advance.
Published by: user10763276 on June 3, 2010 15:47
Please visit the following...
sudhakar@ORCL>CREATE OR REPLACE PROCEDURE BLABLA_VIEW_PROCEDURE
2 (BLABLA_KEY IN NUMBER,
3 XML_OUTPUT OUT VARCHAR)
4 AS
5 BEGIN
6 XML_OUTPUT := BLABLA_KEY || ' and whatever else...';
7 END;
8 /
Procedure created.
sudhakar@ORCL>
sudhakar@ORCL>var XML_OUTPPUT varchar2(100);
sudhakar@ORCL>exec BLABLA_VIEW_PROCEDURE (9151, :XML_OUTPPUT);
PL/SQL procedure successfully completed.
sudhakar@ORCL>print XML_OUTPPUT;
XML_OUTPPUT
--------------------------------------------------------------------------------
9151 and whatever else...
sudhakar@ORCL>
Post tells you...
var OUTPUT VARCHAR
exec BLABLA_VIEW_PROCEDURE (9151, :OUTPUT);
print OUTPUT
VARCHAR is not a valid TYPe to declare. Use VARCHAR2 (nnn) where nnn is a number.
VR,
Sudhakar B.
Problem with pl/sql procedure, trying to get the value of the user during execution
Hello
Using oracle 11.2.0.3
Can run sql that gets the value of the user during the fine workmanship and also via an anonymous block.
uses of SQL & Enter_Product_Number
anonymous block using: Enter_Product_number.
However, get problems when trying to create a pl/sql procedure, use one of the above
relevant below tried code part & and: buit works do not error, try bad bind variable if used: and ora-600 if try use &.
How can we have a procedure from pl/sql that can call and receives a value of user during execution?
Only way around what I can think of is to pass parameters to the procedure
Thank you
create or replace procedure ins_into_issues is
v_nd_rec_cnt number (10);
v_normal_rec_cnt number (10);
Start
Select count (*)
in v_nd_rec_cnt
refmast.issues I have
where i.iss_product_num = & old_nd_product_number;
Select count (*)
in v_normal_rec_cnt
refmast.issues I have
where i.iss_product_num = & normal_product_number;
-code below commented above works.
end;
Hello
what something like this:
create or replace procedure INS_INTO_ISSUES ( in_normal number, in_old number ) is v_nd_rec_cnt number(10); v_normal_rec_cnt number(10); begin select count(*) into v_nd_rec_cnt from refmast.issues i where i.iss_product_num = in_old; -- select count(*) into v_normal_rec_cnt from refmast.issues i where i.iss_product_num = in_normal; end;
concerning
Kay
anonymous block of pl/sql procedure ended with no result
started just learning oracle pl/sql and I am facing a problem here.
I have no problem to compile, but whenever I run the nth procedure would seem except the following message is displayed and not showing any output that should not be the case: block anonymous filled
I tried to set serveroutput size 50000; changes but nth.
Here is my pl/sql procedure not sure if I'm doing things.
CREATE OR REPLACE PROCEDURE CHECK AS
empnum NUMBER;
EmpName VARCHAR2 (50);
BEGIN
Select employee.e #.
, Employee.Name since it is
in empnum
empname
Join driver used on driver.e # employee.e = #.
Mechanic to join on mechanic.e # driver.e = #;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT. Put_line ('ok');
END CHECK;
/
I'm trying to achieve the same result in the following sql query:
select employee.name, employee.e#
from employee join driver
on driver.e# = employee.e#
join mechanic
on mechanic.e# = driver.e#
where rownum = 1;
If there is no similar records if it will display the employee name and numbers. If there is no such document found it will show an ok message.
My bad, NO_DATA_FOUND is not triggered when a select statement is used like that. This is a way to approach it.
create or replace procedure check
as
number of empnum;
EmpName varchar2 (50);
is_exist boolean;
Start
I'm in)
Select employee.e #.
, Employee.Name since it is
Join driver used on driver.e # employee.e = #.
Mechanic to join on mechanic.e # driver.e = #.
)
loop
is_exist: = true;
dbms_output.put_line (' e #-' | lpad (IE #, 20, ' ') |) ' name ' - | i.Name);
end loop;
If not is_exist then
raise the no_data_found;
end if;
exception
When no_data_found then
dbms_output.put_line ('ok');
end check;
/
This isn't a very elegant way of doing things. But I am limited to knowledge of the requirement of the company. Therefore, the best I could come up with. If you can explain how you're going to put this procedure into your business situation we could help you better.
Run SQL through batch file, with parameters
Hi allI run SQL through Batch files before, but I am a little confused with the execution of the sql with parameters. For example, if I have a named sql file:
insert.sql
Insert into TableA
select * from TableB
where service_dt >= '&&x_start_dt' and service_dt <= '&&x_end_dt';
I can run this problem normally, but including the substitution variables, as in the batch (.bat) file called Execute_insert.cmd is a bit annoying... I played a little with it and cannot operate.Any help would be appreciated.
Thank you
Ed
Change your insert.sql to something more like:
Insert into TableA
select * from TableB
where service_dt >= TO_DATE('&1', 'format mask') and
service_dt <= TO_DATE('&2', 'format mask');
Then, would you call it:
sqlplus user/password @insert.sql 01-oct-2012 31-oct-2012
John
Maybe you are looking for
-
RNDU2000 problem after factory reset
Hi all A friend of mine gave me his RNDU2000. I tried a factory reset. RAIDar find to restart and gave me the choice. I chose XRAID2. After several minutes (test drives, intallatation...) device reboot and stuck with these configuration LED: Power On
-
I have never used HP Datapass for over a year that I've owned this tablet - as far as I know. All of a sudden the screen refuses to ask a password to the HP Datapass. I don't have! I never recorded. How to do this?
-
laptop Envy 17 17-j034ca: can not detect the usb flash drives
Hi, I recently installed windows 7 64 bit on my computer laptop envy 17 17-j034ca. Then, I managed to install all the drivers but it still doesn't detect usb flash drives and I tried to install from the web site of HP and my config but it still does
-
Hello! I'm new in LabVIEW and I'm trying to implement a Microsoft graph chart that read the intensity depending on the time. I need to use a button to record (duration and intensity) data while the key I need to backup the data. I found a few exampl
-
Software removal malware tool Question
Yes, I'm aware that XP support is complete but nevertheless, here's my question: I reinstalled XP in early June. Should I install the tool for may and June, June only, or or months? I have antivirus and anti-malware installed but software would like