Passing object as parameter
Hi All,
I have a procedure that takes IN an object as the parameter. I'm using SQL Developer , and also have SQL*plus.
The type is
create or replace
TYPE TY_RAILROAD_OPERATOR AS OBJECT
RRX_RAILROAD_OPERATOR_CD VARCHAR2(6 BYTE),
RRX_RAILROAD_OPERATOR_NM VARCHAR2(60 BYTE) ,
RRX_RAILROAD_OPERATOR_DSC VARCHAR2(2000 BYTE),
STATUS CHAR(1 BYTE),
LAST_UPDATE_DT DATE,
LAST_UPDATE_USER VARCHAR2(60))
procedure set_Railroad_Operator(p_TY_Railroad_Operator IN TY_Railroad_Operator, p_Railroad_Operator_Id OUT NUMBER) IS
v_Railroad_Operator_Id NUMBER;
BEGIN
I have to execute the procedure. How should I pass the parameters?
I would like to test the procedure, and I have no idea how to test it.
Any help is appreciated.
Thanks in advance
N
sample:
SQL> CREATE OR REPLACE TYPE ty_railroad_operator AS OBJECT(
2 rrx_railroad_operator_cd VARCHAR2(6 BYTE),
3 rrx_railroad_operator_nm VARCHAR2(60 BYTE),
4 rrx_railroad_operator_dsc VARCHAR2(2000 BYTE),
5 status CHAR(1 BYTE),
6 last_update_dt DATE,
7 last_update_user VARCHAR2(60)
8 );
9 /
Type created.
SQL> CREATE OR REPLACE PROCEDURE set_railroad_operator(
2 p_ty_railroad_operator IN ty_railroad_operator,
3 p_railroad_operator_id OUT NUMBER
4 )
5 IS
6 v_railroad_operator_id NUMBER := 10;
7 BEGIN
8 DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_cd);
9 DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_nm);
10 DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_dsc);
11 DBMS_OUTPUT.put_line(p_ty_railroad_operator.status);
12 DBMS_OUTPUT.put_line(p_ty_railroad_operator.last_update_dt);
13 DBMS_OUTPUT.put_line(p_ty_railroad_operator.last_update_user);
14 END;
15 /
Procedure created.
SQL>
SQL> DECLARE
2 v_ty_railroad_operator ty_railroad_operator
3 := ty_railroad_operator('OP_CD', 'OP CODE NAME', 'OP CODE DESC', 'S',
4 SYSDATE, 'OP CODE USER');
5 a NUMBER(10);
6 BEGIN
7 set_railroad_operator(p_ty_railroad_operator => v_ty_railroad_operator,
8 p_railroad_operator_id => a);
9 END;
10 /
OP_CD
OP CODE NAME
OP CODE DESC
S
15-JUN-10
OP CODE USER
PL/SQL procedure successfully completed.
SQL>
Similar Messages
-
Will passing object as parameter increase memory usage?
Hi,
Will passing an object as a parameter increase the mmory usage? will it affect the performance of the application any means. Please share your view.
Regards,
A.Ananth.durai wrote:
Hi ,
Just to precise my question, suppose i have an object called Student.I want to pass the Student Object to a method called addStudent().Now rather than passing Student Object, i am passing it's super class "Object". (i.e)
addStudent(Object object) instead of addStudent(Student student)will it make any difference in performance?Those are declarations, not method passing. You'd still be passing the same thing, if it's just a question about how you declare the method.
And it will make no difference in performance, except when you start getting bugs. You might start getting bugs because you declared the parameter with a more general type than is really necessary. If the method takes a Student, then declare it as taking a Student. Making it say it takes an Object will just make things worse.
But as per Cogniac,
when you pass a parameter or use an accessor function (get() function) or something of that sort, it's actually just passing a pointer that points to the memory location of the Object you want, not actually passing the Object itself to you, nor is it instantiating a new instance of the Object for your use.if i pass Object itself instead of Student,which memory address it will point out?That question makes no sense. You pass what you pass. If it's a Student object, then the reference the method gets will point to that object, regardless of whether the method knows that it's a Student or just an Object generally. -
Passing object as parameter in JSF using h:commandLink tag
Hi ,
I have a scenario in which i need to pass objects from one jsp to another using h:commandLink. i read balusC article "Communication in JSF" and found a basic idea of achieving it. Thanks to BalusC for the wonderful article. But i am not fully clear on the concepts and the code is giving some error. The code i have is
My JSP:
This commandlink is inside a <h:column> tag of <h:dataTable>
<h:commandLink id="ol3"action="ManageAccount" actionListener="#{admincontroller.action}" >
<f:param id="ag" name="account" value="#{admincontroller.account}" />
<h:outputText id="ot3" value="Manage Account" rendered="#{adminbean.productList!=null}" />
</h:commandLink>
Also a binding in h:dataTable tag with the binding="#{admincontroller.dataTable}"
My Backing Bean:
public class CompanyAdminController {
private HtmlDataTable dataTable;
private Account account=new Account();
public HtmlDataTable getDataTable() {
return dataTable;
public Account getAccount() {
return this.account;
public void setAccount(Account account) {
this.account = account;
public void action(){
account= (Account)this.getDataTable().getRowData();
} faces-config.xml
<navigation-rule>
<from-view-id>/compadmin.jsp</from-view-id>
<navigation-case>
<from-outcome>ManageAccount</from-outcome>
<to-view-id>/manageAccount.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>admincontroller</managed-bean-name>
<managed-bean-class>com.forrester.AdminController</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>account</property-name>
<property-class>com.model.Account</property-class>
<value>#{param.account}</value>
</managed-property>
</managed-bean>My account object:
public class Account {
string name;
public String getName()
return this.name;
public void setName(String name)
this.name=name;
}I need to display #{admincontroller.account.name} in my forwarded jsp. But I am not sure whether the code i wrote in commandlink is correct. I get an error if i use <f:setActionListener> . No tag "setPropertyActionListener" defined in tag library imported with prefix "f"
Please advise.
Edited by: twisai on Oct 18, 2009 11:46 AM
Edited by: twisai on Oct 18, 2009 11:47 AM
Edited by: twisai on Oct 18, 2009 11:48 AMYes.. iam removed the managedproperty from faces-config. But still i get the null pointer exception on main jsp itself and i am taken to second jsp manageaccount.jsp. Did you find anything wrong in my navigation case in the action method??
public String loadAccount(){
Account account = (Account)this.getDataTable().getRowData();
return "ManageAcct";And also can you please answer this question i have
The AdminController is the backing bean of 1st JSP and manageAccontController is the backing bean of forwarded JSP .
Can i put this action method and dataTable binding in a 2nd manageAccontController backing bean instead of AdminController. But if i do that way dataList binding in h:dataTable tag will be in first JSP backing bean and dataTable binding to 2nd JSP. Not sure how to deal with this.
{ -
Method design question...and passing object as parameter to webserice
I am new to webservice...one design question
i am writing a webservice to check whether a user is valid user or not. The users are categorized as Member, Admin and Professional. For each user type I have to hit different data source to verify.
I can get this user type as parameter. What is the best approach to define the method?
Having one single method �isValidUser � and all the client web service can always call this method and provide user type or should I define method for each type like isValidMember, isValidAdmin ?
One more thing...in future the requirement may change for professional to have more required field in that case the parameter need to have more attribute. But on client side not much change if I have a single isValidUser method...all they have to do is pass additional values
isValidUser(String username, String usertype, String[] userAttributes){
if usertype == member
call member code
else if usertype = professional
call professional code
else if usertype = admin
call admin code
else
throw error
or
isValidMember(String username, String[] userAttributes){
call member code
One last question, can the parameter be passed as object in web service like USER object.First of all, here is my code
CREATE OR REPLACE
TYPE USERCONTEXT AS OBJECT
user_login varchar2,
user_id integer,
CONSTRUCTOR FUNCTION USERCONTEXT (
P_LOGIN IN INTEGER
P_ID_ID IN INTEGER
) RETURN SELF AS RESULT
Either your type wont be compiled or this is not the real code.. -
Hoe to pass object as a parameter thru webSerive
I need to pass Object as a parameter to web service:
example:
public calss returnCodes{
int ret_code;
String ret_string;
public retrunCodes(int ret_code, String ret_string){
this.ret_code = ret_code;
this.ret_string = ret_string;
public int getret_code()
return this.ret_code;
public String getret_string {
return this,ret_string
and other repc holder class to hold returnCodes
public class retrunCodesHolder implents javax.xml.rpc.Holder
returnCode value;
pubic returnCodesHolder(){
public returnCodesHolder(returnCodes value) {
this.value = value;
In Webservice I use returnCodesHolder as parameter.
WebService getReturnCodesWs I have
returnCodes retCodes = new returnCodes(04,"Good return code)
returnCodesHolder retholder = new returnCodesHolder(retCodes)
return myString;
When I am calling above webService in servlet I have code:
org.test.mytest.returnCodesHolder retHolder = new org.test.mytest.returnCodesHolder();
String result = port.getReturnCodesWs(retHolder);
How to I access /get values of returnCodes class in my calling servlet?
I am using Tomcat v 6.0I believe (although have never used, so if I'm wrong,
correct me please!) you can do it with implicit
dynamic cursors, such as:
For rec in 'select col1, col2 from table 1 '||lstr
loop
Not really:
michaels> declare
lstr varchar2 (30) := ' where empno = 7788';
begin
for rec in 'select * from emp e ' || lstr
loop
null;
end loop;
end;
Error at line 1
ORA-06550: line 5, column 4:
PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
. ( * @ % & - + / at mod remainder rem .. <an exponent (**)>
|| -
Passing multi-value parameter from BIEE dashboard to BIP report
It is possibile passing multi-value parameter from BIEE dashboard prompt to BI Publisher integrated report? (BIP report has a DB data source (not a answers))
Thank you
R.Hi Rajkm,
In order to pass a multi-value parameter through the Reporting Services Web services, you need to define the same numbers of ParameterValue objects as the number of the values of the multi-value parameter being past into the report. The Name property
of these ParameterValue objects must be specified same to the parameter name.
I found a good FAQ article for this scenario:
How do I pass a multi-value parameter into a report with Reporting Services Web service API?:
http://blogs.msdn.com/b/sqlforum/archive/2010/12/21/faq-how-do-i-pass-a-multi-value-parameter-into-a-report-with-sql-server-reporting-services-ssrs-web-services-api.aspx
Hope this helps.
Elvis Long
TechNet Community Support -
OpenDocument.aspx - pass multi value parameter when report type is actx
We are running Crystal Reports XI R2 against a business objects infoview server.
We have been successfully using the OpenDocuments method for opening crystal reports but have run into a snag. When using a multi-value parameter, we can only get it to work when the viewer is set to HTML. Setting to ActiveX prompts us to enter in the parameter values manually.
This address works (using sViewer=HTML):
http://vsx2af0x/businessobjects/enterprise115/infoview/scripts/opendocument.aspx?sType=rpt&sViewer=html&lsMpSiteIDs=[1235880],[1235891],[1235902],[1235913]&sPath=[Development][CGIS][Intranet Mapping][COS_Base]&sDocName=DetailedSite&sRefresh=Y
This address does not work (using sVIewer=actx):
http://vsx2af0x/businessobjects/enterprise115/infoview/scripts/opendocument.aspx?sType=rpt&sViewer=actx&lsMpSiteIDs=[1235880],[1235891],[1235902],[1235913]&sPath=[Development][CGIS][Intranet Mapping][COS_Base]&sDocName=DetailedSite&sRefresh=Y
Any thoughts on the problem?As I understand what you need is to use LookupSet function.
Suppose if your dataset is like this (for simplicity I'm showing only required fields)
PersonID Project Company
ID1 P1 C1
ID1 P2 C1
ID1 P3 C2
ID1 P4 C2
ID1 P5 C3
If you want to get the full project list for the person just send the PersonID alone and filter using it in the subreport. You can keep the project/company parameters optional in that case and put a default value. This would be the easiest thing.
Now if you want pass the project parameter also you need to pass it like this
=Join(LookupSet(Fields!Person.Value,Fields!Person.Value,Fields!Project.Value,"DatasetName"),",")
This would act like a self lookup and return you full list of projects for the person and then you can use this to set the parameter value in the subreport.
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
How to pass in a parameter into a report viewer on a jsp - and hidden
Hi, I've built a php application and am using the java environment to enable the crystal report/viewer. The developer was looking how to pass in a parameter into a report viewer on a jsp. Ultimately the end product we need is to get an HTML report viewer loading a report file with hidden parameters so to not expose other customer data (it's a shared database for multiple customers) preferably loaded from php using maybe the php java bridge. Would anyone happen to have any sample code or any guidance?
<%@ page contentType="text/html; charset=UTF-8"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/crystal-tags-reportviewer.tld" prefix="crviewer"%>
<%
// just a test to grab rpt name from GET
String rptFile = "report_files/" + request.getParameter("rpt");
%>
<crviewer:viewer reportSourceType="reportingComponent" viewerName=""
isOwnPage="true">
<crviewer:report reportName="<%= rptFile %>" />
</crviewer:viewer>
Many thanks in advance!
MarkI am not aware of any html tags you can pass to the viewer for parameter values. Normally, you would load the report in code and then use the SDK with the report object to pass parameter values.
-
Passing Objects to Stored Procedures in SQL Queries: UNREF(REF(o))
To me it seems that passing an object (type) to stored procedure in a SQL query is quite laborious. See:
I created the following simple type:
TYPE LAST AS OBJECT (
id NUMBER
defined a function:
FUNCTION "CHECKLAST" (l LAST)
RETURN NUMBER
AS LANGUAGE JAVA
NAME 'Checker.checkLast(Last) return int';
created a typed table:
CREATE TABLE lastTable OF Last;
inserted some objects:
INSERT INTO lastTable VALUES (1003);
NOW! If want to use the StoredFunction I have to use the following syntax:
SELECT checkLast(DEREF(REF(o)))
FROM lasttable o;
That's not very elegant.
I would expect the follwing to be working:
SELECT checkLast(o)
FROM lasttable o;
Did I do something wrong? Or did Oracle forget to implement the simple syntax?
Even worse, the DEREF(REF(o)) trick does not work for member functions...
Regards,
AndréI did some experiments and can now (partly) answer my own question:
Indeed, it is possible to declare a function with a parameter passed as reference:
CREATE OR REPLACE TYPE Point AS OBJECT
ID INT,
MEMBER FUNCTION distance(q IN REF Point) RETURN NUMBER
Unfortunately, it is not possible to use the REF in PL/SQL directly:
CREATE OR REPLACE TYPE BODY Point is
MEMBER FUNCTION distance(q IN REF Point) RETURN NUMBER
AS
BEGIN
RETURN q.ID - SELF.ID; --Error(5,14): PLS-00536: No navigation through REF
END;
end;
So, for testing purposes I decided to implement a very simple PL/SQL member function:
CREATE OR REPLACE TYPE BODY Point is
MEMBER FUNCTION distance(q IN REF Point) RETURN NUMBER
AS
BEGIN
RETURN -1;
END;
end;
BUT: The SQL query without VALUE is still not possible. The query
SELECT *
FROM PointTable d, PointTable e
WHERE d.distance(e) > 0
renders ORA-00904: "E": invalid identifier
Somehow the 'e' seems to be misinterpreted completely.
Illogically, the following query works fine:
SELECT *
FROM PointTable d, PointTable e
WHERE d.distance(REF(e)) > 0
The illogical thing is that, now 'E' seems to refer to a VALUE and not to REF (because we can use the REF function), whereas in Gaverill's post 'O' seems to refer to a REF (because we can use the VALUE function).
My intent is to avoid both the VALUE(o) from Gaverill's example and the REF(e) from my example, because both is not intuitive for end users...
Maybe I have to define a VIEW holding the object values... But then the end user has to use it in the FROM part.
All in all, there seems to be no elegant solution for passing objects as parameters to functions...
Regards,
André -
What is the use of passing object reference to itself ?
What is the use of passing object reference to itself ?
regards,
namancThere is an use for returning an object reference from itself, for instance:
class C {
public:
C append(C c) {
// do something interesting here, and then:
return this;
}You can "chain" calls, like this:
C c = new C();
C d = new C();
C e = new C();
c.append (d).append (e);Maybe the OP has "inverted" the common usage, or thought about a static method of a class C that requires a parameter of type C (effectively being a sort of "non-static method").
class C {
static void doAnotherThing (C c) {
c.doSomething(); //-- effectively C.doAnotherThing(c) is an "alternative syntax" for c.doSomething() -
Passing objects in f:selectItems?
I'm trying to use f:selectItems with an object parameter so when a row from a f:selectOneMenu is selected, the object is passed as a parameter to the bean. Is there a way I could pass an object instead of string without writing my own converter? I'm also trying with the Tomahawk t:selectItems, unfortunately without a visible success.
alf.redo wrote:
I suggest you to read a BalusC article: [objects-in-hselectonemenu|http://balusc.blogspot.com/2007/09/objects-in-hselectonemenu.html]
This indeed shows how to use non-standard Objects in selectItems.
samora wrote:
so far I've seen option 2 implemented in a couple of projects but I think performance wise that's not a pretty solution.Not if you implement it well. You still need the same collection of items for populating the selectItems.
samora wrote:
option 3 is always the last resort but in your case it may be the best solution; build a custom component that meets your needs....that's the beauty of JSF...extensibilityThis is not needed at all. -
Pass object to xslt stylesheet and invoke its methods
I'd like to pass an external created object to a xslt stylesheet to dynamically modify the xslt file at run time. After searching around for weeks, I'm really desperate.
I used Xalan transformer's method setParameter(name, obj) to initialize a variable in xslt file with this object. Then the object's method was invoked.
The class that I want to invoke the method:
class test{
private String testString = "abc";
public String valueOf(){
return testString;
xslt file:
<xsl:param name="myType"></xsl:param>
<<xsl:variable name="new-pop"
select="my-class:valueOf($myType)">
Any help is greatly appreciated.
Thank you.
Message was edited by:
Orbital
Message was edited by:
OrbitalThank sabre. I have looked through your link.
The problem is for all the info I knew, we can only
create a new object inside the stylesheet using new()
and then invoke this particular object's instance
method.
However, I want to pass an already created java
object into the stylesheet and then invoke its
method.
Xalan seems to not allow this. I have tried to pass
an object as the parameter of
transformer.setParameter(name, object) but it doesn't
work.
Any one know what 3rd party transformer that allow to
pass object directly into xslt?setParameter will work... in your XSL, you should have
<xsl:param name="myParam" />set the parameter in your transformer like what you had in your post...
In your XSL header, you must declare the your Java object namespace and path, such as:
xml:myJavaObject= "com.MyCompany.MyJavaObject"then in your template or anywhere that you want to use your object, you should have:
<xsl:variable name="runningMyMethod" select="myJavaObject:myJavaMethod($myParam)" />The XSL will treat $myParam as the instance object, if there is any other method parameters needed to be passed in do:
<xsl:variable name="runningMyMethod" select="myJavaObject:myJavaMethod($myParam, 'blah', 'blah')" />Good luck. -
How to pass a date parameter(from a procedure IN) to a API
Hi,
CREATE OR REPLACE package body xxal_basic_sal_increment_pkg1 as
procedure emp_pro_inc1(ERRBUF VARCHAR2,RETCODE OUT NUMBER,
p_business_group_id_enter in number,p_change_date in varchar2) is
CURSOR STAFF IS
SELECT pp.ASSIGNMENT_ID
,peo.EMPLOYEE_NUMBER employee_no
,pp.OBJECT_VERSION_NUMBER
,pp.PAY_PROPOSAL_ID
,pp.PROPOSED_SALARY_N basic_salary
,pp.PROPOSAL_REASON
,pp.change_date
,pp.BUSINESS_GROUP_ID
,pg.name
,pr.PERFORMANCE_RATING,
'' v_effective_start_date,
'' v_effective_end_date
FROM per_all_people_f peo,
per_all_assignments_f pa,
per_pay_proposals pp,
per_grades_tl pg,
per_performance_reviews_v pr
where pa.person_id = peo.PERSON_ID
and pa.ASSIGNMENT_ID = pp.ASSIGNMENT_ID
and peo.PERSON_ID=pr.PERSON_ID
and pg.GRADE_ID=pa.GRADE_ID
--and peo.EMPLOYEE_NUMBER=STAFF_VAR.employee_no
and sysdate between peo.EFFECTIVE_START_DATE and peo.EFFECTIVE_END_DATE
and sysdate between pa.EFFECTIVE_START_DATE and pa.EFFECTIVE_END_DATE
and peo.BUSINESS_GROUP_ID = p_business_group_id_enter
and pp.change_DATE = (select max(change_DATE) from per_pay_proposals temp
where ASSIGNMENT_ID =pp.ASSIGNMENT_ID);
--L_BUSINESS_GROUP_ID NUMBER:=5128;
L_ASSIGNMENT_ID NUMBER;
L_PAY_PROPOSAL_ID NUMBER;
L_OBJECT_VERSION_NUMBER NUMBER;
L_pyp_proposed_sal_warning BOOLEAN;
L_additional_comp_warning boolean;
l_person_id number;
L_COMMON boolean;
L_ELEMENT_ENTRY_ID NUMBER;
TEMP NUMBER;
L_EFFECTIVE_START_DATE DATE;
L_MULTI VARCHAR2(30):='N';
L_APPROVED VARCHAR2(30):='Y';
L_CHANGE_DATE DATE:=TO_DATE('31-JAN-2008','DD-MON-YYYY');
BEGIN
v_disp_output:='EMPLOYEE_NUMBER'||','||
'BASIC'||','||
'EFF START DATE'||','||
'EFF END DATE';
fnd_file.put_line(FND_FILE.output,v_disp_output);
FOR STAFF_VAR IN STAFF LOOP
L_ELEMENT_ENTRY_ID:=null;
begin
select assign.assignment_id,assign.effective_start_date into
l_assignment_id,l_change_date_new
from per_people_f peo,per_assignments_f assign
where peo.person_id=assign.person_id
and sysdate between peo.effective_start_date and peo.effective_end_date
and sysdate between assign.effective_start_date and assign.effective_end_date
and current_employee_flag='Y'
and primary_flag='Y'
and peo.business_group_id=l_business_group_id
and peo.employee_number=staff_var.employee_no;
L_CHANGE_DATE_new:=L_CHANGE_DATE;
--L_CHANGE_DATE_new:=STAFF_VAR.v_effective_start_date;
begin
HR_MAINTAIN_PROPOSAL_API.INSERT_SALARY_PROPOSAL
P_PAY_PROPOSAL_ID=>L_PAY_PROPOSAL_ID
,P_ASSIGNMENT_ID=>staff_var.ASSIGNMENT_ID
,P_BUSINESS_GROUP_ID=>staff_var.BUSINESS_GROUP_ID
,P_CHANGE_DATE=>L_CHANGE_DATE_new
,P_PROPOSED_SALARY_N=>STAFF_VAR.basic_salary
,P_OBJECT_VERSION_NUMBER=>STAFF_VAR.OBJECT_VERSION_NUMBER
,p_multiple_components=>L_MULTI
,p_approved=>L_APPROVED
,P_VALIDATE=>false
,p_element_entry_id =>L_ELEMENT_ENTRY_ID
,P_INV_NEXT_SAL_DATE_WARNING=>l_common
,P_PROPOSED_SALARY_WARNING=>L_COMMON
,P_APPROVED_WARNING=>L_COMMON
,P_PAYROLL_WARNING=>L_COMMON
in the above code the variable L_CHANGE_DATE DATE is hard coded .
but we need to supply this variable value as dynamic, means (p_change date--procedure IN Parameter )
i tried like below ,
CREATE OR REPLACE package body xxal_basic_sal_increment_pkg1 as
procedure emp_pro_inc1(ERRBUF VARCHAR2,RETCODE OUT NUMBER,
p_business_group_id_enter in number,p_change_date in varchar2) is
CURSOR STAFF IS
SELECT pp.ASSIGNMENT_ID
,peo.EMPLOYEE_NUMBER employee_no
,pp.OBJECT_VERSION_NUMBER
,pp.PAY_PROPOSAL_ID
,pp.PROPOSED_SALARY_N basic_salary
,pp.PROPOSAL_REASON
,pp.change_date
,pp.BUSINESS_GROUP_ID
,pg.name
,pr.PERFORMANCE_RATING,
'' v_effective_start_date,
'' v_effective_end_date
FROM per_all_people_f peo,
per_all_assignments_f pa,
per_pay_proposals pp,
per_grades_tl pg,
per_performance_reviews_v pr
where pa.person_id = peo.PERSON_ID
and pa.ASSIGNMENT_ID = pp.ASSIGNMENT_ID
and peo.PERSON_ID=pr.PERSON_ID
and pg.GRADE_ID=pa.GRADE_ID
--and peo.EMPLOYEE_NUMBER=STAFF_VAR.employee_no
and sysdate between peo.EFFECTIVE_START_DATE and peo.EFFECTIVE_END_DATE
and sysdate between pa.EFFECTIVE_START_DATE and pa.EFFECTIVE_END_DATE
and peo.BUSINESS_GROUP_ID = p_business_group_id_enter
and pp.change_DATE = (select max(change_DATE) from per_pay_proposals temp
where ASSIGNMENT_ID =pp.ASSIGNMENT_ID);
--L_BUSINESS_GROUP_ID NUMBER:=5128;
L_ASSIGNMENT_ID NUMBER;
L_PAY_PROPOSAL_ID NUMBER;
L_OBJECT_VERSION_NUMBER NUMBER;
L_pyp_proposed_sal_warning BOOLEAN;
L_additional_comp_warning boolean;
l_person_id number;
L_COMMON boolean;
L_ELEMENT_ENTRY_ID NUMBER;
TEMP NUMBER;
L_EFFECTIVE_START_DATE DATE;
L_MULTI VARCHAR2(30):='N';
L_APPROVED VARCHAR2(30):='Y';
L_CHANGE_DATE DATE:=TO_DATE(p_change_date,'DD-MON-YYYY');
BEGIN
v_disp_output:='EMPLOYEE_NUMBER'||','||
'BASIC'||','||
'EFF START DATE'||','||
'EFF END DATE';
fnd_file.put_line(FND_FILE.output,v_disp_output);
FOR STAFF_VAR IN STAFF LOOP
L_ELEMENT_ENTRY_ID:=null;
begin
select assign.assignment_id,assign.effective_start_date into
l_assignment_id,l_change_date_new
from per_people_f peo,per_assignments_f assign
where peo.person_id=assign.person_id
and sysdate between peo.effective_start_date and peo.effective_end_date
and sysdate between assign.effective_start_date and assign.effective_end_date
and current_employee_flag='Y'
and primary_flag='Y'
and peo.business_group_id=l_business_group_id
and peo.employee_number=staff_var.employee_no;
L_CHANGE_DATE_new:=L_CHANGE_DATE;
--L_CHANGE_DATE_new:=STAFF_VAR.v_effective_start_date;
begin
HR_MAINTAIN_PROPOSAL_API.INSERT_SALARY_PROPOSAL
P_PAY_PROPOSAL_ID=>L_PAY_PROPOSAL_ID
,P_ASSIGNMENT_ID=>staff_var.ASSIGNMENT_ID
,P_BUSINESS_GROUP_ID=>staff_var.BUSINESS_GROUP_ID
,P_CHANGE_DATE=>L_CHANGE_DATE_new
,P_PROPOSED_SALARY_N=>STAFF_VAR.basic_salary
,P_OBJECT_VERSION_NUMBER=>STAFF_VAR.OBJECT_VERSION_NUMBER
,p_multiple_components=>L_MULTI
,p_approved=>L_APPROVED
,P_VALIDATE=>false
,p_element_entry_id =>L_ELEMENT_ENTRY_ID
,P_INV_NEXT_SAL_DATE_WARNING=>l_common
,P_PROPOSED_SALARY_WARNING=>L_COMMON
,P_APPROVED_WARNING=>L_COMMON
,P_PAYROLL_WARNING=>L_COMMON
but we are getting the error Cause: FDPSTP failed due to ORA-01839: date not valid for month specified
ORA-06512: at "APPS.XXAL_BASIC_SAL_INCREMENT_PKG1", line 45
ORA-06512: at line 1
we tried the solution available in the metalink still its giving error ..
pl help us to solve this issue ...
how should we pass the date parameter while we run the concurrent program(we used date value set).
also we tried with some other value set also ..
Regards,
kumardear,
I have the following code to create proposal, but the API create salary proposal for all record s and does not create entry for all records it just creates for the first record
any advice
the code ....
/* Formatted on 2007/08/29 16:20 (Formatter Plus v4.8.8) */
----------------------- P R O P O S A L -------------------------
DECLARE
l_rows_processed NUMBER := 0;
l_commit_point NUMBER := 500;
l_business_group_id NUMBER
:= fnd_profile.VALUE ('PER_BUSINESS_GROUP_ID');
l_proposal_salry NUMBER;
l_approved CHAR (1);
l_rowid VARCHAR2 (30);
l_errmessage VARCHAR2 (400);
l_entry_indecator NUMBER;
l_assignment_id NUMBER;
p_ctr_object_version_number NUMBER;
-- Out Parameters --
l_element_entry_id NUMBER;
p_element_entry_id NUMBER;
l_ctr_object_version_number NUMBER;
l_pay_proposal_id NUMBER;
l_inv_next_sal_date_warning BOOLEAN;
l_proposed_salary_warning BOOLEAN;
l_approved_warning BOOLEAN;
l_payroll_warning BOOLEAN;
CURSOR crs_dc_mn
IS
SELECT xdp.ROWID, xdp.assignment_id, xdp.change_date,
xdp.proposal_reason, xdp.proposed_salary,
xdp.assignment_number, xdp.employee_number, xdp.person_id,
xdp.new_asg_id
FROM apps.xx_dc_proposal xdp
WHERE xdp.assignment_id <> -1
AND xdp.processed = 'N'
AND xdp.change_date =
(SELECT MIN (xdc.change_date)
FROM xx_dc_proposal xdc
WHERE xdc.assignment_id = xdp.assignment_id
AND xdc.processed = 'N')
ORDER BY assignment_id, change_date ASC;
pro_rcrd crs_dc_mn%ROWTYPE;
CURSOR crs_dc_proposal1 (p_asg_id IN NUMBER)
IS
SELECT xdp.ROWID, xdp.assignment_id, xdp.change_date,
xdp.proposal_reason, xdp.proposed_salary,
xdp.assignment_number, xdp.employee_number, xdp.person_id,
xdp.new_asg_id
FROM apps.xx_dc_proposal xdp
WHERE xdp.assignment_id <> -1
AND xdp.processed = 'N'
AND xdp.assignment_id = p_asg_id
ORDER BY assignment_id, change_date ASC;
BEGIN
OPEN crs_dc_mn;
FETCH crs_dc_mn
INTO pro_rcrd;
LOOP
BEGIN
hr_maintain_proposal_api.insert_salary_proposal
(p_pay_proposal_id => l_pay_proposal_id,
p_assignment_id => pro_rcrd.assignment_id,
p_business_group_id => l_business_group_id,
p_change_date => pro_rcrd.change_date,
p_comments => NULL,
p_next_sal_review_date => NULL,
p_proposal_reason => NULL,
p_proposed_salary_n => pro_rcrd.proposed_salary,
p_forced_ranking => NULL,
p_performance_review_id => NULL,
p_attribute_category => NULL,
p_attribute1 => NULL,
p_attribute2 => NULL,
p_attribute3 => NULL,
p_attribute4 => NULL,
p_attribute5 => NULL,
p_attribute6 => NULL,
p_attribute7 => NULL,
p_attribute8 => NULL,
p_attribute9 => NULL,
p_attribute10 => NULL,
p_attribute11 => NULL,
p_attribute12 => NULL,
p_attribute13 => NULL,
p_attribute14 => NULL,
p_attribute15 => NULL,
p_attribute16 => NULL,
p_attribute17 => NULL,
p_attribute18 => NULL,
p_attribute19 => NULL,
p_attribute20 => NULL,
p_object_version_number => l_ctr_object_version_number,
p_multiple_components => 'N', -- 918219
p_approved => 'Y',
p_validate => FALSE,
p_element_entry_id => l_element_entry_id,
p_inv_next_sal_date_warning => l_inv_next_sal_date_warning,
p_proposed_salary_warning => l_proposed_salary_warning,
p_approved_warning => l_approved_warning,
p_payroll_warning => l_payroll_warning
UPDATE xx_dc_proposal
SET processed = 'Y'
WHERE ROWID = pro_rcrd.ROWID;
l_rows_processed := l_rows_processed + 1;
IF l_rows_processed = l_commit_point
THEN
COMMIT;
l_rows_processed := 0;
END IF;
EXCEPTION
WHEN OTHERS
THEN
l_errmessage := SQLERRM;
UPDATE xx_dc_proposal
SET err_message = l_errmessage
WHERE ROWID = pro_rcrd.ROWID;
END;
END LOOP;
CLOSE crs_dc_mn;
COMMIT;
END;
.............................. -
How to pass a date parameter from report builder query designer to oracle database
i'm using report builder 3.0 connected to oracle database. i'm trying to pass a date parameter in the query with no success, i don't
know the exact syntax. I've tried :
SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date('01/01/2014','mm/dd/yyyy')
it worked perfectly.
However if i try to put a date parameter "From" instead of 01/01/2014 it will not work, a Define Query Parameter popup window appear and error occurred after i fill
the values (usually i shouldnt get this popup i should enter the value when i run the report)
SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date(:From,'mm/dd/yyyy')
appreciate your assistanceHi Gorgo,
According to your description, you have problem when in passing a parameter for running a Oracle Query. Right?
Based on my knowledge, it use "&" as synax for parameter in Oracle, like we use "@" in SQL Server. In this scenario, maybe you can try '01/01/2014' when inputing in "From". We are not sure if there's any limitation for To_Date()
function. For your self-testing, you can try the query in sqlplus/sql delveloper. Since your issue is related to Oracle query, we suggest you post this thread onto Oracle forum.
Best Regards,
Simon Hou -
Passing objects by reference in PL/SQL
Hi,
I have come across an unexpected problem using object types in PL/SQL that is causing me some grief. I'm from a Java background and am relatively new to Oracle Objects but what I'm trying to do is fairly trivial, I think. The code below illustrates the problem.
--- cut here ---
CREATE OR REPLACE TYPE test_obj_t AS OBJECT
num INTEGER,
CONSTRUCTOR FUNCTION test_obj_t RETURN SELF AS RESULT
CREATE OR REPLACE TYPE BODY test_obj_t IS
CONSTRUCTOR FUNCTION test_obj_t RETURN SELF AS RESULT IS
BEGIN
num := 0;
RETURN;
END;
END;
CREATE OR REPLACE PACKAGE test_obj_ref AS
PROCEDURE init(o IN test_obj_t);
PROCEDURE inc;
FUNCTION get_num RETURN INTEGER;
END;
CREATE OR REPLACE PACKAGE BODY test_obj_ref IS
obj test_obj_t;
PROCEDURE init(o IN test_obj_t) IS
BEGIN
obj := o;
END;
PROCEDURE inc IS
BEGIN
obj.num := obj.num + 1;
END;
FUNCTION get_num RETURN INTEGER IS
BEGIN
RETURN obj.num;
END;
END;
--- cut here ---
The object type test_obj_t holds a integer and the test_obj_ref package holds a 'reference' to an instance of the object.
To test the above code I run this PL/SQL block:
declare
obj test_obj_t;
begin
obj := test_obj_t;
test_obj_ref.init(obj);
dbms_output.put_line('obj.num='||obj.num);
dbms_output.put_line('test_obj_ref.get_num='||test_obj_ref.get_num);
test_obj_ref.inc;
dbms_output.put_line('obj.num='||obj.num);
dbms_output.put_line('test_obj_ref.get_num='||test_obj_ref.get_num);
test_obj_ref.inc;
dbms_output.put_line('obj.num='||obj.num);
dbms_output.put_line('test_obj_ref.get_num='||test_obj_ref.get_num);
end;
giving the output:
obj.num=0
test_obj_ref.get_num=0
obj.num=0
test_obj_ref.get_num=1
obj.num=0
test_obj_ref.get_num=2
It appears that the object held by the test_obj_ref package is being incremented as expected, but I would have expected the object declared in the PL/SQL block to be pointing to the same object and so should report the same incremented values.
I suspect that the object is copied in the call to test_obj_ref.init() so I end up with two object instances, one that is held by the test_obj_ref package and one in the anonymous block. Although, I thought that all IN parameters in PL/SQL are passed by reference and not copied!
Am I right?
Is passing objects by reference possible in PL/SQL, if so how?
I'm using Oracle 10.2.0.3.
Cheers,
Andy.the object being passed to the test_obj_ref.init+ procedure is passed by reference; however, when you assign it to your package variable obj it is being copied to a new instance. you can pass object instances as parameters to procedures using the +IN OUT [NOCOPY]+ *calling mode, in which case modifications to the attributes of the passed object will be reflected in the calling scope's instance variable.
oracle's only other notion of an object reference is the +"REF <object-type>"+ datatype, which holds a reference to an object instance stored in an object table or constructed by an object view.
hope this helps...
gerard
Maybe you are looking for
-
4K Resolution in Windows 7/8: Bug in all Adobe CC Software
I just read an article in the renowned german IT magazin c't 2014-10 p 122 about 4K displays and problems with scaling of some software. The complete Adobe CC software is unusable under Windows 7/8 because their interface elements like buttons etc. d
-
Macbook launching and running slowly and server error on start up.
Please help! My macbook pro has been acting up lately (not exclusively since installing Mavericks, but I don't think that has helped either). The macbook has been taking longer than usual to start up initially (boot) and to start each program (with n
-
Front facing camera video flashes dark during FaceTime
Happens frequently. Does not flash all the way to black, but it gets pretty dark. Flashes between normal lighting and very dark lighting two times a second. During FaceTime call when this happens, pressing home key to return to home screen, then the
-
My Lightroom i s closed ???
Hi . I bought an fullversion of Lightroom in january 2014 . In april i bought a monthly photoshop cc with Lightroom as well ... After a couple of months i found out i didnt use photoshop that mutch so i canceld the monthly paying of photoshop cc and
-
I recently update my iphone and now is not allowing me to access my contacts, emails etc. When I try to switch it on it has an itunes symbol on the front with the usb plug and an arrow. What do I do to get my contacts etc back and make phone calls?