BEEP 10 g call a PL SQL function
Hello..It's really breaking the feet... googled a lot but always back to square start.
... Well guys want to help me...
I need to call a function from PL SQL BI editor passing 3 parameters.
that means this feature is... it feeds a table.
And the editor of BI report is read from the populated table...
Kindly help me out here... How can I start...
PL SQL function is a stand-alone... It is not under any procedure/package...
If you could give me some small excerpts of what to write in the style of data... that would be great... and Yes, indeed, this is the old version of the BEEP... 30%
>
Total Questions: 11 (10 open)
>
Why can't anyone help you?
>
He throws me an error
Variable binding does not exist
any work arounds guy?
>
so
and in z_report_sys_op_test_pkg.z_report_sys_op_test get the necessary value
>
substr (: Store, 0, InStr(:Store,'-') - 1).
Tags: Business Intelligence
Similar Questions
-
How to call the pl/sql function in application of the ADF
Hi Experts,
I need to call the pl/sql function in application of ADF, I have logic written in my AM
Method:
public String reportStoredProcedure (locationID customerID, number,
String tailNum) {}
CallableStatement st = null;
String v_sanctioned = null;
If (locationID! = null & & customerID! = null & & tailNum! = null) {}
System.out.println (locationID + "" + customerID + "" + tailNum);
Tail string = "TAIL";
String result = "N";
try {}
String stmt =
"start XXWFS_SANCTIONS_PKG. CHECK_SANCTION(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11); end; « ;
St = getDBTransaction () .createCallableStatement (stmt, 0);
st.setNull (1, Types.VARCHAR);
st.setNull (2, Types.NUMERIC);
st.setObject (3, customerID);
st.setNull (4, Types.NUMERIC);
st.setNull (5, Types.NUMERIC);
st.setObject (6, locationID);
st.setNull (7, Types.NUMERIC);
st.setNull (8, Types.NUMERIC);
st.setObject (9, tail);
st.setObject (10, tailNum);
st.setObject (11, result);
St.Execute ();
System.out.println ("v_sanctioned in AM:" + v_sanctioned);
} catch (Exception e) {}
e.printStackTrace ();
return "N";
} {Finally
If (st! = null)
try {}
St.Close ();
} catch (Exception e1) {}
E1. PrintStackTrace();
return "N";
}
}
} else {}
System.out.println ("v_sanctioned is null");
v_sanctioned = "N";
}
Return v_sanctioned;
}
Error:
java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in the call to 'CHECK_SANCTION '.
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:191)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:950)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1224)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3858)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:99)
at model.view.CardAMImpl.reportStoredProcedure(CardAMImpl.java:182)
at com.emboss.bean.ReadyToPrint.invokeVSanctioned(ReadyToPrint.java:485)
at com.emboss.bean.ReadyToPrint.PrintingCards(ReadyToPrint.java:434)
at com.emboss.bean.ReadyToPrint.printCards(ReadyToPrint.java:204)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1259)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:97)
to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:90)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:94)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:91)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:94)
at java.security.AccessController.doPrivileged (Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.doIt (WebAppServletContext.java:3684)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3650)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Can someone help me how to call...Call it in function, not as a procedure you do
try { String stmt = "begin :1 := XXWFS_SANCTIONS_PKG.CHECK_SANCTION(:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12); end;"; st = getDBTransaction().createCallableStatement(stmt, 0); st.registerOutParameter(1, Types.VARCHAR); st.setNull(2, Types.VARCHAR); st.setNull(3, Types.NUMERIC); st.setObject(4, customerID); st.setNull(5, Types.NUMERIC); st.setNull(6, Types.NUMERIC); st.setObject(7, locationID); st.setNull(8, Types.NUMERIC); st.setNull(9, Types.NUMERIC); st.setObject(10, tail); st.setObject(11, tailNum); st.setObject(12, result); st.execute();
= st.getString(1); -
How to call the pl/sql function of the ofa
Dear friends,
I am trying to call a function of OPS page .but iam getting error as
java.sql.SQLException: ORA-01861: literal does not match the format string
ORA-06512: at line 1
It is my function, callable statement
FUNCTION CAR_LOAN_VALIDATION (P_PERSON_ID IN NUMBER
P_DEDUCTION_START_DATE AS
P_DEDUCTION_END_DATE AS
P_LOAN_VALUE NUMBER
)
RETURN VARCHAR2
IS
l_message VARCHAR2 (100);
l_contract_type VARCHAR2 (50);
l_loan_eligible_date DATE;
l_grade VARCHAR2 (15);
l_old_loan_end_date DATE;
l_max_loan_end_date DATE;
l_remaining_amount NUMBER;
l_eligible_amt NUMBER;
BEGIN
BEGIN
SELECT - papf.person_id,.
(SELECT the sense
OF hr_lookups
WHERE lookup_type = 'ADTC_CONTRACT_TYPE. '
AND lookup_code = attribut3) contract_type;
ADD_MONTHS (papf.original_date_of_hire, 11) loan_eligible_date,.
DECODE (paaf.ass_attribute2,
'President', '' President. ''
SUBSTR (ass_attribute2, INSTR (ass_attribute2, '.', 1, 1) + 1,)
3)
) grade.
(SELECT nvl (MAX (deduction_end_date), null)
OF xxadtc_car_loan_request
WHERE person_id = p_person_id) old_loan_end_date;
TO_DATE (ADD_MONTHS (p_deduction_start_date, 47)) max_loan_end_date
-to_date (ADD_MONTHS (sysdate, 47)) max_loan_end_date
IN l_contract_type
l_loan_eligible_date
l_grade
l_old_loan_end_date
l_max_loan_end_date
OF per_all_people_f women's wear, per_all_assignments_f ADP
WHERE SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
AND papf.business_group_id = 81
AND papf.person_id = paaf.person_id
AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND papf.person_id = P_PERSON_ID;
EXCEPTION
WHILE others THEN
DBMS_OUTPUT. Put_line ('error');
END;
-to obtain the amount of the previous car loan-
BEGIN
SELECT to_number (prrv.result_value)
IN l_remaining_amount
OF per_all_people_f women's wear.
per_all_assignments_f ADP,
pay_assignment_actions CIP,
pay_run_results prr,
prrv pay_run_result_values,
petf pay_element_types_f,
pay_input_values_f pivf,
pay_element_classifications pec,
pay_payroll_actions App,
TPP per_time_periods
WHERE SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
AND papf.person_id = paaf.person_id
AND papf.business_group_id = 81
AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND paaf.assignment_id = pac.assignment_id
AND pac.assignment_action_id = prr.assignment_action_id
AND prr.run_result_id = prrv.run_result_id
AND prr.element_type_id = petf.element_type_id
AND SYSDATE BETWEEN petf.effective_start_date AND petf.effective_end_date
AND prrv.input_value_id = pivf.input_value_id
AND SYSDATE BETWEEN pivf.effective_start_date AND pivf.effective_end_date
AND pivf.NAME = 'balance '.
AND petf.classification_id = pec.classification_id
AND pac.payroll_action_id = ppa.payroll_action_id
AND ppa.time_period_id = ptp.time_period_id
AND TO_CHAR (ptp.pay_advice_date, 'Mon-YYYY') =
To_char (SYSDATE, "Mon-YYYY")
AND petf.element_name = "Fashions ready Ahlami"
- and employee_number = '10185'
AND papf.person_id = p_person_id;
EXCEPTION
WHEN no_data_found THEN
-DBMS_OUTPUT. Put_line (' ERROR: no data!');
l_remaining_amount: = 0;
WHILE others THEN
DBMS_OUTPUT. Put_line ('error');
END;
Select GET_CAR_LOAN_ELIGI_AMT (P_PERSON_ID)
in l_eligible_amt
Double;
IF L_contract_type NOT IN ("Permanent") THEN
l_message: = 'contract Type is invalid. "
END IF;
IF l_loan_eligible_date < SYSDATE THEN
l_message: = 'Date to join is less then a year. "
END IF;
IF l_grade IN ('US', '00', 'AUS', ') THEN
"l_message: = ' your are not eligible Grade."
END IF;
IF l_old_loan_end_date < SYSDATE THEN
l_message: = 'previous loan period is not completed. "
END IF;
IF l_max_loan_end_date > P_DEDUCTION_END_DATE THEN
l_message: = 'Maxinum number of monthly payment for 48 months;
END IF;
IF l_remaining_amount > 0 THEN
l_message: = "amount of the previous car loan is waiting until";
END IF;
IF l_eligible_amt < p_loan_value THEN
l_message: = 'Please check eligible amount ";
END IF;
RETURN nvl(l_message,'S');
EXCEPTION
WHEN NO_DATA_FOUND
THEN
RETURN "error";
END CAR_LOAN_VALIDATION;
END XX_CAR_LOAN_REQUEST_PKG;
CODE THAT CAN BE CALLED BY CODE - CO STATEMENT
{if (PageContext.GetParameter ("Submit")! = null)}
OAViewObject vo2 = (OAViewObject) am.findViewObject ("XxadtcCarLoanRequestEOVO1");
{if(VO1!=null)}
VO1. GetCurrentRow () .setAttribute ("LoanStatus", "pending approval");
int xxpersonId = pageContext.getEmployeeId ();
String xxDeductionStartDate = vo2.getCurrentRow ().getAttribute("DeductionStartDate").toString ();//pageContext.getParameter("DeductionStartDate").toString();
SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy/mm/dd");
ConvertedDate1 date = dateFormat1.parse ("xxDeductionStartDate");
String xxDeductionEndDate = vo2.getCurrentRow ().getAttribute("DeductionEndDate").toString ();//pageContext.getParameter("DeductionEndDate").toString();
SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy/mm/dd");
ConvertedDate2 date = dateFormat2.parse ("xxDeductionEndDate");
String xxLoanValue = vo2.getCurrentRow ().getAttribute("LoanValue").toString ();//pageContext.getParameter("LoanValue").toString();
int iLoanValue = Integer.parseInt (xxLoanValue);
System.out.println ("loop submit input");
System.out.println ("xxpersonId id is:" + xxpersonId);
System.out.println ("xxDeductionStartDate id is:" + xxDeductionStartDate);
System.out.println ("xxDeductionEndDate id is:" + xxDeductionEndDate);
System.out.println ("xxLoanValue id is:" + xxLoanValue);
TXN OADBTransaction = am.getOADBTransaction ();
String sql = "START: 1: = XXADTC_CAR_LOAN_REQUEST_PKG." CAR_LOAN_VALIDATION(:2,:3,:4,:5); END; « ;
CallableStatement cs = txn.createCallableStatement(sql,1);
String outputval = null; / / int outputval = 0;
try {}
System.out.println ("entry into loop try funtion callable validation");
cs.setInt(2,xxpersonId);
System.out.println ("cs setInt (2, xxpersonId);") is executed");
cs.setString(3,xxDeductionStartDate);
System.out.println ("cs.setString (3, xxDeductionStartDate is executed);'");
cs.setString(4,xxDeductionEndDate);
System.out.println ("cs.setString (4, xxDeductionEndDate is executed);'");
cs.setDate(3,xxDeductionStartDate);
cs.setDate(4,xxDeductionEndDate);
cs.setInt(5,iLoanValue);
cs.registerOutParameter(1,Types.VARCHAR); / / cs.registerOutParameter(1,Types.NUMERIC);
DSI Execute();
outputval = cs.getString (1); / / txn.commit ();
System.out.println (outputval);
TXN.Commit ();
If (outputval. Equals ("S"))
{
am.invokeMethod ("apply");
}
on the other
{
throw new OAException ("is:" + outputval, OAException.INFORMATION name of the Organization);
}
TXN.Commit ();
}
{} catch (Exception sqle)
try {}
DSI Close();
}
catch (System.Exception e)
{
throw OAException.wrapperException (e);
}
throw OAException.wrapperException (sqle);
}
}
Please help where is the error.
Help, please
Let me know for any clarification.
Thank you
Aravinda.
Ford Hi,
See below the code.
In the controller
java.sql.Date DeductionSDate; declare the variable
In LICS
String xxDeductionStartDate = vo2.getCurrentRow () .getAttribute ("DeductionStartDate");
TXN OADBTransaction = am.getOADBTransaction ();
if(xxDeductionStartDate!=null)
{
java.sql.Date startDate = txn.getOANLSServices () .stringToDate (xxDeductionStartDate);
DeductionSDate = startDate;
}
Assign to this cs.setDate(3,DeductionSDate);
Thank you
Dilip
-
error by calling the pl/sql function in column target
Hi guys,.
I get this error when my function in ODI:
Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: "mySchema". "" GET_ODI_DEFAULT_VALUE (1) ": ongeldige ID-> 1 is a parameter
While in sql developer, I get a good result with the following query:
Select mySchema.get_odi_default_value (1) double;
In my target for the primary key table, I call a sequence of mySchema, and it works fine.
I tried the synxtax following in my target column mapping:
-< % = odiRef.getObjectName ("" "," GET_ODI_DEFAULT_VALUE (1) "", "D") % >
-< % = odiRef.getObjectName ("L", "GET_ODI_DEFAULT_VALUE", "D") 1% >
Thanks for you adviceYou use in the interface? If that's when you come to write the name of the function and make its contribution. It should return the value. As
GET_ODI_DEFAULT_VALUE (1) -
How to call a pl/sql function ofa
Hello
When I train call Comptrollership, the error as "bind variable does not exist. Function has 2 input parameters, and it returns a Boolean value. How to solve this error? Can someone help me please... I'm new to OFA.
TXN OADBTransaction = am.getOADBTransaction ();
CallableStatement cs = CreateCallableStatement ("Begin: 1: = resp_license_func (?)") End; ", 2) ;
String outputval = null;
try {}
cs.setString(1,appl_name);
cs.setString(2,user_name);
cs.registerOutParameter(1,Types.VARCHAR);
CS. Execute();
outputval = cs.getString (1);
TXN.Commit ();
}
catch (Exception e) {}
throw new OAException (e.getMessage ());
}
Thank you
NGOHello
You need to change the lines below:
String outputval = null; for int outputval = 0;
cs.registerOutParameter(1,Types.VARCHAR); to cs.registerOutParameter(1,Types.NUMERIC);
outputval = cs.getString (1); to outputval = cs.getInt (1);
Kind regards.
-
Calling a PL/SQL of BPEL function throws the fault.
Hi, I'm calling a PL/SQL function that inserts data into a table from a BPEL via the DB adapter. The process, when I test it, get an error runtime as follows:
* Exception occurred when the link was invoked. Exception occurred during invocation of the JCA binding: "JCA binding run operations reference 'EmpRegister' have to: connection problem component binding JCA.". JCA Binding component is unable to create an outgoing connection of JCA (CCI). AddEmployee:EmpRegister [EmpRegister_ptt::EmpRegister (InputParameters, OutputParameters)]: The JCA Binding component could not establish an outbound connection of JCA CCI due to the following problem: BINDING. Error of JCA - 12510 JCA adapter localization resources. Cannot find the adapter in JCA resources via the element of the binding .jca file <-factory connections / > The JCA Binding component is unable to startup of the resource adapter that is specified in the <-factory connections / > element: location = ' EI/DB/DBConn_215. The reason is most likely that 1) the resource adapter RAR file has not been deployed successfully to the application server WebLogic or 2) the element '< jndi name >' in weblogic - ra.xml has not been set to eis/DB/DBConn_215. In the latter case, you need to add a new factory of connections from WebLogic JCA (deploy a RAR). If please fix this and then restart the application server". The called JCA adapter threw an exception of resource. Please examine the error message above carefully to determine a resolution.*
In addition, the error description was that follows a s:
* Error JCA adapter localization resources. Cannot find the adapter in JCA resources via the element of the binding .jca file <-factory connections / > The JCA Binding component is unable to startup of the resource adapter that is specified in the <-factory connections / > element: location = ' EI/DB/DBConn_215. The reason is most likely that 1) the resource adapter RAR file has not been deployed successfully to the application server WebLogic or 2) the element '< jndi name >' in weblogic - ra.xml has not been set to eis/DB/DBConn_215. In the latter case, you need to add a new factory of connections from WebLogic JCA (deploy a RAR). Please fix this and then restart the messagerie.* Application Server
I know, it looks like a mistake to JCA adapter, but when I do a synchronization of the table DB to DB with this factory of connections, no problems occur. Is there any procedure I should follow when mapping the input with db schema data?you update the JNDI name that you used ' ÉI/DB/DBConn_215' in weblogic - RA.xml file DbAdapter.rar @ weblogic_home\Oracle_SOA1\soa\connectors with the correct as data source
xADataSourceName
JDBC/scottdb (your Datasouce jndi name)
and you need to redeploy this .rar file updated.
-
call ondemand pl/sql to a JavaScript function
try calling a pl/sql function to a javascript script to return data.
All I get is a bunch of text HTML code in my cell in a table
can we see what's wrong with the code javascript and pl/sql below.
I'm trying to update a cell in a tabluar form the basis of the value of another dropdown in the same line
(similar to this example http://htmldb.oracle.com/pls/otn/f?p=31517:160
Thanks to Denis Kubicek
--------------------------------------------------------------------------------------------------------------
JavaScript in the footer
--------------------------------------------------------------------------------------------------------------
< script type = "text/javascript" >
function f_increase_salary (p_this, p_rownum, p_sal)
{
var editable_item_to_set = "f04_" + p_rownum
Sal var = value of $x (p_this)
var Man_Code = Number (sal)
get var = new htmldb_Get (null, & APP_ID, 'APPLICATION_PROCESS = GET_MANAGER', 0);
Get.Add ('Man_Code', html_GetElement('Man_Code').value);
gReturn = get.get ();
If (gReturn)
{$x (editable_item_to_set) .value = gReturn; }
on the other
{$x (editable_item_to_set) .value = ";} }
get = null;
}
< /script >
--------------------------------------------------------------------------------------------------------------
function of PL/SQL returning data
--------------------------------------------------------------------------------------------------------------
DECLARE
ANSWER1 VARCHAR2 (200);
BEGIN
Select Manager on ANSWER1 where personal EMP =: Man_Code
HTP. PRN (ANSWER1);
END;
------------------------------------------
Thank you
Frank
Published by: Borg species 5618 on October 2, 2009 15:17This example is more recent and it finally covers your condition a lot better:
http://Apex.Oracle.com/pls/OTN/f?p=31517:239
Denes Kubicek
------------------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
------------------------------------------------------------------------------ -
Use Dynamic Actions with pl/sql, calling a javascript alert function
Hello
I use Apex 4.0.1.00.03 with IE7.
The problem I have is:
I am converting an Oracle Forms application that has a lot of logic in it. In the application forms, it is a pl/sql function, based on a If/else condition call a popup alert box, which displays a warning message. He called pl/sql functions that return raising to the IF statement.
Example of pl/sql code:
If check_records() > 0 Then
message to the alert box
ElsIf TypeA_record then
message to the alert box
On the other
message to the alert box
End If;
I need to replicate this functionality to the Apex 4. I tried to create dynamic Action on a page element, using a pl/sql function, however, when I call the popup javascript, this code not popup an alert box. I need the pl/sql to be run when the element of the page changes, not when the page is sent.
The code I used to test the pl/sql code, which does not work in dynamic Actions > pl/sql is:
Begin
HTP.p ("< script type =" text/javascript"> '");
HTP.p ("alert ("today runs javascript code!");"
);
HTP.p ("< /script >");
End;
I need to create a pl/sql function that can do alert areas based on an IF condition.
Could someone point me in the right direction? Using dynamic shares the best way forward? I need to trigger on a page element, change the value.Works fine now.
In the javascript code, I changed:get.addParam ('x 01', $v ('P105_PREP_TYPE'));
by
get.addParam ('x 01', $v ('P1_PREP_TYPE'));
P1_PREP_TYPE is the correct name of the element.
Now when I choose the OTHER, 1 message.Concerning
-
call the XMLQuery pl sql function
Hi all.
Is anyone know how to call the function sql pl by XMLQuery query?
For example:
I pl sql function "test()".
And the desire to write this way:
Select XMLQuery (' let $t = test()' returning content);
How to change to work?
Thanks for all the answers.
Kind regards
Anton.following should give you an idea:
SQL> select xmlquery(('if (2*2 = ' || power(2,2) || ') then 1 else ()') returning content) x from dual X ----- 1 1 row selected.
-
Calling a SQL function to send all page
In an APEX application, is it possible to call a SQL function so that the application be submitted instead of 'action SQL INSERT'. This function takes 2 parameters user entering the page of the application.
Send page has essentially two text fields and a "submit" button
Version and Patch Info
The SQl function has 2 parameters like this, start_new_env (oracleversion IN VARCHAR2, opatchinfo IN CLOB)
Any help will be much appreciated.
Thank you
Published by: Rajesh on November 17, 2009 08:49Please mark it as answered and mark it as correct...
Thank you -
Weird. There was text in the box when I pressed send...
I'll call a PL/SQL javascript function. I've done this process several times, but for some reason, it does not work with this application. Our company just the Apex 3.2.0.00.27 version, so I don't know if it's related or not, since this is the first time I am trying this feature in the new version. This is a test function, I'm running, but full function, I am running for my application does the same thing.
Here's the javascript code:
function submitForm() {}
get var = new htmldb_Get (null, $x ('pFlowId') .value, 'APPLICATION PROCESS = PROC_TEST', 0);
Alert (Get.get ());
return;
}
PL/SQL is located in a level with an option on request application process.
DECLARE varTest varchar (12): = NULL;
BEGIN
SELECT TO_CHAR(SYSDATE,'YYYY-MM-DD') IN the varTest FROM DUAL;
HTP.p (varTest);
END;
The javascript is called from a HTML button:
< input type = "button" id = "button1" value = "Submit Request" tabIndex = "25" onclick = "submitForm (); "/ >
I used alerts to check the JavaScript starts, runs and completes successfully. I've also intentionally added errors for the PL/SQL to try to get the reactions of the application. The alert function returns only the message "process not found.
I hope that the eyes of certain fees can see what I've been unable to.
Thank you
Chrisget var = new htmldb_Get (null, $x ('pFlowId') .value, 'APPLICATION PROCESS = PROC_TEST', 0);
I think that there is a typing error - there should be underscore between APPLICATION and PROCESS. But if your code contains not this error then make sure that the name of the process is PROC_TEST and not proc_test. the name is case-sensitive.
Scott
-
Hi all
I would like to know if there is in any case to call a user defined function in a SQL statement in an anonymous PL/SQL block without having created this function to the database.
For example:
I have a pl/sql block:
DECLARE
BEGIN
UPDATE application SET map_No = nts_map_no (parm1, parm2, parm3) WHERE...
END;
I tried to declare the function within the declare block section as in:
DECLARE
FUNCTION nts_map_no
:
:
End nts_map_no;
BEGIN
UPDATE application SET map_No = nts_map_no (parm1, parm2, parm3) WHERE...
END;
But Oracle would not allow me to use it in an Update statement.
Thank you.Denis
There are a few things you can do.
Simpler, faster: define a function stored (either packed or not) separately from your anonymous block - as BlusShadow said
Easy, slow: definition of the function in the anonymous block, read the data that you want to update in the memory of PL/SQL, update of your function:
declare function nts_map (...) begin for r in ( select rowid, pk, map, parm1, parm2. ... from target where ... ) loop update current of r set map = nts_map_no(parm1, parm2, parm3); -- or update target set map= ... WHERE target.rowid = r.rowid end loop;
This treatment of line will be much slower than a single UPDATE sets. Of course the use of operations BLOCK helps - but still slow.
Complex: If you really need to define the function in the same anonymous block, use EXECUTE IMMEDIATE - but we must be aware of dependencies (don't let not the creation of the function cancel something the rest of the anonymous block depends on...).
SQL> r 1 declare 2 li_result integer; 3 begin 4 5 execute immediate 'create or replace function f(p in varchar2) return integer is begin return sqrt(to_number(p)); end;'; 6 7 select f('36') into li_result from dual; 8 9 dbms_output.put_line('Result='||li_result); 10* end; Result=6 PL/SQL procedure successfully completed. SQL>
Note that the two options (1) and (3) need you to the CREATE FUNCTION - if (1) privilege is much easier and safer in most cases.
Nigel cordially
-
PL/SQL functions as LOV to use in another display object
Hello
We had a custom search to extract data from a display object and the data displayed as a Table of ADF. Now, there are few requests for searches on this report. Go see criteria and Panel request if we allow saved search. But the fields used in the research are going through a lot of logic and thus the PL/SQL functions are implemented. We used to call these functions and lists separated by commas and then divided the list into individual elements and put in the component "select options".
The value (String) returned by the pl/sql function is something like - APAC, EMEA, NORTH AMERICA, FDA
I am creating a LOV based on SQL-query "Select getRegions() from dual;
Now, I want the list separated by commas to divide so that I could use this LOV in an another view and try the display criteria and saved searches.
I tried to assign as LOV just to check and the criteria drop-down view for region displays same value as single element - "APAC, EMEA, NORTH AMERICA, LAD."
I want it to be 4 separate - elements
APAC
EMEA
NORTH AMERICA
DVL
Is there anyway to achieve this?
Or better is at - it another way to do this (maybe I'm wrong)
Thank you.
JDev: 11.1.2.4
Instead of a programmatic VO of PL/SQL, I found sometimes easier to write PL/SQL functions that return a table - need to CREATE a TYPE for the data items to be returned and a TYPE of TABLE IMBRIQUE tabular form of the first kind. The function returns the type of table, and can even be a PIPElined table function. Then I create a VO with the following text:
SELECT * from TABLE (my_function_returning_table)
The function can even take parameters, which you fill with variable BIND your VO.
-
PL/SQL function to calculate the non-working days
Hello
I have the following pl/sql function which generates a number of days between two selected dates (i.e. excluding weekends). However, I also need to exclude specific holidays - day of Christmas etc. These holiday dates are stored in a table in our database (11 GR 2) called "HOLIDAY".
How can I integrate the holidays which is held in the table of holidays in the following query to exclude these dates as well? I know how to write a separate funtion pl/sql for a number of days between two dates using SELECT... BUT I can't work out how to bring together them in a single query.
Could someone show me how with the pl/sql / dates below please?
Example of HOLIDAY table below.
Thank you!
TP
create or replace function WORKING_DAYS (pi_start_date in date, pi_end_date in date) return integer is v_start_date date :=pi_start_date; v_end_date date:=pi_end_date; v_count integer:=0; begin while v_start_date <= v_end_date loop if to_char(v_start_date,'D') not in ('6','7') then v_count := v_count+1; end if; v_start_date:=v_start_date+1; end loop; return v_count; end;
(select '10-Apr-2013' as NWD from dual union all select '06-May-2013' from dual union all select '27-May-2013' from dual union all select '26-Aug-2013' from dual union all select '26-Dec-2013' from dual union all select '25-Dec-2013' from dual union all select '01-Jan-2014' from dual union all select '18-Apr-2014' from dual union all select '21-Apr-2014' from dual union all select '05-May-2014' from dual union all select '26-May-2014' from dual union all select '25-Aug-2014' from dual union all select '25-Dec-2014' from dual union all select '26-Dec-2014' from dual) HOLIDAYS
Hello
the link is on MOSC, not OTN... Here's a copy:
This function calculates the number of days between two dates, ignoring weekends and holidays (if requested and if the holidays are stored in a table)
I give an example of table 'public_holiday' with sample data, but users must ensure that their table contains the relevant data (all holidays within the maximum range of use of the service)
CREATE TABLE public_holiday (calendar_day, DATE, text VARCHAR2 (30));
FUNCTION to CREATE or REPLACE nb_days (p_date_from IN DATE
p_date_to DATE by DEFAULT TRUNC (sysdate)
, p_public_holidays in CHAR DEFAULT 'Y '.
) RETURN NUMBER
DEFINE AUTHID
AS
/*********************************************************************/
/ * Author: Bruno Vroman * /.
/ * Created: 23-AUG-2012 * /.
/ * Last updated: 23-AUG-2012 * /.
/ * Object: to calculate the number of days between 2 dates, to the exclusion of * /.
/ * Saturday and Sunday, but also "holidays" If the * /.
/ * argument 'p_public_holidays' = 'Y ' * /.
/ * Support: p_date_from<= p_date_to ="">=>
/ * component ' hour min dry "ignored (just counting days) * /.
/* First step: */
/ * the calendar days between 2 days * /.
/ Remove 2 days for each "week" and 0 or 1 extra day * /.
/ * function to a condition "complex" mix day of first week * /.
/ * and the number of days when full remaining weeks are removed * /.
/ * (set up once for all, for example if there is 3 days and the * /)
(/ * first day is a Thursday, there is 1 "Sat/Sun" to subtract) * /.
/ * Second step: If 'p_public_holidays' = 'Y': other * /.
/ * days, do not count holidays. */
/ Holiday everyday are defined in a table "public_holiday" * /.
/ * Note: there may be holidays defined on Saturday/Sunday. */
/*********************************************************************/
l_result NUMBER;
l_from DATE;
l_to DATE;
l_case tank (4);
BEGIN
l_from: = TRUNC (p_date_from);
l_to: = TRUNC (p_date_to);
l_case: = TO_CHAR (l_from, 'Dy', 'NLS_DATE_LANGUAGE = English').
To_char (MOD (l_to - l_from + 1, 7));
l_result: = l_to - l_from + 1
-TRUNC ((l_to-l_from + 1) / 7) * 2
-CASE
WHEN l_case IN ('Mon6', 'Tue5', 'Wed4', 'Thu3', 'Fri2'
, "Sat1", "Sun1", "Sun2', 'Sun3", "Sun4".
, "Sun5', 'Sun6.
)
THEN 1
WHEN l_case IN ('Tue6', 'Wed5', 'Wed6', 'Thu4', "Thu5"
, 'Thu6', 'Fri3', 'Fri4', 'Fri5', 'Fri6 '.
, "Sat2", "Sat3', 'Sat4', 'Sat5", "Sat6.
)
THEN 2
0 OTHERWISE
END
;
IF SUPERIOR (p_public_holidays) = "Y".
THEN
SELECT l_result - COUNT (*)
IN l_result
OF public_holiday p
WHERE p.calendar_day > = l_from
AND p.calendar_day<=>=>
AND SUBSTR (TO_CHAR (p.calendar_day
, "Dy".
'NLS_DATE_LANGUAGE = English'
)
, 1, 1 ) != 'S'
;
END IF;
RETURN l_result;
EXCEPTION
WHILE OTHERS
THEN
DBMS_OUTPUT. Put_line (' CTF nb_days (' |))
To_char (p_date_from, "MON-DD-YYYY"). ', ' ||
To_char (p_date_to, "MON-DD-YYYY"). ', ' ||
p_public_holidays | ' ) : ' || SQLERRM
);
LIFT;
END nb_days;
/
REM
REM example:
REM A) fill out the 'public_holidays '.
REM
TRUNCATE TABLE public_holiday;
INSERT INTO public_holiday VALUES (DATE ' 2012-01-01', ' new year (a Sunday)');
INSERT INTO public_holiday VALUES (DATE '' 2012-01-03, "for example");
REM (insert other days...)
COMMIT;
Call the function for some pairs of dates of REM B)
REM nb1: remove only Sat/Sun
REM nb2: also remove holidays
REM
ALTER SESSION SET nls_date_format ='Dy DD-MON-YY';
WITH some_dates AS
(SELECT DATE ' 2011-12-29'd dual FROM
UNION ALL SELECT DATE ' 2012-01-08' FROM dual
UNION ALL SELECT DATE ' 2012-01-10' FROM dual
)
SELECT d1.d 'FROM '.
, d2.d ' to THE '.
, nb_days (d1.d, d2.d, ' don't) nb1
, nb_days (d1.d, d2.d, 'Y') nb2
OF some_dates d1
some_dates d2
WHERE d1.d<=>=>
ORDER BY nb1, nb2, d1.d
;
GO TO NB1 NB2
------------- ------------- ---- ----
Monday, January 8, 12 Monday, January 8, 12 0 0
Friday, December 29, 11 Friday, December 29, 11 1 1
Wednesday, January 10, 12 Wednesday, January 10, 12 1 1
Monday, January 8, 12 Wednesday, January 10, 12 2 2
Friday, December 29, 11 Monday, January 8, 12 7 6
Friday, December 29, 11 Wednesday, January 10, 12 9 8
Hope that this could be useful, but note that this code has not been completely tested, so check and test before you trust it (in the case of any questions, please post a comment)
Bruno Vroman.
Best regards
Bruno
-
Hello
In a query XQuery is posssible to call a function or procedure SQL (PL / SQL)?
Here is an example of what I had accomplished:
SELECT THE PRD. XMLCOLUMN of
XMLTABLE (' for $i in ora: view("P_iXXX")/LINE)
$j in ora: view("P_jXXX")/LINE.
where
($i / NSU_xxx = $j/NSU_xxx)
return
(
< NCL >
{
$i / NSU_xxx,
H3. CALL the SQL function? as sql_xxx
for $k in ora: view("P_kxxx")/ROW
($vk/COD_RMP_VPM = "PRD")
Return()
}
< / NCL >
() "PATH of XMLType 'XMLCOLUMN' COLUMNS 'resultsqlfunction' INTEGER PATH 'xsql_xxx' INTEGER ACCESS to 'NSU_xxx' path 'NSU_xxx', '.') as the PRD;
Thanks in advance for your answers
FrançoisWho today replaces "ora: see?
On 11.2, ora expansion feature: view() is deprecated in favor of the fn:collection("oradb:/") method:
http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb_xquery.htm#BABECFFD
My DBA database have installed Oracle XML DB to use the XMLType and XMLTable, I thought that these features among other things speed up the creation of XML.
What are the benefits of using XQuery and XMLTable and XMLQUERY functions?
Which version of the database you use?
Please read: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb_xquery.htm#CBAGCBGJ
Is there another method to expedite the creation of XML?
Publication of SQL/XML functions are probably the best way to create custom relational data XML documents.
The basic functionality of XQuery is not to the RDBMS query tables or views, although Oracle provides extensions to do.
Most of the time, I use XQuery (via XMLTable and XMLQuery) to do exactly the opposite, i.e. to extract XML data in a relational form, or the transformation of XML fragments.If your actual requests are slow - even if you need to define what that means and that you are pregnant - then maybe the SQL/XML functions are not the real problem.
In a "Where clause" as I turn, I have several "outer join". Here is an example.
where
PPM. NSU_PPM = w.NSU_PPM and FRNS. NSU_FRN (+) IS FCO. NSU_FRN and FCO. NSU_FCO (+) IS PPM. NSU_FCO
and T2O. NSQ_T2O (+) IS PPM. NSQ_T2O
and T51. NSQ_T51 (+) IS PPM. NSQ_T51
and TWU. NSU_STT (+) IS PPM. NSU_STT
and T01. NSQ_T01 (+) IS PPM. NSQ_T01
and vpm.cod_rmp_vpm (+) = "PRA".
and vpm.num_vsn_vpm (+) = PPM.vsn_sup
and w.nsu_ppm = A.nsu_ppm (+)
and W.NSU_SOO = A_HEADER. NSU_SOO and A_HEADER. NOR_SOM = 0Yes, it's exactly what I was talking about.
Transposing the logic for XQuery 1.0 is not the approach more simple (to say the least), because there is no direct support OUTER JOIN.
XQuery 3.0 provides the functionality, but it is not yet here in the database.My suggestion would be to stick to the publication of SQL/XML functions.
If you have a specific question about the performance, we (as the members of the forum) will be happy to help you.
Provides the steps necessary to reproduce the problem, including some examples of data.Kind regards
Marc.
Maybe you are looking for
-
Why photos starts automatically when you restart. It is NOT in the folder.so of starting, why what is happening? I never use photos, so it's a loss of memory perfectly!
-
USB for my iPhone, so it can read a text file
Hi, I would like to be able to connect a standard USB to my iPhone, so it can read a text file from USB, any suggestions on cable/apps? Thank you, Tony
-
While on a page web, using one of several browsers, it will take off and scroll down without any input from me. Seems to be intermittent but annoying. All solutions?
-
DEP stopped the program when you try to download iTunes
Original title: try dwnld, computer iTunes won't let me. Is it really a threat Arrested DEP. program saying that it was dangerous.
-
Reference Dell MEM installation fails
Hi all Previously on my hosts ESXi 4.1 I could quite easily set up the MEM from Dell (1.1). Now, I am trying to install 1.2 on a 5.5 ESXI host (new installation always in eval mode). I have a new installation of vSphere-VMware-CLI - 5.5.0 - 2043780 h