Call FND_REQUEST_SET.FNDRSSUB using a pl/sql procedure
Hi,
I am new to Oracle Apps.
I want to submit a report set.The procedure to do it is FND_REQUEST_SET.FNDRSSUB.Can you pl tell me how can i call this package using pl/sql?
Regards
Hi,
If you want to submit a request set programatically, try using fnd_submit.set_request_set. You should also use fnd_submit.submit_program to define the parameters for each of the programs in the request set. You can find information about package FND_SUBMIT in the Oracle Applications Developer's Guide.
Hope it helps.
Similar Messages
-
Setting and retrieving a browser cookie using a pl/sql procedure
I want to set a cookie on the client browser and then later retrieve its value. I want to do both the operations using a pl/sql procedure. All this is going top be done from within the Portal 9.0.2 context. could you please give me any pointers
Take a look at 'owa_cookie' Package
Cheers -
How to call shell script from a pl/sql procedure
Hi all,
I am little bit new to plsql programming, i have a small problem as follows
I have to call a shell script from a pl/sql procedure ..
Please suggest me some methods in oracle 10g, which i could make use of to achieve my goal. also please tell me what are the constraints for those methods if any.
I already came across dbms_scheduler, but i have got a problem and its nor executing properly its exiting giving 255 error or saying that permission problem, but i have already given full access to my shell scripts.
Thanks in advance
Best Regards
SatyaHi,
Read this thread, perhaps is there your response :
Host...
Nicolas. -
Deploy warnings using a PL/SQL procedure (from a Public Transform Package)
OWB Version: 10.2
I am receiving the following warnings when I attempt to deploy a map that contains a reference to a custom pl/sql procedure that is setup in a public transformation package:
Warning
ORA-06550: line 115, column 32:
PLS-00112: end-of-line in quoted identifier
ORA-06550: line 115, column 9:
PLS-00103: Encountered the symbol "." when expecting one of the following:
:= . ( @ % ; not null range default character
I reviewed the OWB generated code and I discovered the OWB is a adding two double quotes in front of any reference to the package name. For example.....
BEGIN
COMMIT;
sql_stmt := 'ALTER SESSION DISABLE PARALLEL DML';
EXECUTE IMMEDIATE sql_stmt;
IF NOT ""ZZTEST"."INIT_SF_USER_CLAS_St" THEN
* note the "" in front of ZZTEST, which is the package name.
Has anyone else encountered this issue? I can manually correct the generated the code, but it would be overridden every the time the map is deployed. I encounter the same issue if I import a custom pl/sql procedure from the database into OWB using the Metadata Import Wizard and use the imported procedure in a map. However, I can setup an standalone procedure or function as a public transformation and the map deploys successfully. Please advise.
Regards,
MattYou have to create a job to start your procedure.
Example :
* http://psoug.org/reference/OLD/dbms_job.html
Then create a procedure to start your job, call it from your dashboard and you're done.
Success
Nico -
Calling a Web Service from PL/SQL Procedure
How can you call a web service from a pl/sql package , also is it valid to call a web service from pl/sql according to Fusion Standards..
Hi,
On way we can call a web service is to pass the Web Service URL to UTL_HTTP package:
Sample Web Service URL
===================
lv_url :=
'http://67.97.189.151:8888/plsqlsample/dbfunc?invoke=placeOrder'
|| '&'
|| 'param0=1'
|| '&'
|| 'param1=1'
|| '&'
|| 'param2=1';
Sample Call using UTL_HTTP
=====================
SELECT UTL_HTTP.request (lv_url)
INTO lv_result
FROM DUAL;
Thank you.
Regards,
Balu -
Getting SOAException while calling SOA web service via pl/sql procedure
Hi All,
I created a 'Helloworld' BPEL process and successfuly deployed it. I tested it in the WLS and it is working. Now I wrote a pl/sql procedure which calls this 'HelloWorld' bpel process. When ran this procedure it throw me an error
GetPayload: resp3 IS NULL
<HTML><HEAD><TITLE>Web Service</TITLE></HEAD><BODY><H1>Bad Request</H1><PRE>javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected character '<' (code 60) excepted space, or &
#62;' or "/>"
at [row,col {unknown-source}]: [1,120]</PRE></BODY></HTML>
null response
GetPayload: resp3 IS NULL
<HTML><HEAD><TITLE>Web Service</TITLE></HEAD><BODY><H1>Bad Request</H1><PRE>javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected character '<' (code 60) excepted space, or &
#62;' or "/>"
at [row,col {unknown-source}]: [1,120]</PRE></BODY></HTML>
null response
Please suggest.
WSDL - http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep?WSDL
procedure code is as below:
Create or Replace FUNCTION GetPayload(
p_Payload IN VARCHAR2)
RETURN VARCHAR2 IS
soap_request VARCHAR2(30000);
soap_respond VARCHAR2(30000);
http_req UTL_HTTP.REQ;
http_resp UTL_HTTP.RESP;
resp XMLTYPE;
response VARCHAR2(30000) := '';
l_detail VARCHAR2(30000);
i INTEGER;
l_xsl_nonamespace VARCHAR2(640) := '<?xml version="1.0" encoding="UTF-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="comment()|processing-instruction()|/"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="*"> <xsl:element name="{local-name()}"> <xsl:apply-templates select="@*|node()"/> </xsl:element> </xsl:template> <xsl:template match="@*"> <xsl:choose> <xsl:when test="name() != ''xmlns''"> <xsl:attribute name="{local-name()}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:when> </xsl:choose> </xsl:template></xsl:stylesheet>';
namespace VARCHAR2(128) := 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP';
endpoint VARCHAR2(128) := 'http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep';
BEGIN
soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'||'<SOAP-ENV:Envelope '||'xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"'||'<SOAP-ENV:Body>'||'<'||namespace||'>'||'<ProcessRequest>'||'<input'||namespace||'>'||p_Payload||'</input>'||'</ProcessRequest>'||'</SOAP-ENV:Body>'||'</SOAP-ENV:Envelope>';
http_req := utl_http.begin_request( endpoint, 'POST', 'HTTP/1.1');
utl_http.set_header(http_req , 'Content-Type' , 'text/xml');
-- dealing with plain text in XML documents
utl_http.set_header(http_req , 'Content-Length' , lengthb(soap_request));
utl_http.set_header(http_req , 'SOAPAction' , 'process'); -- required to specify a SOAP communication
utl_http.write_text(http_req, soap_request);
http_resp := utl_http.get_response(http_req);
utl_http.read_text(http_resp, soap_respond);
utl_http.end_response(http_resp);
resp:= XMLType.createXML(soap_respond);
IF (instr(resp.getStringVal(), 'ERROR:') > 0)THEN
raise_application_error ( -20999, 'GetHelloWorldPayload: Failed! '||p_Payload);
END IF;
resp := resp.extract('/soap:Envelope/soap:Body/child::node()' , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' );
-- Remove namespaces
SELECT XMLTransform(resp, xmlType(l_xsl_nonamespace)) INTO resp FROM dual;
-- resp := resp.extract('/ProcessResponse/child::node()', 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP');
IF (resp IS NULL)THEN
dbms_output.put_line('GetPayload: resp3 IS NULL');
ELSE
dbms_output.put_line('GetPayload: resp3 ' ||resp.getStringVal());
END IF;
i:=0;
LOOP
dbms_output.put_line(SUBSTR(soap_respond,1+ i*255,250));
i := i+1;
IF i*250> LENGTH(soap_respond) THEN
EXIT;
END IF;
END LOOP;
IF (resp IS NULL)THEN
response := 'null response';
ELSE
response := REPLACE( REPLACE( REPLACE( resp.getStringVal(), '<', '<') , '>', '>') , '"', '"');
END IF;
RETURN response;
END GetPayload;
/vladodias thanks for the reply. I went through the link before also but i am not comfortable with the utl_dbws that's why i am following utl_http.
I also changed my procedure now i am not getting any error but it is not printing the output as well. New procedure is as below.
I tried 'set serveroutput on size 1000000;' also but still not working.
Create or Replace FUNCTION GetPayload(
p_Payload IN VARCHAR2)
RETURN VARCHAR2 IS
soap_request VARCHAR2(30000);
soap_respond VARCHAR2(30000);
http_req UTL_HTTP.REQ;
http_resp UTL_HTTP.RESP;
resp XMLTYPE;
response VARCHAR2(30000) := '';
l_detail VARCHAR2(30000);
i INTEGER;
l_xsl_nonamespace VARCHAR2(3000) := '<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="comment()|processing-instruction()|/">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="@*">
<xsl:choose>
<xsl:when test="name() != ''xmlns''">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>';
namespace VARCHAR2(128) := 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP';
endpoint VARCHAR2(128) := 'http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep';
BEGIN
soap_request:= '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bpel="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP">
<soapenv:Header/>
<soapenv:Body>
<bpel:process>
<bpel:input>test</bpel:input>
</bpel:process>
</soapenv:Body>
</soapenv:Envelope>';
http_req := utl_http.begin_request( endpoint, 'POST', 'HTTP/1.1');
utl_http.set_header(http_req , 'Content-Type' , 'text/xml');
-- dealing with plain text in XML documents
utl_http.set_header(http_req , 'Content-Length' , lengthb(soap_request));
utl_http.set_header(http_req , 'SOAPAction' , 'process'); -- required to specify a SOAP communication
utl_http.write_text(http_req, soap_request);
http_resp := utl_http.get_response(http_req);
utl_http.read_text(http_resp, soap_respond);
utl_http.end_response(http_resp);
resp:= XMLType.createXML(soap_respond);
IF (instr(resp.getStringVal(), 'ERROR:') > 0)THEN
raise_application_error ( -20999, 'GetHelloWorldPayload: Failed! '||p_Payload);
END IF;
resp := resp.extract('/soap:Envelope/soap:Body/child::node()' , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' );
-- Remove namespaces
SELECT XMLTransform(resp, xmlType(l_xsl_nonamespace)) INTO resp FROM dual;
-- resp := resp.extract('/ProcessResponse/child::node()', 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP');
IF (resp IS NULL)THEN
dbms_output.put_line('GetPayload: resp3 IS NULL');
ELSE
dbms_output.put_line('GetPayload: resp3 ' ||resp.getStringVal());
END IF;
i:=0;
LOOP
dbms_output.put_line(SUBSTR(soap_respond,1+ i*255,250));
i := i+1;
IF i*250> LENGTH(soap_respond) THEN
EXIT;
END IF;
END LOOP;
IF (resp IS NULL)THEN
response := 'null response';
ELSE
response := REPLACE( REPLACE( REPLACE( resp.getStringVal(), '<', '<') , '>', '>') , '"', '"');
END IF;
RETURN response;
END GetPayload;
/ -
How to re-use a PL/SQL procedure on 2 different logical schemas
Hi all,
I need to run the same Oracle PL/SQL procedure on 2 databases (source/target).
How can I re-use the code without having to duplicate the codeof the procedure because as it is a Oracle procedure, I need to declare the logical schema ?
==> does the procedure need to be re-written in Jython ?
Thanks to your all .
Nb my procedure code :
CREATE TABLE COUNT_ROWS AS SELECT TABLE_NAME , NUM_ROWS FROM DBA_TABLES WHERE OWNER_NAME = 'SYSADM'
Edited by: Meapri on Mar 18, 2011 3:37 AMThe only problem is when writing an ODI procedure using the Oracle Technology in ODI Designer, ODI asks for the Schema.
If I do not assign a value to the schema field when I run my ODI procedure I get the error message :
java.lang.Exception: Internal error: object ConnectConnection
ColConnectId:null
ColContextCode:CTX_SRC
ColConName:null
ColIndCommit:null
ColIsolLevel:null
ColLschemaName:null
ColPlanComp:null
ColTechIntName:null
DefConnectId:null
DefContextCode:CTX_SRC
DefConName:null
DefIndCommit:null
DefIsolLevel:null
DefLschemaName:null
DefPlanComp:null
DefTechIntName:ORACLE
ExeChannel:J
IndErr:0
IndLogMethod:null
IndLogNb:null
LogLevDet:3
Nno:1
OrdTrt:0
ScenTaskNo:1
SessNo:4152001
TaskName1:Traitement
TaskName2:CNT_SRC_ALL
TaskName3:DROP COUNT_ROWS -
How to read a spread sheet ( .xls ) file using a pl/sql procedure or func
Hello All,
Is it possible to read a spread sheet using Oracle pl.sql .
I know their is a util package that is read a file but how to read a spread sheet ... ?
thanks
kumarhi kumar,
Here is an example of how i read an excel file
DECLARE
l_start_file_name varchar2(50) := 'invoice_excel_c';
l_end_file_name varchar2(50) := '.csv';
l_file_name varchar2(100);
l_sql varchar(32767);
refresh_cdc varchar2(5) := '00304';
begin
l_file_name := l_start_file_name||REFRESH_CDC||l_end_file_name;
l_sql :=
'create table exter_invoice_excel '||
'( '||
'Product_name varchar2(255), '||
'Net_Sales Number, '||
'Net_Adjustments Number, '||
'Cancels_Count Number, '||
'Cancels_Amount Number, '||
'Cashes_Count Number, '||
'Cashes_Amount Number, '||
'Claims_Count Number, '||
'Claims_Amount Number, '||
'Returns_Count Number, '||
'Returns_Amount Number, '||
'Free_Prize_Count Number, '||
'Free_Prize_Amount Number, '||
'Free_Promo_Count Number, '||
'Free_Promo_Amount Number, '||
'Promo_Credit_Count Number, '||
'Promo_Credit_Amount Number, '||
'Return_Commission Number, '||
'Net_Discounts Number, '||
'Total_Fees Number, '||
'Sales_Commission Number, '||
'Cash_Commission Number, '||
'Tkt_Charge Number, '||
'Subscription_Commission Number, '||
'Interim_Sweeps Number, '||
'Net_Due Number, '||
'Retailer_id Number, '||
'Retailer_Name varchar2(255) '||
') '||
'ORGANIZATION EXTERNAL ( '||
' TYPE oracle_loader '||
' DEFAULT DIRECTORY GTECHFILES '||
' ACCESS PARAMETERS ( '||
' RECORDS DELIMITED BY NEWLINE '||
' CHARACTERSET WE8MSWIN1252 '||
' BADFILE ''invoice_excel.bad'' '||
' DISCARDFILE ''invoice_excel.dis'' '||
' LOGFILE ''invoice_excel.log'' '||
' FIELDS TERMINATED BY '','' RTRIM '||
' MISSING FIELD VALUES ARE NULL '||
' ) '||
' LOCATION ('''||l_file_name||''') '||
' ) '||
'PARALLEL '||
'REJECT LIMIT UNLIMITED ';
execute immediate l_sql;
l_sql:= 'INSERT INTO INVOICE_EXCEL_TEMP '||
' ( Product_name , '||
' Net_Sales , '||
' Net_Adjustments , '||
' Cancels_Count , '||
' Cancels_Amount , '||
' Cashes_Count , '||
' Cashes_Amount , '||
' Claims_Count , '||
' Claims_Amount , '||
' Returns_Count , '||
' Returns_Amount , '||
' Free_Prize_Count , '||
' Free_Prize_Amount , '||
' Free_Promo_Count , '||
' Free_Promo_Amount , '||
' Promo_Credit_Count , '||
' Promo_Credit_Amount , '||
' Return_Commission , '||
' Net_Discounts , '||
' Total_Fees , '||
' Sales_Commission , '||
' Cash_Commission , '||
' Tkt_Charge , '||
' Subscription_Commission , '||
' Interim_Sweeps , '||
' Net_Due , '||
' Retailer_id , '||
' Retailer_Name , '||
' SOURCE , '||
' INSERTED_DATE , '||
' CDC , '||
' UPLOADED '||
') '||
' select '||
' ltrim(rtrim(product_name)) , '||
' Net_Sales , '||
' Net_Adjustments , '||
' Cancels_Count , '||
' Cancels_Amount , '||
' Cashes_Count , '||
' Cashes_Amount , '||
' Claims_Count , '||
' Claims_Amount , '||
' Returns_Count , '||
' Returns_Amount , '||
' Free_Prize_Count , '||
' Free_Prize_Amount , '||
' Free_Promo_Count , '||
' Free_Promo_Amount , '||
' Promo_Credit_Count , '||
' Promo_Credit_Amount , '||
' Return_Commission , '||
' Net_Discounts , '||
' Total_Fees , '||
' Sales_Commission , '||
' Cash_Commission , '||
' Tkt_Charge , '||
' Subscription_Commission , '||
' Interim_Sweeps , '||
' Net_Due , '||
' Retailer_id , '||
' Retailer_Name , '||
' '''||l_file_name ||''', '||
' sysdate , '||
' '''|| REFRESH_CDC ||''', '||
'''N''' ||
'FROM '||
'exter_invoice_excel '||
'WHERE retailer_id is not null and ltrim(rtrim(product_name)) in (''Loto'',''Inst Tk'')';
execute immediate l_sql;
l_sql :='drop table exter_invoice_excel';
execute immediate l_sql;
exception
when others then
rollback;
l_sql :='drop table exter_invoice_excel';
execute immediate l_sql;
debug_message('INVOICE_EXCEL_UPLOAD/'||REFRESH_CDC,'Unexpected Error '||sqlerrm);
END;
--truncate table invoice_excel_tempjust go through the code, it would help u for sure
cheers -
How to use pl/sql procedure or function as part of validate the entity obj?
Hi,
we are migrating from oracle forms to jdeveloper 11g.
I have a req. that,i wanted to use oracle pl/sql procedure to validate a attribute in an entity created with ADF BC?
Is it possible to implement this?
And how to show the error message from pl/sql procedure?
Regards
Murali.Hi,
It is possible by using a method validator for the entity attribute.
Create a transient attribute 'X'.
In the validation section of the attribute to be validate, choose method validator.
In the Error Message tab set error message as {0}.
Below the value for tokentoken should source.X (X is the transient attribute name)
In the java code of method validator, call the stored procedure and set the value of transient attribute X with the error message from SP.
Use setX("ErrorMessage").
Regards,
Srinidhi -
Retrieve online file as CSV via HTTPS using PL/SQL procedure
Hi all,
Situation:
Server A (not ORACLE)_: accesed via URL, generates dynamically a CSV file and returns to the requestor.
Server B (ORACLE)_: which runs the PL/SQL script. It is the requestor. Read the CSV and store it within ORACLE.
(1) I want to connect from Server B (ORACLE) to an external URL via HTTPS which generates dynamically the CSV file. Subdomain.domain it is the Server A which contains this CSV file.
https://dubdomain.domain/csv_generator.php?query=q1
(2) This file is downloaded to the Server B (ORACLE). A PL/SQL script executed in this machine do the task.
(3) After that, I load this CSV to an ORACLE table which a common CSV PL/SQL parser.
Doubts:
Is it possible to retrieve an online file (a CSV) dynamically created and hosted in a third party server (Not ORACLE) via HTTPS using a PL/SQL procedure executed in a ORACLE server? If the answer is yes, what technology could I use? Any ideas?
Thanks in advance,
YagoAn CSV example in {message:id=10158148}.
For https, two actions are needed in addition.
Firstly, the certificate of the https web server needs to be loaded in an Oracle Wallet on your database server. The wallet will have a specific directory location on the server, and will be protected by a password.
Secondly, the PL/SQL procedure making web call, needs to open the wallet (using <i>UTL_HTTP.set_wallet</i>) using the location and password. Example of that in {message:id=10820182}. -
DBI Reports Using PL/SQL Procedure
Hi all,
Is there anyone who worked on Creating a DBI report using a PL/SQL Procedure.
I want to customize a Report that is using Data Source as of type PL/SQL Procedure.
Please Reply to me If anyone has any Idea on this..
Thanks in Advance..Hi Blushadow
Now if i want to update say only 10 records at a time what should i put into my Proc?
Please go thru my Proc below..
CREATE OR REPLACE PROCEDURE PRTS.UPDT_ISSUE_USR_ROLE
As
Cursor cur_user_role Is
Select a.org_id,a.user_id
from prts_user a,issue_user_role b
where a.user_id=b.user_id;
upd_rec cur_user_role%rowtype;
v_rows_processed Number:=0;
Begin
Open cur_user_role;
Loop
Fetch cur_user_role into upd_rec;
If cur_user_role%NOTFOUND
Then
Exit;
Else
update Issue_user_role
set User_org_nm=(Select full_org_nm from VW_Org where org_id=upd_rec.org_id)
Where Issue_User_Role.rowid in
(select issue_user_role.rowid
FROM issue_user_role,issue,issue_workflow,Issue_step_dtl_wrkflw
Where Issue_User_Role.Issue_Id=Issue.Issue_id
And Issue_User_Role.Issue_id=issue_workflow.issue_id
And Issue_User_Role.Workflow_compnt_id=Issue_Workflow.CURR_STEP_WORKFLOW_COMPNT_ID
And Issue_User_Role.Workflow_compnt_id=Issue_Step_Dtl_wrkflw.Workflow_compnt_id
And Issue_User_Role.Issue_id=Issue_Step_Dtl_wrkflw.Issue_Id
And Issue.Issue_id=Issue_workflow.Issue_Id
And Issue.Issue_id=Issue_Step_Dtl_Wrkflw.Issue_id
And Issue_workflow.Issue_id=Issue_Step_Dtl_Wrkflw.Issue_id
And Issue_Workflow.CURR_STEP_WORKFLOW_COMPNT_ID=Issue_Step_Dtl_wrkflw.Workflow_compnt_id
And issue_workflow.primry_workflow_flag='Y'
And issue_user_role.user_id = upd_rec.user_id
And issue.issue_status_id in (1636,50738,275,50737,2090)
And issue_step_dtl_wrkflw.Issue_step_status_id in (61248,61249,61250));
v_rows_processed :=v_rows_processed + SQL%ROWCOUNT;
If Mod (v_rows_processed,v_rows_processed)=10
then
COMMIT;
End if;END IF;
End Loop;
Commit;
dbms_output.enable(1000000);
dbms_output.put_line('There were '||v_rows_processed||' rows updated');
Close cur_user_role;
End;
I would appreciate if you can let me know any other alternative way to meet this requirment.
Cheers
Vineet -
Pl/SQL procedure + framework extension
Hello,
We have requirement to write common pl/sql procedure calling method to execute the pl/sql procedure called from ADF BC entityImpl and Application module Impl classes. While reading document it is mentioned to add it in adf bc framework extension base classes.But if we place common pl/sql procedure calling method in entity Impl base classes,how I can use same method from application module classes?
Any other approach? Any pattern??
Regards
RaviRavi,
you have to be more specific. What is the intention of the PL/SQL function you want to call from the EntiyImpl class. If you plan to just do something on attribute level or are probably on the save side. For anything else you have to make sure that after changing anything using PL/SQL you have to query all VO again. Otherwise they don't get the changes.
The method to call PL/SQL is like the one from the doc. You even can get an application module and call a method from there.
To get the application module from an EO
public class EOTest extends EntityImpl
ApplicationModule getApplicationmodule()
this.getDBTransaction().findApplicationModule("yourApp");
}Timo -
Can this be done using a single sql......
Hi,
I have a problem to solve an was just wondering if it was possible to do it using a single sql. It is not imperative that I use a single sql but would like to know if it were possible and if so how, else I would appreciate if I was guided in the general direction where I may be able to find a solution....
1) Esstentially in this example an employee can have 3 types of managers 'A' 'B' or 'C'.
2) the emplyee must have 1 and only 1 manager of type 'A' (it is imperative that an emp have a manager of type A)
3) the employee can have multiple managers of Type B and C but it is possible that the emp does not have any manager of type B and C
We need a report which compares all the type B managers of an employee to the type A manager of the same employee and if any one of the Type B manager is same as the type A manager then the report indicates 'Equal' else the report indicates 'Not Equal'. if there is no type B manager for the employee then the report should show is as 'Not Equal'.
The same comparsion need to be done between type C and type A managers for the employee...
here are the scripts you would require to create a dummy table with data
?SCRIPTS START?
create table emp (empid number(3), mgrid number(3), mgr_type varchar2(1))
insert into emp values (1,3,'A')
insert into emp values (1,10,'B')
insert into emp values (1,14,'C')
insert into emp values (2,15,'A')
insert into emp values (3,10,'A')
insert into emp values (3,10,'B')
insert into emp values (3,10,'C')
insert into emp values (4,12,'A')
insert into emp values (5,2,'A')
insert into emp values (5,2,'B')
insert into emp values (5,3,'B')
insert into emp values (6,1,'A')
insert into emp values (6,5,'C')
select * from emp
?SCRIPTS-END?
EMPID> MGRID> M
1> 3> A
1 > 10 > B
1 > 14 > C
2 > 15 > A
3 > 10 > A
3 > 10 >B
3 > 10> C
4 >12 > A
4 > 12 > C
5 > 2 > A
5 >2 > B
5 > 3> B
6 > 1 > A
6 > 5 > C
6 > 7 > C
Expected Report
emp_id> mgr_type_A> mgr_type_B> mgr_type_C
1>>> 3>>> Not Equal>>> Not Equal
2>>> 15>>> Not Equal>>> Not Equal
3>>> 10>>> Equal>>> Equal
4>>> 12>>> Not Equal>>> Equal
5>>> 2>>> Equal>>> Not Equal
6>>> 1>>> Not Equal>>> Not Equal
at the end of the day the report is to be exported as an xls. I would be using java to connect to the DB and create the xls. Obv I could run a simple sql and do a lot of comparision in java and get the desired report... What I am looking for is
- Is it possible using a single sql.
- if not.. is it better to use a pl/sql procedure or do it using java code.
the table has abt 100,000 records .... performance is not really a factor right now...
I just have no idea where to look.. I thought of pivot tables but could not find a solution... thought of decode as well... but again to no avail... (i am not oracle expert by any means....)
Appreciate any help I can get...
Thanks...
PS: Have used > to seperate the data.. since the preview of the post was truncating all spaces between the columns and was making it difficult to differetiate the data....
ooooppppsss....just realised i should have put this in the PL/SQL forum.. dont' seem to find an option to delete the post.. so if someone can move it to the other forum... it would be great....
Message was edited by:
user520267Well, there are no moderators here, so you are going to have to get your answer here :-). Most of us that hang out in PL/SQL are here too.
Assuming that 4>>> 12>>> Not Equal>>> Equal is a typo because there is only one record for empid 4, this works. There may be more efficient ways but ...
SQL> SELECT a.empid, a.mgrid,
2 NVL((SELECT 'EQUAL' FROM emp b
3 WHERE b.empid = a.empid and
4 b.mgrid = a.mgrid and
5 b.mgr_type = 'B'), 'NOT EQUAL') bmgr,
6 NVL((SELECT 'EQUAL' FROM emp c
7 WHERE c.empid = a.empid and
8 c.mgrid = a.mgrid and
9 c.mgr_type = 'C'), 'NOT EQUAL') cmgr
10 FROM emp a
11 WHERE mgr_type = 'A';
EMPID MGRID BMGR CMGR
1 3 NOT EQUAL NOT EQUAL
2 15 NOT EQUAL NOT EQUAL
3 10 EQUAL EQUAL
4 12 NOT EQUAL NOT EQUAL
5 2 EQUAL NOT EQUAL
6 1 NOT EQUAL NOT EQUALYou can format your code and data, as I did here, by using [ pre ] and [ /pre ] without the spaces around the text you want preserved. [ code ] and [ /code ] works too.
HTH
John -
Pl/sql procedure for match-merge operator
I have used the match-merge operator in OWB. I want to implement the same match-merge operation using a pl/sql procedure. Please help.
Yes sure. Lets say, we have a table tab1, which has the following structure and data:
First_name Last_name Address City
JACK ANDREWS XYZ NY
ANDREWS JACK NY
Now, i want to write a procedure which matches and merges the above two records, into a single record.The matching is done with the help of the first_name and last_name columns. -
Retreiving data from external DB using cursors (Native SQL)
Hi experts,
Iu2019m trying to use some functionality based on the Native SQL on an Oracle Server. Iu2019m facing some difficulties using cursors and fetching data from the external database.
Basically the synonym its zfisicc_c_dblink, and Iu2019m running the for the following code:
TRY.
OPEN CURSOR WITH HOLD c1 FOR SELECT *
FROM zfisicc_c_dblink
WHERE estado_sif = 'I'.
CATCH cx_sql_exception INTO sqlerr_ref.
PERFORM handle_sql_exception USING sqlerr_ref.
ENDTRY.
DO.
* "Move the data from the Cursor into the target area.
FETCH NEXT CURSOR c1 APPENDING TABLE tab.
IF sy-subrc 0.
EXIT.
ENDIF.
ENDDO.
CLOSE CURSOR c1.
The cursor C1 it's cursor type and the table tab it's ZFISICC_C_DBLINK type, but every time i run it it's giving me the ORA-932 error.
Database error text........: "ORA-00932: inconsistent datatypes: expected %s
got %s"
Can anyone help me on this error? What Iu2019m doing wrong when fetching the data ?
Another doubt that Iu2019ve it's when using pl/Sql procedure. Can anyone tell how I can retrieve data from the external database with the following code?
**Select Directo com Cursor
EXEC SQL.
CONNECT TO :gv_db_name AS 'dblink_con'
ENDEXEC.
IF sy-subrc NE 0.
WRITE: 'Não foi possível fazer a ligação à DBCON: ', gv_db_name.
ELSE.
EXEC SQL.
DECLARE CURSOR c_1 IS SELECT tipo_operacao FROM movimento_contribuicao
WHERE ROWNUM <= 10000;
wa movimento_contribuicao.tipo_operacao%type;
BEGIN
OPEN c_1;
LOOP
FETCH c_1 INTO wa; "Not able to return data to SAP system
EXIT WHEN c_1%NOTFOUND;
END LOOP;
END;
ENDEXEC.
EXEC SQL.
DISCONNECT 'dblink_con'
ENDEXEC.
ENDIF.
On the FETCH c_1 INTO wa; code Iu2019m moving the data to an Oracle variable, wa movimento_contribuicao.tipo_operacao%type;, and not to an program variable. Can anyone explain me this how this is +possible using this PL/SQL procedure?
Thanks in advance,
Best Regards
João Martins
Edited by: Rob Burbank on May 7, 2010 10:25 AMHi Joao,
Regarding your first question: It looks like there's a conversion problem (with one or more columns) from your Oracle table to your ABAP internal table.
In the following link you can see (in your case in the SELECT section) the type conversions used for each type combination.
Some combinations lead to an oracle error (specified in the "Result" column), like in your case (error 932).
http://help.sap.com/saphelp_470/helpdata/EN/a3/74caa1d9c411d1950e0000e8353423/content.htm
Regarding your second question: You can use the PERFORMING addition in the EXEC SQL statement.
You can see an example in the following link:
http://help.sap.com/saphelp_470/helpdata/EN/fc/eb3b8b358411d1829f0000e829fbfe/content.htm
Hope it helps.
Regards,
Ana Luisa.
Maybe you are looking for
-
How to find out if a pattern validation failed
Hello, I have Designed a form with several pattern-validations on it. LC's default behavior on such validation is that a message will be shown, but the user is still allowed to leave the field. Even if the entered data is crap. So is it there any way
-
How do I selectively sync contacts between MacBook and iPhone?
I see several posts mentioning select groups, etc. in iTunes. But when I enter the "Info" tab in iTunes, the only option (radio button) available is "All contacts;" "Select groups" is greyed out. Wait - my MacBook Pro's Addressbook doesn't seem to al
-
I am a Creative Cloud subscriber and Acrobat XI Pro is asking for a serial number. When I enter my CC serial number, it indicates that the serial number is invalid
-
New iPad iPhone app hosed my ability to control my kids appleTv
Last night I could not connect to my daughters Apple TV tonight I had the bright idea to update it. Long story short, I can no longer change the movie she is watching or choose a new playlist. Apple really messed this one up. I have five apple TV's,
-
To : Oracle Team.. xmldom.writetoclob is too slow
HI; I had Oracle 8.1.6, Used the xmldom package a lot to manipulate and create xml documents ( all sizes ). then I used xmldom.writetoclob which it was giving a GREAT performance. I UPGRADED ti Oracle 8.1.7 and xmldom.writetoclob is TOO SLOW now, I h