Enhancement: PL/SQL Package decomposition
Can I put in a plea for raptor to use the jdeveloper style of decomposition for PL/SQL objects at least.
The structure of the object which is being edited in the main window (or selected in the connections tree) is displayed in a separate structure pane below the Connections tree.
This means that a package with many procedures doesn't make the the connections tree too long. You can be looking at table structure in the connections tree while still seeing the package structure in the structure pane.
Clicking on a variable or procedure in the structure pane moves the editor focus to the correct place.
Errors detected by the editor are displayed in the structure pane too.
Here is an example.
http://homepages.nildram.co.uk/~ponders/jdeveloper.png
SQL Loader is tailor-made for importing data from flat-files.
There's way less code to write and it is usually faster than coded approach so this may be better solution for you, depending on details of your situation.
See docs: http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a76955/ch03.htm#2436
Similar Messages
-
I am having problems with the package decomposition for already decomposed packages being discarded when refiltering the packages. Filtering out the previously decomposed package and then filtering it back in doesn't fix it and neither does disconnecting and reconnecting. The only thing that seems to fix it is a SQL Developer restart.
This makes it very frustrating to work through code called by a procedure in a set of tightly integrated packages (I am on an Oracle Apps site).you were talking about refreshing and I was getting the problem when refilteringYou're right, the problem is more extensive than I initially experienced. Thanks for pointing that out.
the thread went off on a tangentHehe, I did got buried there, but resurfaced near the end ;-)
Let's hope we've done a better job in catching the attention this time.
Thanks,
K. -
The -dataSource parameter in assemble a web service from a PL/SQL package
When I use Web Service Assembler to assemble a Web Service from a PL/SQL package, I need to specify the dataSource parameter, e.g.:
java -jar wsa.jar -plsqlAssemble -sql pkgname -dataSource jdbc/MyDS -dbConnection ... -dbUser scott/tiger ....
The dataSource also needs to be pre-configured in the data-sources.xml in OC4J.
I am wondering why dataSource is needed here because the database connection information is already specified on the commandline ( dbConnection and dbUser).
If I have to specify dataSource, how do I configure data-sources.xml dynamically at run-time (e.g., adding entries)?
Thanks,
JimThe -dataSource parameter specifies the data-sources.xml entry used at runtime. The database connection info is only for design time use. Typically you make sure data-sources.xml contains an entry with jndi-location of the same name you specifies for -dataSource. To configure data-sources.xml at runtime, it is out of the scope of web services. Please refer to OC4J admin guide. You can probably modify the data-sources.xml file and force OC4J to reconfigure based on the new data-sources.xml file.
-
Creating PL/SQL Package with all the types
CREATE OR REPLACE
TYPE rec_type AS OBJECT (
first_name VARCHAR2(20),
last_name VARCHAR2(20)
CREATE OR REPLACE
TYPE REC_TYPE_TAB AS TABLE OF rec_type
I am able to create the above types in oracle and used in PL/SQL packages. And like this I have somany types. I would like to if I can create a package with the types to make the life easier. Could you please tell me how to do it.
your help is greately appreciated..
--Krishsb92075 wrote:
TYPE add only aggravation, complexity, & should be avoidedI disagree.
When used correctly types can be the simplest solution.
For example when passing multiple values to a stored procedure. Avoiding the type in the below example would lead to further complexity and aggravation not lessen it.
SQL> create or replace procedure p
2 (
3 p_object_list in sys.odcivarchar2list,
4 p_result out sys_refcursor
5 ) as
6 begin
7 open p_result for
8 select owner, object_name, object_type
9 from all_objects
10 where object_name in
11 (
12 select column_value from
13 table(p_object_list)
14 )
15 order by
16 owner, object_name, object_type;
17 end;
18 /
Procedure created.
SQL> exec p(sys.odcivarchar2list('DUAL','ALL_OBJECTS'),:c)
PL/SQL procedure successfully completed.
SQL> print c
OWNER OBJECT_NAME OBJECT_TYPE
PUBLIC ALL_OBJECTS SYNONYM
PUBLIC DUAL SYNONYM
SYS ALL_OBJECTS VIEW
SYS DUAL TABLE -
Hello,
The problem I am confronted with is reusing generated models.
In the process of DataMinig several steps are used: prepare data, Attribute selection (using AI), and building, testing and applying models.
If PL/SQL packages are used two problems occur:
First: Long, hand driven process of building:
Model generation in ODM,
PL/SQL package building in ODM and Export to SQL file,
importing package to DB, compiling and running.
I am sorry, but I don't understand why is it necessary to export PL/SQL packages in a file? As if these products aren't both Oracle products?
Second: If data (in time) changes and AI selects new attributes, then all next steps fail, since column names, and even some values, are hard coded! Therefore it is necessary to go trough the build and export process all over again. This really hurts.
Do you have a suggestion how to get around this problem?
I already considered using a SPSS Clementine, but since it is not an Oracle product I still believe, the original Oracle solution should give me some advantages.
Oh and another issue.
I tried using PL/SQL generator (Ver.: 10.1.3.0.17) in JDeveloper (ver.: 10.1.3.0.4), but it gave me an error:
java.lang.NoClassDefFoundError: oracle/dmt/dm4j/DM4JConnectionManager
at oracle.dmt.dm4j.extension.CodeGenerator.invoke(Unknown Source)
at oracle.ide.wizard.WizardManager.invokeWizard(WizardManager.java:310)
at oracle.ide.wizard.WizardManager$2.run(WizardManager.java:358)
at oracle.ide.util.IdeUtil.invokeAfterRepaint(IdeUtil.java:1093)
at oracle.ide.wizard.WizardManager$1.run(WizardManager.java:366)
at oracle.ide.util.IdeUtil$1$1.run(IdeUtil.java:1073)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Thanks for the reply,
IgorHi,
The code generation available in ODMr would allow you to deploy the build, apply or test process as generated code.
I am not sure what your application goal is, but if you simply want to deploy a model be used in an apply process that is rather straight forward.
You would build the model using ODMr. Then create an Apply Activity, again using ODMr.
The Apply Activity can then be used to generate code (pl/sql) using the JDev RTM release (10.1.3.2 or above). We will also have a version that will work with SQLDev shortly.
The generated code is immediately placed into the db for you.
If you want to score in a separate db you can either create a db link from that db or move both the model and the apply pl/sql code to the new db (using dba utilities).
If you want to rebuild a model, where you would add/remove attributes, change transformations etc. then you will have to regenerate the code.
If you simply want to rebuild the model without changing any transformations and settings you could also deploy the model build generated code.
As for the JDev failure, we are going to look into that. Have you tried the JDev 10.1.3.3 release available on the Oracle web site?
Thanks, Mark -
Creating PL/SQL package in SQL Developer 4.0.0.12
Hi,
I have built a model in SQL Developer 4.0.0.12 and I want to create it's PL/SQL package.
In ODMiner 11.1.0.4 from "Tools" > "Create pl/sql package" I can get a script for creating package and every thing is OK.
but in SQL Developer I select "Deploy" from every node's context menu and it generates a folder containing some scripts related to every node. I don't see any relevant script for creating any package.
How can I create relevant PL/SQL package from my workflow?
Thank you for any help you can provide in this situation.Please refer to this White paper for how to generate PL/SQL package for workflow deployment:
Oracle Data Miner (Extension of SQL Developer 4.0)
Generate a PL/SQL script for workflow deployment
http://www.oracle.com/technetwork/database/options/advanced-analytics/odmrcodegenwhitepaper-2042206.pdf -
How to get changes of a custom PL/SQL package updated in ISG?
Hi All,
I need some help on how to change a custom PL/SQL package in ISG integration repository:
I already uploaded my custom PL/SQL package to the integration repositoy some time ago. Now I have made some changes to PL/SQL record/table types defined in the package (added some fields and removed some others). These changed record/table types are used by a procedure I already uploaded to the integration repository. When regenerating the WSDL for my PL/SQL package in integration repository I get an error that the wrapper for respective procedure can't be found. When checking up the SQL types that were automatically generated (by JPublisher) for corresponding PL/SQL types, these generated SQL types are invalid...
So it seems that in one case JPublisher generated an empty SQL type (with no attributes). In another case JPublisher generated the SQL type with old attribute list, so it didn't adopt the changes of corresponding PL/SQL type in the package...
Can anybody tell me how to get the changes of a cusotm PL/SQL package updated in ISG? Or is there any possibility to first remove a whole PL/SQL package from the ISG integration repository (and getting rid of all old automatically generated SQL types), so that I can newly upload my PL/SQL package afterwards?
Thanks
Konrad
Edited by: Konrad on 24.10.2011 10:51Thanks Daniel, for your reply...
(-> for info: I'm a colleague of Konrad...)
Yes, we used a higher version number - and the upload of iLDT file works fine...
But, the problem occured when generating the WSDL...
However, I think we have found an approach of how to get the changes of a custom PL/SQL package updated correctly in ISG:
1. Save a copy of PL/SQL package and then delete it in the database
2. Regenerate the WSDL for PL/SQL package in ISG (seems that all atutomatically generated JPub wrappers and SQL types are also deleted)
3. Restart all processes
4. Create the changed version of PL/SQL package in the database again
5. upload of iLDT
6. Regenerate the WSDL for PL/SQL package in ISG
Best Regards
Carolin -
Creating a webservice from PL/SQL Package in JDev 11g
Hi All...
I have a PL/SQl package and I am using JDEv 11g. I want to create it as a webservice. I want to deploy it in a remote server. Can I deploy it from my client machine. In server Weblogic already started. What are the prerequisites, that we need to deploy a wbservice. I done the following steps.
1. Create an application.
2. Right click the package and select Generate Java option.
3. It create a Java class in the Application sources.
4. Double click the class and select Create Web Service. It created the web service.
5. When I select the webservice and click Run it shows the following error. It going to the Default \server. Actually I need it in a remote server.
[Running application NewWebService on Server Instance DefaultServer...]
---- Deployment started. ---- Apr 20, 2009 1:15:40 PM
Target platform is (Weblogic 10.3).
Running dependency analysis...
2009-04-20 13:15:40.205: Writing WAR file to D:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\NewWebService\NewWebService-LastNoWebService-webapp
2009-04-20 13:15:40.222: Wrote WAR file to D:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\NewWebService\NewWebService-LastNoWebService-webapp
2009-04-20 13:15:40.357: Writing EAR file to D:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\NewWebService
2009-04-20 13:15:40.374: Wrote EAR file to D:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\NewWebService
Deploying Application...
<Apr 20, 2009 1:15:40 PM IST> <Warning> <J2EE> <BEA-160195> <The application version lifecycle event listener oracle.security.jps.wls.listeners.JpsAppVersionLifecycleListener is ignored because the application NewWebService is not versioned.>
<Apr 20, 2009 1:15:40 PM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1240213540593' for task '3'. Error is: 'java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext'
java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
Truncated. see log file for complete stacktrace
java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
Truncated. see log file for complete stacktrace
>
<Apr 20, 2009 1:15:40 PM IST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'NewWebService'.>
<Apr 20, 2009 1:15:40 PM IST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
Truncated. see log file for complete stacktrace
java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
Truncated. see log file for complete stacktrace
>
[Deployer:149034]An exception occurred for task [Deployer:149026]deploy application NewWebService on DefaultServer.: sqlj.runtime.ref.DefaultContext.
weblogic.application.WrappedDeploymentException: sqlj.runtime.ref.DefaultContext
#### Deployment incomplete. #### Apr 20, 2009 1:15:40 PM
oracle.jdeveloper.deploy.DeployException
at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:247)
at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.deployImpl(Jsr88RemoteDeployer.java:157)
at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
at oracle.jdeveloper.deploy.common.BatchDeployer.deployImpl(BatchDeployer.java:82)
at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
at oracle.jdevimpl.deploy.fwk.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:436)
at oracle.jdeveloper.deploy.DeploymentManager.deploy(DeploymentManager.java:209)
at oracle.jdevimpl.runner.adrs.AdrsStarter$5$1.run(AdrsStarter.java:1365)
Caused by: oracle.jdeveloper.deploy.DeployException
at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:413)
at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:238)
... 11 more
Caused by: oracle.jdeveloper.deploy.DeployException: Deployment Failed
at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:395)
... 12 more
#### Cannot run application NewWebService due to error deploying to DefaultServer.
[Application NewWebService stopped and undeployed from Server Instance DefaultServer]
6. when i goto the consoleof weblogic server, already an instance created. But nothing displayed under WebServices.
7. Select the instance and press 'Start'. While deploying an error came.
java.lang.Exception: [DeploymentService:290049]Deploy failed for id '1,240,213,727,265' since no targets are reachable.
Please help me..
its very urgent...
Regards,
Resmi.Oh, no - another very urgent question. The world must be about to end ;)
Resmi, Have a read of [url http://forums.oracle.com/forums/thread.jspa?threadID=883293]this - JDeveloper 11g, as of today, doesn't (at least is not supposed to) support publishing PL/SQL procedures/packages as a web service.
John -
How to Print the Value of a variable inside a PL/SQL package
Hi Friends,
Here is my Scenario
I have a PL/SQL Package. Let us call it Baseline Package.
This Package includes a dynamically built merge Statement.
Execute Immediate v_merge_query.
I have a procedure which replaces which few Keywords from the Package Text and Creates a new one depending on Inputs I provide. (This is something like a Code generator)
Now while Creating the new package, I need to print the Value of v_merge_query.... I Need s Static Query to be Printed inside the new package and not a dynamic query.
My Question is "Is there a way to print the value of the variable inside a different PL/SQL package?
Thanks in Advance,
MohitPrint where?
That PL/SQL code is server-side code. It runs in an Oracle server process.
That server process does not have a keyboard. Or a screen/monitor. Or display canvas. Or an attached printer.
That server process is incapable of "printing" as that is not its job or responsibility and not part of its environment.
What is can do is record data for the client to look at afterwards. This can be done using static PL/SQL session variables. Or a SQL table.
The former is done by DBMS_OUTPUT - a very primitive interface for writing text into a static PL/SQL string array. That btw resides in expensive private process server memory. The client can query the array after a database call and render the contents.
PS. Also keep in mind that bind variables are critical for performance and server robustness - especially when (ab)using dynamic SQL. -
Invoking Web Service From PL SQL package
Below is the sample code to invoke web service from pl/sql package using UTL_HTTP:
Declare
http_req UTL_HTTP.req;
http_resp UTL_HTTP.resp;
Begin
http_req :=
UTL_HTTP.begin_request
'http://'
|| lv_hosturl
-- || '.net/soa-infra/services/finance_rt/Payments/paymentsprocess_client_ep',
--new url
|| '.net/soa-infra/services/finance_rt/PaymentsReq/paymentsprocess_client_ep?WSDL',
'POST',
'HTTP/1.1'
UTL_HTTP.set_header (http_req, 'Content-Type', 'text/xml');
-- since we are dealing with plain text in XML documents
UTL_HTTP.set_header (http_req,
'Content-Length',
LENGTH (lv_soap_request)
UTL_HTTP.set_header (http_req, 'SOAPAction', '');
-- required to specify this is a SOAP communication
UTL_HTTP.write_text (http_req, lv_soap_request);
http_resp := UTL_HTTP.get_response (http_req);
UTL_HTTP.read_text (http_resp, lv_soap_respond);
UTL_HTTP.end_response (http_resp);
resp := XMLTYPE.createxml (lv_soap_respond);
End;Hi,
there are a lot of option to make plsql web services .
First you can stay with jdev 10.1.3
Use the xmldb servlets
use jdev 11g tp4 to create plsql ws and upgrade to jdev 11g production
And I think in the next release of jdev it will be back , there are more options which disappeared like the adf bc sdo ws or jmx datacontrol etc.
thanks Edwin -
Support for Creating Web Service from pl/sql package in JDeveloper 11
We have been creating all of our web services from pl/sql packages in our Oracle database using JDeveloper 10.1.3.1. I understand that this capability is not supported in Jdev 11. We have been mandated to either move up to JDeveloper 11, or consider switching to eclipse, or even VS2008 and run .NET services from IIS. I have seen work-around solutions using TopLink and Jdev 11. Are there plans to revive this feature in the near future? We're now looking at switching to .NET since we could scrap our OAS instances and use IIS to publish web services. The only reason we were sticking with Oracle was the ease in converting all our existing package to web services with Jdev.
Is anyone else in the same situation. If so, what solutions are you considering?Hi,
there are a lot of option to make plsql web services .
First you can stay with jdev 10.1.3
Use the xmldb servlets
use jdev 11g tp4 to create plsql ws and upgrade to jdev 11g production
And I think in the next release of jdev it will be back , there are more options which disappeared like the adf bc sdo ws or jmx datacontrol etc.
thanks Edwin -
Error when publishing a PL/SQL package as a Webservice
Hi all,
I am using the JDeveloper (10.1.3.1.0) to publish a PL/SQL package as a Webservice, and I am having some troubles on the generation process.
The problem that I am facing is on the generated code for the database side, where some methods have a “$GET_” at the end of its name.
This “$GET_” is handled by the database as a special word, and the package can’t be compiled.
If the ‘$’ character is removed from all the methods, the package can be compiled and the Webservice works fine.
What’s wrong? Is there a bug on the generation process of the JDeveloper?
Regards,
Rui TorresOK, This is the PL/SQL package:
Function:
FUNCTION Obtener_paises RETURN res_webservice AS
v_respuesta res_webservice;
i PLS_INTEGER:=1;
CURSOR C_paises IS
SELECT cpais, tpais
FROM paises
ORDER BY tpais;
BEGIN
v_respuesta := res_webservice(null,null);
v_respuesta.error := res_error(null,null,null);
v_respuesta.error.cerror := 0;
v_respuesta.error.cerror_ora := 0;
v_respuesta.error.terror := null;
v_respuesta.datos := res_datos ();
FOR v_pais IN C_paises LOOP
v_respuesta.datos.extend;
v_respuesta.datos(i) := reg_datos(null,null);
v_respuesta.datos(i).codigo := v_pais.cpais;
v_respuesta.datos(i).descripcion := v_pais.tpais;
i := i + 1;
END LOOP;
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:0');
RETURN v_respuesta;
EXCEPTION
WHEN OTHERS THEN
v_respuesta.error.cerror := 1;
v_respuesta.error.cerror_ora := SQLCODE;
v_respuesta.error.terror := substr(SQLERRM,1,80);
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:1 '||substr(SQLERRM,1,120));
RETURN v_respuesta;
END Obtener_paises;
TYPES USED:
CREATE OR REPLACE
TYPE res_webservice AS OBJECT (error res_error, datos res_datos);
CREATE OR REPLACE
TYPE res_error AS OBJECT (cerror NUMBER(1), cerror_ora VARCHAR2(12), terror VARCHAR2(80));
CREATE OR REPLACE
TYPE res_datos AS TABLE OF reg_datos;
CREATE OR REPLACE
TYPE reg_datos AS OBJECT(codigo VARCHAR2(12), descripcion VARCHAR2(150));
Thanks in advanced...
Could happen this bacause of these defined types??? -
Problem with pl/sql package
hi,
i have requirement where i have to create a PL/SQL package which takes two parameters from procedure where i shd give fromdate and todate as parameter below is the code i am getting two errors
create or replace PACKAGE AgentTimeReport_XDO_pkg AS
PROCEDURE AgentTimeReport_Demo_RTF(o_errbuf OUT VARCHAR2
,o_retcode OUT VARCHAR2,p_fromdate IN VARCHAR2,p_todate IN VARCHAR2 );
END AgentTimeReport_XDO_pkg
CREATE OR REPLACE
PACKAGE BODY AGENTTIMEREPORT_XDO_PKG AS
PROCEDURE AgentTimeReport_Demo_RTF(o_errbuf OUT VARCHAR2
,o_retcode OUT VARCHAR2,p_fromdate IN
VARCHAR2,p_todate IN VARCHAR2 ) AS
cursor cs_agenttime
is
SELECT
incident.Incident_Number as ServiceRequestNumber,
TO_CHAR (incident.incident_date,'DD-MON-YYYY') as ServiceRequestDate,
incident.Summary as Summary,
agenttime.agentname as AgentName,
to_char(agenttime.agentstarttime,'DD-MM-YYYY HH24:MI') as StartTime,
to_char(to_date('00:00:00','HH24:MI:SS') +
(agenttime.endtime-agenttime.agentstarttime), 'HH24:MI') as TimeSpent
FROM cs_incidents_all_b incident,cs_agenttime_agv agenttime
WHERE agenttime.incident_id=incident.incident_id
AND incident.incident_date between to_date(:p_fromdate,'DD-MON-YYYY')
AND to_date(:p_todate,'DD-MON-YYYY');
BEGIN
/*First line of XML data should be ‘<?xml version="1.0" encoding='utf-8'?>’*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0" encoding="utf-8"?>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<AGENTTIME>');
FOR cs_agent IN cs_agenttime
LOOP
/*For each record create a group tag <G_AGENT_TIME> at the start*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<G_AGENT_TIME>');
/*Embed data between XML tags for ex:- <EMP_NAME>Abeesh</EMP_NAME>*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_NUMBER>' ||
cs_agent.ServiceRequestNumber
|| '</SERVICEREQUEST_NUMBER>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_DATE>' ||
cs_agent.ServiceRequestDate ||
'</SERVICEREQUEST_DATE>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<START_TIME>' || cs_agent.StartTime
||'</START_TIME>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<TIME_SPENT>' || cs_agent.TimeSpent
||'</TIME_SPENT>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</G_AGENT_TIME>');
END LOOP;
/*Finally Close the starting Report tag*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</AGENTTIME>');
END AgentTimeReport_Demo_RTF;
END AGENTTIMEREPORT_XDO_PKG;
Error(20,44): PLS-00049: bad bind variable 'P_FROMDATE'
Error(21,13): PLS-00049: bad bind variable 'P_TODATE'
Help me out
naveencreate or replace PACKAGE AgentTimeReport_XDO_pkg AS
PROCEDURE AgentTimeReport_Demo_RTF(o_errbuf OUT VARCHAR2
,o_retcode OUT VARCHAR2,p_fromdate IN VARCHAR2,p_todate IN VARCHAR2 );
END AgentTimeReport_XDO_pkg
CREATE OR REPLACE
PACKAGE BODY AGENTTIMEREPORT_XDO_PKG
AS
PROCEDURE AgentTimeReport_Demo_RTF
o_errbuf OUT VARCHAR2 ,
o_retcode OUT VARCHAR2,
p_fromdate IN VARCHAR2,
p_todate IN VARCHAR2 )
AS
CURSOR cs_agenttime(p_fromdate VARCHAR2,p_todate VARCHAR2)
IS
SELECT incident.Incident_Number AS ServiceRequestNumber,
TO_CHAR (incident.incident_date,'DD-MON-YYYY') AS ServiceRequestDate ,
incident.Summary AS Summary ,
agenttime.agentname AS AgentName ,
TO_CHAR(agenttime.agentstarttime,'DD-MM-YYYY HH24:MI') AS StartTime ,
TO_CHAR(to_date('00:00:00','HH24:MI:SS') + (agenttime.endtime-agenttime.agentstarttime), 'HH24:MI') AS TimeSpent
FROM cs_incidents_all_b incident,
cs_agenttime_agv agenttime
WHERE agenttime.incident_id=incident.incident_id
AND incident.incident_date BETWEEN to_date(p_fromdate,'DD-MON-YYYY') AND to_date(p_todate,'DD-MON-YYYY');
BEGIN
/*First line of XML data should be ‘<?xml version="1.0" encoding='utf-8'?>’*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0" encoding="utf-8"?>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<AGENTTIME>');
FOR cs_agent IN cs_agenttime(p_fromdate,p_todate)
LOOP
/*For each record create a group tag <G_AGENT_TIME> at the start*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<G_AGENT_TIME>');
/*Embed data between XML tags for ex:- <EMP_NAME>Abeesh</EMP_NAME>*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_NUMBER>' || cs_agent.ServiceRequestNumber '</SERVICEREQUEST_NUMBER>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_DATE>' cs_agent.ServiceRequestDate || '</SERVICEREQUEST_DATE>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<START_TIME>' || cs_agent.StartTime ||'</START_TIME>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<TIME_SPENT>' || cs_agent.TimeSpent ||'</TIME_SPENT>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</G_AGENT_TIME>');
END LOOP;
/*Finally Close the starting Report tag*/
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</AGENTTIME>');
END AgentTimeReport_Demo_RTF;
END AGENTTIMEREPORT_XDO_PKG;Ravi Kumar -
Need Info Regarding Implementaion of Interfaces in java.sql package
Hi All,
I am interested in knowing details abt how the Interfaces in the java.sql package are implemented. We all work with the database using the interfaces provided ,but how do they work at the backend ? How can a Interface provide details (work ) with out an implementation class.I Is this taken care by the JVM or some of the Call level interfaces? Please do provide details abt this..hi Sheshadri,
The implementation of the various interfaces in
java.sql package are provided by your jdbc driver,
which also manages the connection and communication of
your java program with the appropriate database.
cheers,
-Jer -
Using CASE WHEN in PL/SQL package
I am trying to convert the values in a selected column into 1 and 0 so that I can display all 1s in one column, all 0s in another. I am doing this in a PL/SQL package. However ORACLE compiler does not like the CASE construct.
Does anyone know how to group values in a column into several new columns. If CASE WHEN construct is not doable in PL/SQL, what alternatives are there? Thanks.
/******* My package starts here *******/
CREATE OR REPLACE PACKAGE TEST_NEED AS
PROCEDURE procTEST_NEED(STARTING_DATE IN VARCHAR2);
END CVRR_MON_NEED;
CREATE OR REPLACE PACKAGE BODY TEST_NEED
AS
PROCEDURE procTEST_NEED(STARTING_DATE IN VARCHAR2)
IS
TEST_START DATE := TO_DATE(STARTING_DATE,'MM/DD/YYYY');
CURSOR v_Cursor IS
SELECT A.D_CODE, A.M_CODE, TEST_START , C.C_NAME,C.P_ID,
SUM(CASE WHEN MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 > 40 AND MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 <85 AND B.B_CODE IN '11.1','222.2','272.4') THEN 1 ELSE 0 END) QUALIFIED
FROM A, B, C, D
WHERE A.ID = B.B_ID
AND RTRIM(A.P_CODE) = C.P_CODE
AND A.P_ID = D.P_ID
AND A.P_ID < 99999999999999999999
AND A.E_DATETIME < SYSDATE
GROUP BY A.D_CODE, A.M_CODE, TEST_START , C.C_NAME,C.P_ID;
v_RecordHolder v_Cursor%ROWTYPE;
BEGIN
OPEN v_Cursor;
FETCH v_CursorINTO v_RecordHolder ;
WHILE v_Cursor%FOUND LOOP
look for records in another table with matching keys of the cursor
if found then update by incrementing the existing values in the matching records with values of the current currsor row
else insert the current cursor row
FETCH v_Cursor INTO v_RecordHolder ;
END LOOP;
END procTEST_NEED;
END TEST_NEED;I am trying to convert the values in a selected
column into 1 and 0 so that I can display all 1s in
one column, all 0s in another. I am doing this in a
PL/SQL package. However ORACLE compiler does not
like the CASE construct.
Does anyone know how to group values in a column into
several new columns. If CASE WHEN construct is not
doable in PL/SQL, what alternatives are there?
Thanks.
CURSOR v_Cursor IS
SELECT A.D_CODE, A.M_CODE, TEST_START ,
, C.C_NAME,C.P_ID,
SUM(CASE WHEN MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 >
40 AND MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 <85 ANDB.B_CODE IN '11.1','222.2','272.4') THEN 1 ELSE 0
END) QUALIFIEDUse the Decode function. This has been around in oracle SQL for ages and works like a case construct.
You would do something like
select ...
sum( decode (MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 >
40 AND MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 <85 AND
B.B_CODE IN ('11.1','222.2','272.4') 1,0 )
Maybe you are looking for
-
Can I download to a memory stick
Can I down load from my iPod to a thum drive
-
Hey, I currently have a DV6 Pavillion Laptop (may not survive much longer!) I have googled to high ends to solve my problem, but I have found nothing. The problem is something will trigger the FN key randomly and I won't know about this until I pr
-
Sound on OS X doesn't work after Soundflower install
Because of missing native equalizer on OS-X (Snow Leopard) I had to use third party app Soundflower in combination with AU Lab. Everything was going right, but once I restarted OS X, the sound stopped working. When I changed the volume by the keys on
-
Possible Fix For When Windows XP Won't Recognize Your iPod
The fix detailed in this article worked for me when I couldn't get iTunes 7 to recognize my iPod in Windows XP. Sometimes when I force quit the iPodService.exe service, it worked the first time, but when I reconnected the iPod, it didn't appear in iT
-
The prices on my ITunes store is incorrect. It says each song is 8.00Kr. I didn't switch anything different about the Itunes, just downloaded the new version of it. I don't want to buy anything in fear of it giving me the wrong price. Thank you!