Calling packaged procedure from a URL link
I have created a custom APEX application the will allow us to dynamically build help screens for the pages we create with APEX.
In doing this I have created a procedure within a package called "comi_help_util.show_help".
This procedure uses the "htp.p" standard procedure to create a dynamic web page from data stored inside my help tables.
I want to place a "Help" link in the Navigation Bar which will call the custom procedure, pass the APP_ID and APP_PAGE_ID and popup in a new window.
I tried doing something like the Help link in APEX.
javascript:popupURL('comi_help_util.show_help?p_application_id=&APP_ID.&p_page_id=&APP_PAGE_ID.');
Unfortunately, I get "HTTP 404 - Web page cannot be found" error.
I know I could probably call a page within my APEX application from my custom Help link which would then call my custom procedure.
However, this means I would have to put a page within every application I want to use this on.
I believe the call to the procedure directly would be cleaner and easier to implement, if I can get this working on my first app.
I have never called a procedure thru a URL link or the javascript:popupURL and, try as I might, cannot search for the right keywords in the APEX forum or the Web.
Any help would be appreciated.
THANKS
Raymond
Hi Scott,
>> Time for new glasses ...
You are probably right, but regardless, I was referring to Raymond’s first post (and I should have made it clear). I noted that I believe your JavaScript statement is correct, I just can’t see the difference between it and the OP first statement, where, as far as I can see, he also used question mark (?) to mark parameters, and ampersand (&) to concatenate them. Still he received a 404 error. What am I missing there?
Thanks,
Arie.
Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
Similar Messages
-
Call Package Procedure from a Servlet?
Hi,
Is it possible to call a package procedure from a servlet?
ArtCould you be a bit more specific please? I'm not sure where or what to look for.
Art
Wrap it with WebServices interface. There is an example article somewhere on otn.oracle.com -
Calling a procedure from a dynamic link
I have the following situation-
I have a report created using SQL Query.
I need to call a Stored Procedure(move_to_portal) through a link from one of the fields in the report (Exec_id field of the report).
How can I do this?
The links do not allow me to choose a stored procedure as the Target component....so maybe I have to create a dynamic link.
How to do this? Any help would be appreciated.I have just another question-
I have a procedure testing_del_archive which is being called with 2 parameters...from a dynamic link in my SQL Query.
The following is my code....
SELECT re.report_exec_id, re.exec_userid,
NVL(re.batch_exec_date, re.begin_date) report_date,
re.rows_returned,
re.status, re.error,
f_file_url(re.filename) file_url,
re.comments,
''Archive''archive
FROM metadev.report_execution re, metadev.report r
WHERE re.report_id = r.report_id
AND r.spec_number = :v_spec
AND re.status <> 'DELETED'
AND re.exec_userid like (DECODE(:v_user_filter,'ALL','%',:v_user_filter))
ORDER BY begin_date DESC
The first parameter is the value in the execution id field and the second argument is hardcoded "Archived"...
IT GIVES AN ERROR....
Do you guys know where I am going wrong... -
Calling packaged procedure from a function
Hi all,
I am using Oracle database 10.2.0
I have a packaged procedure , there are two IN parameters(Varchar, Date) and an OUT parameter(REF CURSOR). The out parameter sends a result set from a query(multiple records of a table). I was asked to create a function which can use this procedure and returns the same resultset. Can u please suggest how to proceed?
Thanks & Regards,
Naveen.Is it something like this you're after:
SQL> create or replace function test_f (p_In1 in number, p_In2 in varchar2) return sys_refcursor as
2 r sys_refcursor;
3 begin
4 open r for 'select ' || to_char(p_In1) || ',''' || p_In2 || ''' from dual';
5 return r;
6 end test_f;
7 /
Function created.
SQL> declare
2 r sys_refcursor;
3
4 l_no number;
5 l_Greet varchar2(30);
6 begin
7 r := test_f(1, 'Hello');
8
9 fetch r into l_no, l_Greet;
10 if (r%found) then
11 dbms_output.put_line(l_No || ' ' || l_Greet);
12 end if;
13
14 close r;
15
16 exception
17 when others then
18 dbms_output.put_line('Err ' || sqlerrm);
19 if (r%isopen) then
20 close r;
21 end if;
22
23 end;
24 /
1 Hello
PL/SQL procedure successfully completed.P;
Edited by: bluefrog on Mar 4, 2010 3:16 PM -
Question about calling a procedure from a URL
Hi
In an Apex 3.0 application (which is not public) I use a procedure call in a URL to download the person's photo, if any. The call looks like this:
{img src=#OWNER#.download_photo?p_id=&P10_ID.}
This works fine. However, I found out that I can run that procedure just typing that URL in a web browser, without the need to be logged in to any application!
This seems to me like a flaw in my procedure and I think I am missing something. In a way it makes sense, as there is not any reference in the URL to the application.
How can I make this procedure to run only if I am logged in the application it is supposed to be run from?
Thanks
LuisLuis,
There is a section (Security Issues to Consider) in the file upload/download how-to that describes how to handle this. Also, Anton Nielsen describes a technique linked to from Re: About file .
Scott -
How to call a procedure from url
hello,
I'd like to call a procedure from the url. <br>
I've tryed several ways to call that procedure, but none of it worked. <br><br>
so can someone please tell me the correct syntax of such a call?<br>
thanks in advance.Hi ,
I have implemented this in one of my apps in the following way:
- Created a database procedure (called download_file that accepts a parameter). This procedure opens a document stored in the database.
- In a report region, in the Column Link attributes, I set the Link Text to "Download", set Target to "URL" and set URL to "#OWNER#.download_file?p_file=#MYFIELD#"
Hope this helps. -
Calling a stored procedure from a url
I am needing to call a stored procedure from a url string (or
anchor) understand that from training to be as follows:
http://host:port/pls/dad/package.procedure?query_string
With that in mind, I am getting an error as follows:
Not Found
The requested URL /pls/portal30/at_hrfm.checkshow.showcheck was
not found on this server.
Here is a sample of my url
http://servername:port/pls/portal30/at_hrfm.checkshow.showcheck
I can see servername:port/pls/portal30, it is just the
procedure I am having a problem with.
Here is a sample of my source code that is created under the
at_hrfm schema (I also tried under portal30 schema).
package body checkshow as
procedure showcheck as
begin
htp.htmlOpen;
htp.headOpen;
htp.title('My Check');
htp.comment ('This should be your Check');
htp.bodyOpen;
htp.header (1,'Check');
htp.print ('checkdate');
htp.bodyClose;
htp.headClose;
htp.htmlClose;
end;
end;I think I figured this out. I don't think the grant to ANONYMOUS is going to work with production XE and the online documentation is in need of an update. It appears that production XE has been locked down and you will need to specify the name of each stored procedure you wish to allow to be executed by adding it to the WWV_FLOW_EPG_INCLUDE_MOD_LOCAL function. This is spelled out in more technical detail here: http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/adm_wrkspc.htm#BEJCGJFJ
Another alternative that would work involves creating a separate DAD. Using the DAD approach with my schema made all of my stored procedures callable from a web browser, so I rejected this approach. To make this usable (secure) I would have needed to create and maintain a separate database user for the DAD and then only granted it execute for the stored procedures I wanted to be callable from a URL.
Finally I read about using an on-demand procedure and having it invoke the desired stored procedure. While I didn't try this out, it sounds like another good approach because it maintains session security. If it can be used to return an image I do not know.
- Jim -
Calling a Procedure from a Button? (REVISITED)
Hi All,
I once asked a question Re: Calling a Procedure from a Button? & that problem was resolved when i was working on the online ApEx.
On my application, requirements have changed a bit: I have one form based on two tables. One table contributes two fields (name & surname) to the form while the remaining fields are contributed by another table to make a total of 17 fields on the form.
My process is in such a way that a user enters an id number & clicks Search button, if the apllicant exists then both name & surname corresponding with the id number will be retrieved from the database. If the applicant does not exist then an error message will be displayed inline with the id number field. Here's the PL/SQL anonymous block to that:
DECLARE
vNAME APPLICANTS.name%TYPE;
vSURNAME APPLICANTS.surname%TYPE;
BEGIN
SELECT count(*)
INTO :P2_COUNT
FROM applicants
WHERE id_number = :P2_ID_NUMBER;
IF :P2_COUNT > 0 THEN
SELECT name,surname
INTO vNAME, vSURNAME
FROM applicants
WHERE id_number = :P2_ID_NUMBER;
:P2_NAME := vNAME;
:P2_SURNAME := vSURNAME;
ELSE
apex_application.g_print_success_message := '<span style="color:red">Applicant does not exist.</span>';
END IF;
EXCEPTION WHEN NO_DATA_FOUND THEN
apex_application.g_print_success_message := '<span style="color:red">Exception Caught.</span>';
END;The PL/SQL block works except for error displaying part (but that's a problem for another day).
NB: On my application, there’s already Automated Row Fetch & Automatic Row Processing (DML) processes for one table. Furthermore, there is also a javascript for verifying the validity of an id number. As a result, I decided to include Automated Row Fetch & Automatic Row Processing (DML) processes for the other table. When I click a Search button the javascript is activated even though I did not specify a URL target for the button - because this is a simple button among region items – it does not have Optional Url Redirect section.
I'm not sure what I'm doing wrong here - any help is appreciated.
Regards
KamoHi Dan,
Sorry for causing confusion with my post - it's just that I was asking the same question (with different constraints) as I had asked before so I didn't feel like going to details was necessary because in my post I included a link to the previous thread. Interestingly, I was working on apex.oracle.com when I posted the original thread - the only problem came to be when I started to move the solution to my application on my machine.
Anyway, thanks for the response!
Regards
Kamo -
Securely calling stored procedure with APEX URL
I have a web server that needs to call a stored procedure on an Oracle database (v10.2.0.4.0-64bit), and to do so without storing schema credentials on the web server it has been recommended to call the procedure using a URL to APEX, and granting execute privileges on the package storing the procedure to APEX_PUBLIC_USER. However, this allows anyone on the network to call the procedure if they have the URL. Is there any way to make sure that either Apex or the procedure only responds directly to requests from the web server?
Nick,
Assuming you are talking about application server ( not web server ).
It is common practice to create new user on Oracle database (often called proxy user, so you don't have to use schema credentials). Grant this user privileges to call package you need. Then on application server store encrypted credentials for this new user.
Application (java or .net) then connects to Oracle using new user credentials and executes packaged procedure.
Using Apex is the same. You need to have Authentication enabled (hence to store user id and password). If not, it is not secure.
Making any application (including Apex) to respond to request from specific IP is possible by inspecting ip from request header (Apex : UTL_HTTP.GET_HEADER ).
There are problems however:
1.If connection is made by proxy, request ip can change.
2.Hackers can use "ip spoofing" to emulate request from permitted server.
Another option would be to set up proxy server rules, permitting traffic between selected servers only.
HTH
Thomas -
Unable to call a procedure from inside a another procedure
Dear members
I am trying to call a procedure from inside an another procedure.Both the procedures are present within the same package.I am trying to call the second procedure just before the end of the first procedure.Both the procedures are compiling fine but the tables are not getting populated inside the second procedure.Also the DBMS_OUTPUT statements present in second procedures are not getting displayed.(I feel the second procedured is not getting called).
The package specification is as follows:
CREATE OR REPLACE package ANVESH.conv_api_pkg
is
PROCEDURE PROC_CONVERSION_API(FILE_PATH IN VARCHAR2,FILE_NAME IN VARCHAR2) ;
TYPE cts_order_details IS TABLE OF XXCTS_ORDER_DETAILS_STG%ROWTYPE;
PROCEDURE proc_conversion_api2(p_orderdetails IN cts_order_details) ;
end conv_api_pkg;The package body is as follows:
CREATE OR REPLACE package body ANVESH.conv_api_pkg
is
PROCEDURE PROC_CONVERSION_API(FILE_PATH IN VARCHAR2,FILE_NAME IN VARCHAR2)
IS
v_file_type utl_file.file_type;
v_buffer VARCHAR2(1000);
V_CUSTOMER_NAME VARCHAR2(100);
V_MANUFACTURER VARCHAR2(100);
V_PRODUCT_NAME VARCHAR2(100);
V_QUANTITY NUMBER;
V_REQ_SHIP_DATE DATE;
V_REQ_PRICE NUMBER;
V_LOG_FILE utl_file.file_type;
V_COUNT_CUST NUMBER;
V_COUNT_PROD NUMBER;
L_ORDER_LINES CONV_API_PKG.cts_order_details:=CONV_API_PKG.cts_order_details();
BEGIN
DBMS_OUTPUT.PUT_LINE('Inside begin 1');
v_file_type := UTL_FILE.fopen(FILE_PATH, FILE_NAME, 'r',null);
DBMS_OUTPUT.PUT_LINE('Inside begin 1.1');
LOOP
BEGIN
DBMS_OUTPUT.PUT_LINE('Inside begin 2');
UTL_FILE.GET_LINE (v_file_type,v_buffer);
DBMS_OUTPUT.PUT_LINE('Inside begin 2.1');
DBMS_OUTPUT.PUT_LINE('the buffer is '||v_buffer);
DBMS_OUTPUT.PUT_LINE('the length of buffer is '||length(v_buffer));
V_CUSTOMER_NAME := trim(substr(v_buffer, 1, 30));
DBMS_OUTPUT.PUT_LINE('Customer Name is '||V_CUSTOMER_NAME);
V_MANUFACTURER := trim(substr(v_buffer, 31, 40));
DBMS_OUTPUT.PUT_LINE('Manufacturer is '||V_MANUFACTURER);
V_PRODUCT_NAME := trim(substr(v_buffer, 71, 20));
DBMS_OUTPUT.PUT_LINE('Product Name is '||V_PRODUCT_NAME);
V_QUANTITY := to_number(trim(substr(v_buffer, 91, 5)));
DBMS_OUTPUT.PUT_LINE('Quantity is '||V_QUANTITY);
V_REQ_SHIP_DATE := to_date(trim(substr(v_buffer, 96, 20)), 'DD-MON-YYYY');
DBMS_OUTPUT.PUT_LINE('Requested Ship Date is '|| V_REQ_SHIP_DATE);
V_REQ_PRICE :=nvl(substr( trim(v_buffer), 116, length(v_buffer)-116),0);
--DBMS_OUTPUT.PUT_LINE('Requested Price is1 '||substr(v_buffer, 116, 5));
DBMS_OUTPUT.PUT_LINE('The requested price is '||V_REQ_PRICE);
V_LOG_FILE := UTL_FILE.FOPEN(FILE_PATH, 'LOG_FILE.dat', 'A');
IF (V_QUANTITY > 0)
THEN
DBMS_OUTPUT.PUT_LINE('The quantity is '||V_QUANTITY);
SELECT COUNT (*)
INTO V_COUNT_CUST
FROM CONVERSION_CUSTOMERS
WHERE CUSTOMER_NAME = V_CUSTOMER_NAME;
DBMS_OUTPUT.PUT_LINE('The Customer count is '||V_COUNT_CUST);
IF(V_COUNT_CUST > 0)
THEN
SELECT COUNT(*)
INTO V_COUNT_PROD
FROM conversion_products
WHERE PRODUCT_NAME = V_PRODUCT_NAME;
DBMS_OUTPUT.PUT_LINE('The Product count is '||V_COUNT_PROD);
IF(V_COUNT_PROD >0)
THEN
INSERT INTO XXCTS_ORDER_DETAILS_STG VALUES (V_CUSTOMER_NAME, V_PRODUCT_NAME, V_MANUFACTURER, V_QUANTITY, V_REQ_SHIP_DATE, V_REQ_PRICE, 'ACTIVE', 'ORDER TAKEN');
ELSE
DBMS_OUTPUT.PUT_LINE('PRODUCT SHOULD BE VALID');
UTL_FILE.PUT_LINE(V_LOG_FILE, 'PRODUCT SHOULD BE VALID');
END IF;
ELSE
DBMS_OUTPUT.PUT_LINE('CUSTOMER SHOULD BE VALID');
UTL_FILE.PUT_LINE(V_LOG_FILE, 'CUSTOMER SHOULD BE VALID');
END IF;
ELSE
DBMS_OUTPUT.PUT_LINE('QUANTITY SHOULD BE VALID');
UTL_FILE.PUT_LINE(V_LOG_FILE, 'QUANTITY SHOULD BE VALID');
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT;
END;
END LOOP;
SELECT CUSTOMER_NAME, PRODUCT_NAME, MANUFACTURER, QUANTITY, REQUESTED_SHIP_DATE, REQUESTED_PRICE, STATUS,MESSAGE
BULK COLLECT
INTO L_ORDER_LINES
FROM XXCTS_ORDER_DETAILS_STG;
DBMS_OUTPUT.PUT_LINE('values inserted');
proc_conversion_api2(p_orderdetails=>L_ORDER_LINES);
END;
PROCEDURE proc_conversion_api2(p_orderdetails IN cts_order_details)
IS
V_AVL_QUANTITY CONVERSION_PRODUCTS.AVL_QUANTITY%TYPE;
V_REQ_SHIP_DATE DATE;
V_LIST_PRICE CONVERSION_PRODUCTS.LIST_PRICE%TYPE;
V_NET_PRICE CONVERSION_PRODUCTS.LIST_PRICE%TYPE;
V_NET CONVERSION_PRODUCTS.LIST_PRICE%TYPE;
V_EXTN_PRICE CONVERSION_PRODUCTS.LIST_PRICE%TYPE;
V_CUST_DISC CONVERSION_CUSTOMERS.DISCOUNT%TYPE;
V_CERT_DISC CONVERSION_CERTIFICATION.DISCOUNT%TYPE;
V_CUST_ID XXCTS_ORDER_DETAILS.CUSTOMER_ID%TYPE;
V_PROD_ID XXCTS_ORDER_DETAILS.PRODUCT_ID%TYPE;
V_DISC_PRICE CONVERSION_PRODUCTS.LIST_PRICE%TYPE;
V_DISC_NAME CONVERSION_CERTIFICATION.CERTIFICATION%TYPE;
V_TOTAL_DISC_AMT NUMBER;
V_TOTAL_DISC NUMBER;
V_LIMIT NUMBER;
BEGIN
DBMS_OUTPUT.PUT_LINE('INSIDE API_2 BEGIN 1');
FOR i IN p_orderdetails.FIRST..p_orderdetails.LAST
LOOP
BEGIN
DBMS_OUTPUT.PUT_LINE('INSIDE API_2 BEGIN 2');
SELECT PRODUCT_ID,AVL_QUANTITY,LIST_PRICE
INTO V_PROD_ID,V_AVL_QUANTITY,V_LIST_PRICE
FROM CONVERSION_PRODUCTS
WHERE PRODUCT_NAME=p_orderdetails(i).PRODUCT_NAME;
DBMS_OUTPUT.PUT_LINE('PRODUCT QUANTITY is '||V_PROD_ID);
DBMS_OUTPUT.PUT_LINE('AVAILABLE QUANTITY is '||V_AVL_QUANTITY);
DBMS_OUTPUT.PUT_LINE('LIST PRICE is '||V_LIST_PRICE);
SELECT CUSTOMER_ID,NVL(DISCOUNT,0)
INTO V_CUST_ID,V_CUST_DISC
FROM CONVERSION_CUSTOMERS
WHERE CUSTOMER_NAME=p_orderdetails(i).CUSTOMER_NAME;
DBMS_OUTPUT.PUT_LINE('CUSTOMER ID is '||V_CUST_ID);
DBMS_OUTPUT.PUT_LINE('CUSTOMER DISCOUNT IS '||V_CUST_DISC);
SELECT A.DISCOUNT,A.CERTIFICATION
INTO V_CERT_DISC,V_DISC_NAME
FROM CONVERSION_CERTIFICATION A,CONVERSION_CUSTOMERS B
WHERE A.CERTIFICATION=B.CERTIFICATION(+)
AND B.CUSTOMER_NAME=p_orderdetails(i).CUSTOMER_NAME;
DBMS_OUTPUT.PUT_LINE('CERTIFICATION DISCOUNT IS '||V_CERT_DISC);
V_NET:=((V_LIST_PRICE)-(V_LIST_PRICE)*(V_CERT_DISC)/100);
DBMS_OUTPUT.PUT_LINE('NET PRICE AFTER CERTIFICATION DISCOUNT IS '||V_NET);
V_NET_PRICE:=((V_NET)-(V_NET)*(V_CUST_DISC)/100);
DBMS_OUTPUT.PUT_LINE('NET PRICE AFTER COMPLETE DISCOUNT IS '||V_NET_PRICE);
V_EXTN_PRICE:=(V_NET_PRICE)*(p_orderdetails(i).QUANTITY);
DBMS_OUTPUT.PUT_LINE('EXTENDED PRICE IS '||V_EXTN_PRICE);
V_TOTAL_DISC:=((V_CERT_DISC)/100+(V_CUST_DISC)/100);
DBMS_OUTPUT.PUT_LINE('TOTAL DISCOUNT IS '|| V_TOTAL_DISC);
V_TOTAL_DISC_AMT:=(V_LIST_PRICE)-(V_NET_PRICE);
DBMS_OUTPUT.PUT_LINE('TOTAL DISCOUNT PRICE IS '|| V_TOTAL_DISC_AMT);
SELECT MAX(A.LIMIT)
INTO V_LIMIT
FROM CONVERSION_CERTIFICATION A,CONVERSION_CUSTOMERS B
WHERE A.CERTIFICATION=B.CERTIFICATION(+)
AND B.CUSTOMER_NAME=p_orderdetails(i).CUSTOMER_NAME;
IF p_orderdetails(i).QUANTITY<V_AVL_QUANTITY THEN
INSERT INTO XXCTS_ORDER_DETAILS VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,V_CUST_ID,V_PROD_ID,p_orderdetails(i).QUANTITY,p_orderdetails(i).REQUESTED_SHIP_DATE,p_orderdetails(i).REQUESTED_PRICE,V_LIST_PRICE,V_TOTAL_DISC,V_NET_PRICE,V_EXTN_PRICE,'QTY HOLD','REQ QNTY LESS THAN AVL QTY',SYSDATE);
INSERT INTO xxcts_order_discounts VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,SEQ_DISCOUNT_ID.NEXTVAL,V_DISC_NAME,V_TOTAL_DISC_AMT);
END IF;
IF p_orderdetails(i).REQUESTED_SHIP_DATE<SYSDATE THEN
INSERT INTO XXCTS_ORDER_DETAILS VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,V_CUST_ID,V_PROD_ID,p_orderdetails(i).QUANTITY,p_orderdetails(i).REQUESTED_SHIP_DATE,p_orderdetails(i).REQUESTED_PRICE,V_LIST_PRICE,V_TOTAL_DISC,V_NET_PRICE,V_EXTN_PRICE,'DATE HOLD','SHIPDATE CANNOT BE LESS THAN CURR DATE',SYSDATE);
INSERT INTO xxcts_order_discounts VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,SEQ_DISCOUNT_ID.NEXTVAL,V_DISC_NAME,V_TOTAL_DISC_AMT);
END IF;
IF V_NET_PRICE>p_orderdetails(i).REQUESTED_PRICE THEN
INSERT INTO XXCTS_ORDER_DETAILS VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,V_CUST_ID,V_PROD_ID,p_orderdetails(i).QUANTITY,p_orderdetails(i).REQUESTED_SHIP_DATE,p_orderdetails(i).REQUESTED_PRICE,V_LIST_PRICE,V_TOTAL_DISC,V_NET_PRICE,V_EXTN_PRICE,'PRICE HOLD','NET PRICE CANNOT BE MORE THAN REQ PRICE',SYSDATE);
INSERT INTO xxcts_order_discounts VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,SEQ_DISCOUNT_ID.NEXTVAL,V_DISC_NAME,V_TOTAL_DISC_AMT);
END IF;
/* IF V_LIMIT<p_orderdetails(i).REQUESTED_PRICE THEN
INSERT INTO XXCTS_ORDER_DETAILS VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,V_CUST_ID,V_PROD_ID,p_orderdetails(i).QUANTITY,p_orderdetails(i).REQUESTED_SHIP_DATE,p_orderdetails(i).REQUESTED_PRICE,V_LIST_PRICE,V_TOTAL_DISC,V_NET_PRICE,V_EXTN_PRICE,'ORDER LIMIT HOLD','PRICE CANNOT EXCEED ORDER LIMIT',SYSDATE);
INSERT INTO xxcts_order_discounts VALUES(SEQ_HEADER_ID.NEXTVAL,SEQ_LINE_ID.NEXTVAL,SEQ_DISCOUNT_ID.NEXTVAL,V_DISC_NAME,V_TOTAL_DISC_AMT);
END IF;*/
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE(' INSIDE EXCEPTION BLOCK');
END;
END LOOP;
END;
end conv_api_pkg;
/the pl/sql block to invoke the the procedure :
declare
begin
PROC_CONVERSION_API('/usr/tmp' ,'Walmart_Orders_062908.dat');
end;please let me know what is wrong in the program.
Thanks
AnveshHi Walter
Yes 'Inside begin 1' and 'Inside begin 2' were printed.Please find the the DBMS_OUTPUT statements that were printed.
Inside begin 1
Inside begin 1.1
Inside begin 2
Inside begin 2.1
the buffer is BESTBUY SONY ERICSSON W580i 25 1-AUG-2008 50
the length of buffer is 118
Customer Name is BESTBUY
Manufacturer is SONY ERICSSON
Product Name is W580i
Quantity is 25
Requested Ship Date is 01-AUG-08
The requested price is 50
The quantity is 25
The Customer count is 1
The Product count is 0
PRODUCT SHOULD BE VALID
Inside begin 2
Inside begin 2.1
the buffer is BESTBUY SAMSUNG BLACKJACK 50 15-JUL-2008 150
the length of buffer is 119
Customer Name is BESTBUY
Manufacturer is SAMSUNG
Product Name is BLACKJACK
Quantity is 50
Requested Ship Date is 15-JUL-08
The requested price is 150
The quantity is 50
The Customer count is 1
The Product count is 1
Inside begin 2
Inside begin 2.1
the buffer is BESTBUY APPLE IPHONE 4GB 50 15-JUL-2008
the length of buffer is 116
Customer Name is BESTBUY
Manufacturer is APPLE
Product Name is IPHONE 4GB
Quantity is 50
Requested Ship Date is 15-JUL-08
The requested price is 0
The quantity is 50
The Customer count is 1
The Product count is 1
Inside begin 2
Inside begin 2.1
the buffer is BESTBUY ATT TILT 100 15-JUN-2008
the length of buffer is 116
Customer Name is BESTBUY
Manufacturer is ATT
Product Name is TILT
Quantity is 100
Requested Ship Date is 15-JUN-08
The requested price is 0
The quantity is 100
The Customer count is 1
The Product count is 1
Inside begin 2
Inside begin 2.1
the buffer is BESTBUY NOKIA N73 50 15-JUL-2008 200
the length of buffer is 118
Customer Name is BESTBUY
Manufacturer is NOKIA
Product Name is N73
Quantity is 50
Requested Ship Date is 15-JUL-08
The requested price is 20
The quantity is 50
The Customer count is 1
The Product count is 0
PRODUCT SHOULD BE VALID
Inside begin 2In the first procedure I am trying to read the data from a flat file and store it in a table.Here is the sample data from the flat file.
BESTBUY SONY ERICSSON W580i 25 1-AUG-2008 50
BESTBUY SAMSUNG BLACKJACK 50 15-JUL-2008 150
BESTBUY APPLE IPHONE 4GB 50 15-JUL-2008
BESTBUY ATT TILT 100 15-JUN-2008
BESTBUY NOKIA N73 50 15-JUL-2008 200When tried to execute the second procedure independently using the PL/SQL block,the tables in second procedure were populated and the DBMS_Output statements were also displayed.I have made use of the same query in that case
Thanks
Anvesh
Edited by: Anvesh Reddy on Dec 23, 2008 12:40 PM -
Calling a procedure from a portel report
I have a report which is returning rows from a dblink, this works fine. I want to select an individual row from the report and write a new record to a diffent table using some of the columns from the row selected. The table I am writting to will be held within the portal db.
Idea...
Is it possible to call a procedure using the link application wizard (html link), if I could call a procedure via the html link and pass parameters from the record selected then I could write some pl/sql to insert a row in my other table, is this possible ?,if so how do I do it ?
Any other ideas would be most welcome.
Thanks in anticiptaion.The javascript function - you copied it completely, including all my beautiful images - calls an Application Process : toggleAvail.
And I guess you didn't define that one.
You created a stored procedure instead (with another name?), but with an AJAX call you can (only) call Application Processes....(which can call stored procedures...).
(Je mag me ook direct mailen/bellen als dat sneller is...).
Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-) -
Calling a procedure from Javascript
Hello
I have created a procedure with two input paprameters.
I have gratted access to public ... and all works well
I would now like to call this from a Javascript where I supply the input paameters. The procedure has a redirect to another URL so there is no output
Currently I used "window.location" with the prodcedure URL ... I must beable to call the produced directly?
Thanks for taking the time to look at this request
Regards
PetePete,
Have a look at this thread:
How to call stored procedure from javascript? (about Google Suggest, AJAX)
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigen
http://sourceforge.net/projects/plrecur
You can reward this reply by marking it as either Helpful or Correct ;-) -
Calling a procedure from Calculation View with Debug function
Is it possible to call a debuggable hana procedure in a calculation view?
I just saw the video HANA Academy - HANA Native Development Workshop: SQL Script Editor - YouTube for HANA Native Development workshop and got the debug functionality to work for a file Procedure.
But I am unable to call this procedure from a Calculation View.
Below is the code I am using for the SQLScript Calculation View. Can someone tell me if this is correct?
/********* Begin Procedure Script ************/
BEGIN
call "_SYS_BIC"."test-package.RF.SalesOrders.procedures/get_sls_ordtype"(SalesDocNo => '0070004105', SalesDocTypes => ?) ;
var_out = CE_PROJECTION(:SalesDocTypes, ["SALESDOCNO" , "SALESDOCTYPE", "ORDVALUE"] );
END /********* End Procedure Script ************/Hello,
Just provide the out parameter in the call:
Declare
amount number; -- OUT number argument populated by the procedure
Begin
-- call the X procedure --
x( amount ) ;
End;Francois -
Calling stored procedure from EJB in JSever
I have some trouble to call stored procedure from EJB deployed to JServer on Oracle8i (815).
I have been able to sucessfully test the stored procedure using thin client JDBC driver. But when I user the default connection in JServer, the stored procedure never got called. Is there any restriction of EJB in JServer?
Thanks
nullThanks man! that was a great help. looks like i am almost there. i created those items t obe hidden.
now i am passing three parameters to the procedure. my url for that column value looks like this,
javascript:P65_PARTITION_ID=#PARTITION_ID#;P65_DBC=#DBC#;P65_FILE_ID=#FILE_ID#;doSubmit('Sku_Save');
the #DBC# parameter is a name of the person that has spaces(firstname lastname). i am getting a javascript error saying,
Line: 1
Char: 37
Error:Expected ';'
i see that char 37 is the space after firstname.
any idea how i should get rid of this error.
Also, as you have been very helpful, a question further beyond :). the above procedure will return a OUT varchar parameter. i guess i have to create another item for that. how do i read it and display just below my report as text.
Thanks Again! -
Call package1.procedure from package2
I create package1 it contains two procedures. procedure1 OUT perameter, passed as a IN perameter, and called from SQL prompt.
i want to same output, call same procedure from another new package2.
please give guide lines to how to call.I create package1 it contains two procedures.
procedure1 OUT perameter, passed as a IN perameter,
and called from SQL prompt.
i want to same output, call same procedure from
another new package2.
declare
a_out varchar2;
package1.procedure_name(a,"in_value");
then use this a value in the package 2
Maybe you are looking for
-
I realize this is off-topic for this particular forum, but I hope it may help some readers. Since this forum is "where I live" in the Adobe forums, I wanted top share it here first. Perhaps after some feedback to refine things, I may post it elsewher
-
How to determine Pocess-Id in BPM
Hi all. I need help from you. I want to send an message from a BP with the Proccess-id (Work item) to a receiver. It's possible to determine the Process-Id (maybe by UDF)? I don't looking for Message-Id! Thanks. Mathias
-
Navigations Between View in Webdynpro ABAP
Is there any other ways to navigate between Views Other than Using the Out bond and In bond Plugs...? And one more While reusing the Views from one WDP1 in WDP2... For example : Take WDP1 it has got 10 Views I want to reuse the 8th view in WDP2 ho
-
A Problem about BAPI (BAPI_SALESORDER_CREATEFROMDAT2)
Hi, all. Now i try to use BAPI to create order,following is part of my codes: function=this.createFunction("BAPI_SALESORDER_CREATEFROMDAT2 "); JCO.ParameterList input = function.getImportParameterList(); JCO.Para
-
Transfering Music From a 1st Generation iPod to a New iPod
I just purchased a new iPod and I have a first generation iPod. Is there a way I can transfer the music from my first generation iPod without having to copy every CD onto the new one? Thanks.