ORA-06537 OUT bind variable bound to an IN position
Sir,
we have migrated our database from oracle 9i to 10g (Release 10.1.0.2.0)..
but while executing a procedure we are getting the following error
ORA-06537:OUT bind variable bound to an IN position
this same procedure is not throwing any error wen we connect the 9i database
we are giving two parameters for this procedure
in that second one is an IN OUT Parameter
another procedure which use the same parameters working properly in 10g and 9i.
we are using PowerBuilder 10 as front end
plz help me to get ride of this prob...
You get that error even in 9i if the parameters to the procedure calls are not bound correctly. Check the powerbuilder application to make sure it is binding the parameter types correctly.
SQL> create or replace procedure proc(p_in IN NUMBER, p_out IN OUT NUMBER) is
2 begin
3 null ;
4 end ;
5 /
Procedure created.
SQL> declare
2 l_var1 NUMBER ;
3 l_var2 NUMBER ;
4 begin
5 execute immediate 'begin proc(:in, :out) ; end ;' using OUT l_var1, OUT l_var2 ;
6 end ;
7 /
declare
ERROR at line 1:
ORA-06537: OUT bind variable bound to an IN position
ORA-06512: at line 5
SQL> declare
2 l_var1 NUMBER ;
3 l_var2 NUMBER ;
4 begin
5 execute immediate 'begin proc(:in, :out) ; end ;' using IN l_var1, OUT l_var2 ;
6 end ;
7 /
declare
ERROR at line 1:
ORA-06537: OUT bind variable bound to an IN position
ORA-06512: at line 5
SQL> declare
2 l_var1 NUMBER ;
3 l_var2 NUMBER ;
4 begin
5 execute immediate 'begin proc(:in, :out) ; end ;' using IN l_var1, IN OUT l_var2 ;
6 end ;
7 /
PL/SQL procedure successfully completed.
SQL> disconnect
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production
SQL>
Similar Messages
-
I am getting ORA-01008:not all variables bound error
Hi all,
i am getting ORA-01008:not all variables bound error while executing the following code...
Could any one help me to find out the problem...i am very new to ODP.net and Oracle ..
I am using VC++.net for run this code.
Here is the code.....
#include <iostream>
using namespace std;
using namespace System;
using namespace Oracle::DataAccess::Client;
class Sample
public:
Sample();
~Sample();
Sample::Sample()
int num = 100;
int sal = 200;
//connect to Oracle
OracleConnection ^con ;
con = gcnew OracleConnection();
con->ConnectionString = "User Id=test;Password=test;Data Source=test.local.com";
//Oracle command part
OracleCommand ^cmd;
cmd = con->CreateCommand();
cmd->CommandText = "insert into simple values (:num, :sal)";
try
con->Open();
cmd->ExecuteNonQuery();
catch (Exception ^e)
Console::WriteLine("Execution Failed:" + e->Message);
finally
con->Close();
Sample::~Sample()
int main()
Sample samp;
return 0;
sorrry lack of comments.....
plz help me out..
thanks in advance..
justinHello,
You have 2 bind variables in your statement (:num and :sal) but you have not created parameters and bound them to the bind variables.
- Mark -
Hi Friends,
I have have extended CO where i have added dynamic where condition to VO,it's throwing error.
Code added in controller :
public class Custom_HomePageCO extends HomePageCO
public Custom_HomePageCO()
public void processRequest(OAPageContext pageContext,OAWebBean webBean)
super.processRequest(pageContext,webBean);
System.out.println("NewClase");
OAApplicationModule am=pageContext.getApplicationModule(webBean);
System.out.println(am);
OAApplicationModule am1=(OAApplicationModule)am.findApplicationModule("TrackExpenseReportsAM");
System.out.println(am1);
OAViewObject vo=(OAViewObject)am1.findViewObject("TrackExpenseReportsVO");
System.out.println(vo);
vo.setWhereClause("REPORT_SUBMITTED_DATE is not null");
vo.executeQuery();
public void processFormRequest(OAPageContext pageContext,OAWebBean webBean)
super.processFormRequest(pageContext,webBean);
Error message:
Exception Details.
Error Details
Logout
Error Page
Exception Details.
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT
AI.DESCRIPTION PURPOSE,
AI.INVOICE_CURRENCY_CODE CURRENCY_CODE,
AI.INVOICE_DATE REPORT_DATE,
AERH.REPORT_SUBMITTED_DATE REPORT_SUBMITTED_DATE,
AI.INVOICE_NUM REPORT_NUMBER,
TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
0, decode(AI.CANCELLED_DATE,
null, APS.GROSS_AMOUNT,
AERH.TOTAL),
nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)) ,
FND_CURRENCY_CACHE.GET_FORMAT_MASK
(AI.INVOICE_CURRENCY_CODE, 30)) ||' '|| AI.INVOICE_CURRENCY_CODE REPORT_TOTAL_CURRENCY,
TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
0, decode(AI.CANCELLED_DATE,
null, APS.GROSS_AMOUNT,
AERH.TOTAL),
nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)) ,
FND_CURRENCY_CACHE.GET_FORMAT_MASK
(AI.INVOICE_CURRENCY_CODE, 30))
REPORT_TOTAL,
P.PERSON_ID EMPLOYEE_ID,
AERH.REPORT_HEADER_ID REPORT_HEADER_ID,
P.FULL_NAME FULL_NAME ,
DECODE(AI.CANCELLED_DATE,null,
nvl(aerh.expense_status_code, DECODE(APS.GROSS_AMOUNT ,0,'PAID',
decode(AI.Payment_status_flag,'Y','PAID',
'N','INVOICED',
'P','PARPAID',NULL))),
'CANCELLED') STATUS_CODE,
AERH.source SOURCE,
NULL CURRENT_APPROVER,
ROUND(sysdate - AI.LAST_UPDATE_DATE) DAYS_SINCE_ACTIVITY,
AERH.RECEIPTS_STATUS RECEIPTS_STATUS_CODE,
AERH.HOLDING_REPORT_HEADER_ID,
AI.VENDOR_ID VENDOR_ID,
AERH.AMT_DUE_CCARD_COMPANY AMT_DUE_CCARD_COMPANY,
AERH.AMT_DUE_EMPLOYEE AMT_DUE_EMPLOYEE,
'CurrentApproverName' CURRENT_APPROVER_SWITCHER,
to_char(AERH.LAST_UPDATE_DATE, 'DD-MON-RRRR HH:MI:SS'),
AI.INVOICE_ID INVOICE_ID
FROM
AK_WEB_USER_SEC_ATTR_VALUES A,
PO_VENDORS PV,
AP_INVOICES AI,
AP_EXPENSE_REPORT_HEADERS AERH,
PER_PEOPLE_X P,
AP_PAYMENT_SCHEDULES APS
WHERE AI.INVOICE_ID= APS.INVOICE_ID
AND AI.INVOICE_ID = AERH.VOUCHNO(+)
AND AI.INVOICE_TYPE_LOOKUP_CODE||'' = 'EXPENSE REPORT'
AND A.ATTRIBUTE_CODE = 'ICX_HR_PERSON_ID'
AND PV.EMPLOYEE_ID = A.NUMBER_VALUE
AND A.WEB_USER_ID = :1
AND P.PERSON_ID = PV.EMPLOYEE_ID
AND PV.VENDOR_ID = AI.VENDOR_ID
AND DECODE (AI.PAYMENT_STATUS_FLAG,
'Y', sysdate - AI.LAST_UPDATE_DATE,
decode(APS.GROSS_AMOUNT , 0 ,sysdate - AI.LAST_UPDATE_DATE,0)
) <= 30
AND (AERH.SOURCE <> 'Both Pay' OR AERH.REPORT_HEADER_ID IS NULL)
UNION
SELECT
AI.DESCRIPTION PURPOSE,
AI.INVOICE_CURRENCY_CODE CURRENCY_CODE,
AI.INVOICE_DATE REPORT_DATE,
AERH.REPORT_SUBMITTED_DATE REPORT_SUBMITTED_DATE,
AI.INVOICE_NUM REPORT_NUMBER,
TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
0, decode(AI.CANCELLED_DATE,
null, APS.GROSS_AMOUNT,
AERH.TOTAL),
nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)) ,
FND_CURRENCY_CACHE.GET_FORMAT_MASK
(AI.INVOICE_CURRENCY_CODE, 30)) ||' '|| AI.INVOICE_CURRENCY_CODE REPORT_TOTAL_CURRENCY,
TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
0, decode(AI.CANCELLED_DATE,
null, APS.GROSS_AMOUNT,
AERH.TOTAL),
nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)),
FND_CURRENCY_CACHE.GET_FORMAT_MASK
(AI.INVOICE_CURRENCY_CODE, 30))
REPORT_TOTAL,
P.PERSON_ID EMPLOYEE_ID,
AERH.REPORT_HEADER_ID REPORT_HEADER_ID,
P.FULL_NAME FULL_NAME ,
DECODE(AI.CANCELLED_DATE,null,
nvl(aerh.expense_status_code, DECODE(APS.GROSS_AMOUNT ,0,'PAID',
decode(AI.Payment_status_flag,'Y','PAID',
'N','INVOICED',
'P','PARPAID',NULL))),
'CANCELLED') STATUS_CODE,
AERH.source SOURCE,
NULL CURRENT_APPROVER,
ROUND(sysdate - AI.LAST_UPDATE_DATE) DAYS_SINCE_ACTIVITY,
AERH.RECEIPTS_STATUS RECEIPTS_STATUS_CODE,
AERH.HOLDING_REPORT_HEADER_ID,
AI.VENDOR_ID VENDOR_ID,
AERH.AMT_DUE_CCARD_COMPANY AMT_DUE_CCARD_COMPANY,
AERH.AMT_DUE_EMPLOYEE AMT_DUE_EMPLOYEE,
'CurrentApproverName' CURRENT_APPROVER_SWITCHER,
to_char(AERH.LAST_UPDATE_DATE, 'DD-MON-RRRR HH:MI:SS'),
AI.INVOICE_ID INVOICE_ID
FROM
AK_WEB_USER_SEC_ATTR_VALUES A,
PO_VENDORS PV,
AP_INVOICES AI,
AP_EXPENSE_REPORT_HEADERS AERH,
PER_PEOPLE_X P,
AP_PAYMENT_SCHEDULES APS
WHERE AI.INVOICE_ID= APS.INVOICE_ID
AND AI.INVOICE_ID = AERH.VOUCHNO(+)
AND AI.INVOICE_TYPE_LOOKUP_CODE||'' in ('STANDARD','MIXED')
AND A.ATTRIBUTE_CODE = 'ICX_HR_PERSON_ID'
AND AI.PAID_ON_BEHALF_EMPLOYEE_ID = A.NUMBER_VALUE
AND A.WEB_USER_ID = :2
AND P.PERSON_ID = AI.PAID_ON_BEHALF_EMPLOYEE_ID
AND PV.VENDOR_ID = AI.VENDOR_ID
AND DECODE (AI.PAYMENT_STATUS_FLAG,
'Y', sysdate - AI.LAST_UPDATE_DATE,
decode(APS.GROSS_AMOUNT , 0 ,sysdate - AI.LAST_UPDATE_DATE,0)
) <= 30
AND (AERH.SOURCE <> 'Both Pay' OR AERH.REPORT_HEADER_ID IS NULL)
UNION ALL
SELECT
AERH.DESCRIPTION PURPOSE,
AERH.DEFAULT_CURRENCY_CODE CURRENCY_CODE,
AERH.WEEK_END_DATE REPORT_DATE,
AERH.REPORT_SUBMITTED_DATE REPORT_SUBMITTED_DATE,
AERH.INVOICE_NUM REPORT_NUMBER,
TO_CHAR(nvl(AERH.AMT_DUE_CCARD_COMPANY+AERH.AMT_DUE_EMPLOYEE+nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),AERH.TOTAL),FND_CURRENCY_CACHE.GET_FORMAT_MASK
(AERH.DEFAULT_CURRENCY_CODE,30)) ||' '|| AERH.DEFAULT_CURRENCY_CODE REPORT_TOTAL_CURRENCY,
TO_CHAR(nvl(AERH.AMT_DUE_CCARD_COMPANY+AERH.AMT_DUE_EMPLOYEE+nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),AERH.TOTAL),FND_CURRENCY_CACHE.GET_FORMAT_MASK
(AERH.DEFAULT_CURRENCY_CODE,30)) REPORT_TOTAL,
PER_EMPLOYEE.PERSON_ID EMPLOYEE_ID,
AERH.REPORT_HEADER_ID REPORT_HEADER_ID,
PER_EMPLOYEE.FULL_NAME FULL_NAME,
NVL(AERH.expense_status_code,
AP_WEB_OA_ACTIVE_PKG.GetReportStatusCode(AERH.Source, AERH.Workflow_approved_flag,
AERH.report_header_id, 'Y', 'N')) STATUS_CODE,
AERH.source SOURCE,
NVL (PER_APPROVER.full_name, AP_WEB_OA_ACTIVE_PKG.GetCurrentApprover(AERH.Source,
AERH.Workflow_approved_flag, AERH.report_header_id, AERH.expense_status_code)) CURRENT_APPROVER,
ROUND(NVL(sysdate - AERH.EXPENSE_LAST_STATUS_DATE,
sysdate - AERH.LAST_UPDATE_DATE)) DAYS_SINCE_ACTIVITY,
AERH.RECEIPTS_STATUS RECEIPTS_STATUS_CODE,
AERH.HOLDING_REPORT_HEADER_ID,
0 VENDOR_ID,
AERH.AMT_DUE_CCARD_COMPANY AMT_DUE_CCARD_COMPANY,
AERH.AMT_DUE_EMPLOYEE AMT_DUE_EMPLOYEE,
DECODE(AERH.expense_current_approver_id,
-99999, 'AMEMultipleApprovers',
decode(PER_APPROVER.full_name,
null,'CurrentApproverName','AMESingleApprover')) CURRENT_APPROVER_SWITCHER,
to_char(AERH.LAST_UPDATE_DATE, 'DD-MON-RRRR HH:MI:SS'),
-1 INVOICE_ID
FROM
AK_WEB_USER_SEC_ATTR_VALUES A,
AP_EXPENSE_REPORT_HEADERS AERH,
PER_PEOPLE_X PER_EMPLOYEE,
PER_PEOPLE_X PER_APPROVER
WHERE AERH.VOUCHNO +0 =0
AND A.ATTRIBUTE_CODE = 'ICX_HR_PERSON_ID'
AND AERH.EMPLOYEE_ID = A.NUMBER_VALUE
AND A.WEB_USER_ID = :3
AND PER_EMPLOYEE.PERSON_ID = AERH.EMPLOYEE_ID
AND (AERH.Source <> 'NonValidatedWebExpense'
OR AERH.Workflow_approved_flag IS NULL)
AND AERH.expense_current_approver_id = PER_APPROVER.person_id
AND decode(AERH.total,0,ROUND(NVL(sysdate - AERH.EXPENSE_LAST_STATUS_DATE,sysdate - AERH.LAST_UPDATE_DATE)),30) <= 30
AND AERH.SOURCE <> 'Both Pay'
UNION
SELECT
AERH.DESCRIPTION PURPOSE,
AERH.DEFAULT_CURRENCY_CODE CURRENCY_CODE,
AERH.WEEK_END_DATE REPORT_DATE,
AERH.REPORT_SUBMITTED_DATE REPORT_SUBMITTED_DATE,
AERH.INVOICE_NUM REPORT_NUMBER,
TO_CHAR(nvl(AERH.AMT_DUE_CCARD_COMPANY+AERH.AMT_DUE_EMPLOYEE+nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),AERH.TOTAL),FND_CURRENCY_CACHE.GET_FORMAT_MASK
(AERH.DEFAULT_CURRENCY_CODE,30)) ||' '|| AERH.DEFAULT_CURRENCY_CODE REPORT_TOTAL_CURRENCY,
TO_CHAR(nvl(AERH.AMT_DUE_CCARD_COMPANY+AERH.AMT_DUE_EMPLOYEE+nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),AERH.TOTAL),FND_CURRENCY_CACHE.GET_FORMAT_MASK
(AERH.DEFAULT_CURRENCY_CODE,30)) REPORT_TOTAL,
PER_EMPLOYEE.PERSON_ID EMPLOYEE_ID,
AERH.REPORT_HEADER_ID REPORT_HEADER_ID,
PER_EMPLOYEE.FULL_NAME FULL_NAME,
NVL(AERH.expense_status_code,
AP_WEB_OA_ACTIVE_PKG.GetReportStatusCode(AERH.Source, AERH.Workflow_approved_flag,
AERH.report_header_id,'Y','N')) STATUS_CODE,
AERH.source SOURCE,
NVL (PER_APPROVER.full_name, AP_WEB_OA_ACTIVE_PKG.GetCurrentApprover(AERH.Source,
AERH.Workflow_approved_flag, AERH.report_header_id, AERH.expense_status_code)) CURRENT_APPROVER,
ROUND(NVL(sysdate - AERH.EXPENSE_LAST_STATUS_DATE,
sysdate - AERH.LAST_UPDATE_DATE)) DAYS_SINCE_ACTIVITY,
AERH.RECEIPTS_STATUS RECEIPTS_STATUS_CODE,
AERH.HOLDING_REPORT_HEADER_ID,
0 VENDOR_ID,
AERH.AMT_DUE_CCARD_COMPANY AMT_DUE_CCARD_COMPANY,
AERH.AMT_DUE_EMPLOYEE AMT_DUE_EMPLOYEE,
DECODE(AERH.expense_current_approver_id,
-99999, 'AMEMultipleApprovers',
decode(PER_APPROVER.full_name,
null,'CurrentApproverName','AMESingleApprover')) CURRENT_APPROVER_SWITCHER,
to_char(AERH.LAST_UPDATE_DATE, 'DD-MON-RRRR HH:MI:SS'),
-1 INVOICE_ID
FROM
AK_WEB_USER_SEC_ATTR_VALUES A,
AP_EXPENSE_REPORT_HEADERS AERH,
PER_PEOPLE_X PER_EMPLOYEE,
PER_PEOPLE_X PER_APPROVER
WHERE AERH.VOUCHNO +0=0
AND A.ATTRIBUTE_CODE = 'ICX_HR_PERSON_ID'
AND AERH.PAID_ON_BEHALF_EMPLOYEE_ID = A.NUMBER_VALUE
AND A.WEB_USER_ID = :4
AND PER_EMPLOYEE.PERSON_ID = PAID_ON_BEHALF_EMPLOYEE_ID
AND AERH.EMPLOYEE_ID IS NULL
AND (AERH.Source <> 'NonValidatedWebExpense'
OR AERH.Workflow_approved_flag IS NULL)
AND AERH.expense_current_approver_id = PER_APPROVER.person_id
AND decode(AERH.total,0,ROUND(NVL(sysdate - AERH.EXPENSE_LAST_STATUS_DATE,sysdate - AERH.LAST_UPDATE_DATE)),30) <= 30
AND AERH.SOURCE <> 'Both Pay'
UNION ALL
/* This select is for invoice imported reports by contingent workers */
SELECT
AI.DESCRIPTION PURPOSE,
AI.INVOICE_CURRENCY_CODE CURRENCY_CODE,
AI.INVOICE_DATE REPORT_DATE,
AERH.REPORT_SUBMITTED_DATE REPORT_SUBMITTED_DATE,
AI.INVOICE_NUM REPORT_NUMBER,
TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
0, decode(AI.CANCELLED_DATE,
null, APS.GROSS_AMOUNT,
AERH.TOTAL),
nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)) ,
FND_CURRENCY_CACHE.GET_FORMAT_MASK
(AI.INVOICE_CURRENCY_CODE, 30)) ||' '|| AI.INVOICE_CURRENCY_CODE REPORT_TOTAL_CURRENCY,
TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
0, decode(AI.CANCELLED_DATE,
null, APS.GROSS_AMOUNT,
AERH.TOTAL),
nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)) ,
FND_CURRENCY_CACHE.GET_FORMAT_MASK
(AI.INVOICE_CURRENCY_CODE, 30))
REPORT_TOTAL,
P.PERSON_ID EMPLOYEE_ID,
AERH.REPORT_HEADER_ID REPORT_HEADER_ID,
P.FULL_NAME FULL_NAME ,
DECODE(AI.CANCELLED_DATE,null,
nvl(aerh.expense_status_code, DECODE(APS.GROSS_AMOUNT ,0,'PAID',
decode(AI.Payment_status_flag,'Y','PAID',
'N','INVOICED',
'P','PARPAID',NULL))),
'CANCELLED') STATUS_CODE,
AERH.source SOURCE,
NULL CURRENT_APPROVER,
ROUND(sysdate - AI.LAST_UPDATE_DATE) DAYS_SINCE_ACTIVITY,
AERH.RECEIPTS_STATUS RECEIPTS_STATUS_CODE,
AERH.HOLDING_REPORT_HEADER_ID,
AI.VENDOR_ID VENDOR_ID,
AERH.AMT_DUE_CCARD_COMPANY AMT_DUE_CCARD_COMPANY,
AERH.AMT_DUE_EMPLOYEE AMT_DUE_EMPLOYEE,
'CurrentApproverName' CURRENT_APPROVER_SWITCHER,
to_char(AERH.LAST_UPDATE_DATE, 'DD-MON-RRRR HH:MI:SS'),
AI.INVOICE_ID INVOICE_ID
FROM
AK_WEB_USER_SEC_ATTR_VALUES A,
AP_INVOICES AI,
AP_EXPENSE_REPORT_HEADERS AERH,
PER_PEOPLE_X P,
AP_PAYMENT_SCHEDULES APS
WHERE AI.INVOICE_ID= APS.INVOICE_ID
AND AI.INVOICE_ID = AERH.VOUCHNO(+)
AND AI.INVOICE_TYPE_LOOKUP_CODE||'' = 'EXPENSE REPORT'
AND A.ATTRIBUTE_CODE = 'ICX_HR_PERSON_ID'
AND AI.PAID_ON_BEHALF_EMPLOYEE_ID = A.NUMBER_VALUE
AND A.WEB_USER_ID = :5
AND P.PERSON_ID = AI.PAID_ON_BEHALF_EMPLOYEE_ID
AND AP_WEB_DB_HR_INT_PKG.IsPersonCwk(AI.PAID_ON_BEHALF_EMPLOYEE_ID)='Y'
AND DECODE (AI.PAYMENT_STATUS_FLAG,
'Y', sysdate - AI.LAST_UPDATE_DATE,
decode(APS.GROSS_AMOUNT , 0 ,sysdate - AI.LAST_UPDATE_DATE,0)
) <= 30
AND (AERH.SOURCE <> 'Both Pay' OR AERH.REPORT_HEADER_ID IS NULL)) QRSLT WHERE (REPORT_SUBMITTED_DATE is not null)
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:603)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2360)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1759)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:511)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:432)
at _OA._jspService(OA.jsp:33)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
java.sql.SQLException: ORA-01008: not all variables bound
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2548)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2933)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:650)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:578)
at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:631)
at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:518)
at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3375)
at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(OAJboViewObjectImpl.java:828)
at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4525)
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:574)
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:544)
at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:619)
at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3339)
at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3326)
at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:441)
at oracle.apps.ap.oie.webui.Custom_HomePageCO.processRequest(Custom_HomePageCO.java:26)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2360)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1759)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:511)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:432)
at _OA._jspService(OA.jsp:33)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
java.sql.SQLException: ORA-01008: not all variables bound
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2548)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2933)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:650)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:578)
at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:631)
at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:518)
at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3375)
at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(OAJboViewObjectImpl.java:828)
at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4525)
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:574)
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:544)
at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:619)
at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3339)
at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3326)
at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:441)
at oracle.apps.ap.oie.webui.Custom_HomePageCO.processRequest(Custom_HomePageCO.java:26)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2360)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1759)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:511)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:432)
at _OA._jspService(OA.jsp:33)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
I have took the sql from error message and i tried executing the same in toad... i was able execute it smoothly... i dot know why its working while running the page
Please help me guys...
Thanks,
PavanHi Shobhi,
Actually this relates to the Iexpenese Module. The VO is "oracle.apps.ap.oie.server.TrackExpenseReportsVO"(Seeded)
The user Expense home screen is based on the above VO and this view returning multiple line for the same expense number which should be eliminated.
so for this i need to filter data by adding where clause dynamically on top of the existing where conditions so that i can eliminate the duplicate row.
Please suggest me !! how to move on
Thanks,
Pavan V
91-9640871542 -
Why does this cause error (ORA 01008: Not all variables bound)
When I assign values to parameters for a command object, I used the following code with the .NET provider:
If oReq.CritSpec = Nothing Or oReq.CritSpec = "" Then
cmdReq.Parameters.Add(":po5", DBNull.Value)
Else
cmdReq.Parameters.Add(":po5", oReq.CritSpec)
End If
This works fine, but when I switch to using ODP it generates the 'not all variables bound' error. I checked the parameter's status and it was Success. However, if I change the second line of the statement to
If oReq.CritSpec = Nothing Or oReq.CritSpec = "" Then
cmdReq.Parameters.Add(":po5", OracleDbType.Varchar2, DBNull.Value, ParameterDirection.Input)
Else
cmdReq.Parameters.Add(":po5", nReq.CritSpec)
End If
It seems to be OK. So my question is - why does the first statement generate the error? Am I misinterpreting the overloaded constructor or it it a bug in my code? Thanks.
ckNo need to answer, I solved it.
For anyone else who might run into this, there were two issues:
1. Assigning DBNull.Value to a parameter without specifying the parameter's type causes the Value property for that parameter to not be initialized. If you reference it, it will come back as a runtime error (check it first by testing for IsNot Nothing).
2. In my update code, I have a lot of where clauses like "WHERE (COL1 = :1 OR COL1 IS NULL AND :1 IS NULL)". The default binding for parameters treats these two references to :1 as two different parameters. Setting BindByName to true solves the problem.
ck
Edited by: user536671 on Feb 15, 2009 7:04 PM -
Bug? ORA-01008: not all variables bound when using DB LINK
This SQL runs fine in SQL*Plus but returns ORA-01008 in Apex.
If I replace the bind variable with a literal, it works fine in Apex.
Using OracleXE 10.2.0.1.0, Apex 2.1.0.00.39
with ixc as (
select ic.table_name, ic.index_name, ic.column_name, ic.column_position
from user_indexes@MY_DB_LINK ix
join user_ind_columns@MY_DB_LINK ic
on (
ic.index_name = ix.index_name
and
ic.table_name = ix.table_name
select
pk.table_name as pk_table
, fk.table_name as fk_table
, ucc.position
, ucc.column_name
, nvl(ixc.index_name,'-- not indexed --') as indexed
, ixc.column_position as ind_position
from (select table_name, owner, constraint_name, r_constraint_name, r_owner from user_constraints@MY_DB_LINK) fk
join (select table_name, owner, constraint_name from user_constraints@MY_DB_LINK) pk
on (
fk.r_owner = pk.owner
and
fk.r_constraint_name = pk.constraint_name
join user_cons_columns@MY_DB_LINK ucc
on (
ucc.owner = fk.owner
and
ucc.constraint_name = fk.constraint_name
and
ucc.table_name = fk.table_name
left join ixc
on (
ixc.column_name = ucc.column_name
and
ixc.table_name = fk.table_name
where pk.table_name like upper(:P11_TABLE_NAME)
order by pk.table_name, fk.table_name, index_name, ucc.positionone small advice....
SQL95 semantics is something that is new in Oracle (from 9 version)....so maybe if you try to write your query with standard "=" "=+" join signs...
I know that if that is part of universal app (SQL comaptible) that soem aditional problems may occure...but just try and look at the result... -
ORA-01008: not all variables bound - not because of '--'
Hi,
I am getting the dreaded bind variable error on a SQL statement in my applicaiton. Interestingly, it also happens from the SQL Command windows also.
The query is based on a view, the first query in the app to do so. It is using simple bind variables as search criteria. I am on HTMLDB 2.0. Can anyone shed some ligh on whey I should be experiencing this? Is there something about parsing a query based on a view that I need to be aware of? Thanks in advance for any help.
The queryis :
select dock,
v.customer,
to_char(bl_date,'dd-Mon-yyyy') as "BL DATE",
vessel,
tank_type,
sum("PROPANE(BBLS)") as "PROPANE(BBLS)",
sum("BUTANE(BBLS)") as "BUTANE(BBLS)",
sum("GASOLINE(BBLS)") as "GASOLINE(BBLS)",
round(max(laytime),2) as "LAYTIME",
round(max(turnaround_hours),2) as "TURNAROUND(HRS)",
round(max(turnaround_hours)/(sum("PROPANE(BBLS)")+sum("BUTANE(BBLS)")+sum("GASOLINE(BBLS)"))*1000,2) as "HRS/'000 BBLS",
:P90_FROM_DATE,
:P90_TO_DATE,
:p90_CUSTOMER_SEARCH
from turnaround_stats_vw v
where v.customer like '%'||:P90_CUSTOMER_SEARCH||'%'
and bl_date between NVL(to_date(:P90_from_date,'dd-mm-yyyy'),bl_date)
and NVL(to_date(:P90_to_date,'dd-mm-yyyy'),bl_date)
group by dock,customer,bl_date,arrival_date;
Noticed I tried the select :param as I saw in several posts relating to this issue, but to no avail.
The view query is:
REATE OR REPLACE FORCE VIEW "TURNAROUND_STATS_VW" ("SHIPMENT_NUMBER", "CUSTOMER", "VESSEL", "TANK_TYPE", "BL_NO", "BL_DATE", "DOCK", "PROPANE(BBLS)", "BUTANE(BBLS)", "GASOLINE(BBLS)", "ARRIVAL_DATE_AND_TIME", "NOR_TENDERED", "PILOT_ON_BOARD", "ALL_FAST", "NOR_ACCEPTED", "ARM_CONNECTED", "LOADING_COMMENCED", "LOADING_COMPLETED", "ARM_DISCONNECTED", "VESSEL_UNBERTHED", "VESSEL_SAILED", "REMARKS", "LAYTIME", "TURNAROUND_HOURS", "EFFECTIVE_LOADING_RATE", "TURNAROUND/000_BBL", "TRANSIT_TIME") AS
SELECT s.Shipment_Number,
c.Customer_Name as "CUSTOMER",
v.Vessel_Name as "VESSEL",
vtt.Description as "TANK_TYPE",
s.BL_NO,
s.BL_Date,
d.description as "DOCK",
s.propane as "PROPANE(BBLS)",
s.butane as "BUTANE(BBLS)",
s.gasoline as "GASOLINE(BBLS)",
to_char(s.Arrival_Date_Time,'DD-Mon-YYYY HH24:MI') as "ARRIVAL_DATE_AND_TIME",
to_char(s.NOR_Tendered,'DD-Mon-YYYY HH24:MI') as "NOR_TENDERED",
to_char(s.Pilot_on_Board,'DD-Mon-YYYY HH24:MI') as "PILOT_ON_BOARD",
to_char(s.All_Fast,'DD-Mon-YYYY HH24:MI') as "ALL_FAST",
to_char(s.NOR_Accepted,'DD-Mon-YYYY HH24:MI') as "NOR_ACCEPTED",
to_char(s.Arm_Connected,'DD-Mon-YYYY HH24:MI') as "ARM_CONNECTED",
to_char(s.Loading_Commenced,'DD-Mon-YYYY HH24:MI') as "LOADING_COMMENCED",
to_char(s.Loading_Completed,'DD-Mon-YYYY HH24:MI') as "LOADING_COMPLETED",
to_char(s.Arm_Disconnected,'DD-Mon-YYYY HH24:MI') as "ARM_DISCONNECTED",
to_char(s.Vessel_Unberthed,'DD-Mon-YYYY HH24:MI') as "VESSEL_UNBERTHED",
to_char(s.Vessel_Sailed,'DD-Mon-YYYY HH24:MI') as "VESSEL_SAILED",
s.Remarks,
(CASE
WHEN s.all_fast < (s.nor_accepted + 0.25)
THEN (s.arm_disconnected - s.all_fast) * 24
ELSE (s.arm_disconnected - (nor_accepted + 0.25)) * 24
END) as "LAYTIME",
(s.Vessel_Sailed - s.Arrival_Date_Time)*24 AS "TURNAROUND_HOURS",
(s.Propane + s.Butane+ s.Gasoline)/((s.Loading_Completed - s.Loading_Commenced)*24) AS "EFFECTIVE_LOADING_RATE",
((s.Vessel_Sailed - s.Arrival_Date_Time) * 24)/(s.Propane + s.Butane + s.Gasoline)*1000 AS "TURNAROUND/000_BBL",
((s.Vessel_Sailed - s.Arm_Disconnected) + (s.Arm_Connected - s.Arrival_Date_Time))*24 AS "TRANSIT_TIME"
FROM Shipments s,
Vessels v,
Docks d,
Customers c,
Vessel_Tank_Types vtt
WHERE s.shipment_status = 'Closed'
AND s.customer_id = c.customer_id
AND s.vessel_id = v.vessel_id
AND v.tank_type_id = vtt.tank_type_id
AND s.dock_id = d.dock_id
/Here re some further observations:
If I remove all references to the :P90_X fields in the query, it will work albeit with no criteria.
If I do select ":p_90_from_date from dual;" in a test region on the same report page, it works. Seems to be pointing to something with the view. I have since removed the column name references such as porpane(bbls) to propane_bbls in case it was the non standard Oracle column names creating the issue. No change. -
ORA-01006 Using Bind Variables In A Dynamic SQL Contains Query
I have the following dynamic SQL query :-
declare
TYPE typ_sql IS REF CURSOR;
ltyp_sql typ_sql;
lv_sql VARCHAR2(100);
begin
lv_sql := 'SELECT arx_id FROM arx WHERE CONTAINS ';
lv_sql := lv_sql || (arx_full,''(:b1) WITHIN ui'') > 0';
open ltyp_sql FOR v_sql USING ln_id;
fetch ......
close ......
end;
When the code tries to open the cursor it gives the above error. I presume it is the way Oracle is expanding the bind variable but I cannot find anything in the docs to say why this is happening or whether you can do this or not using bind variables ( CONTAINS query ). Any help would be appreciated, thanks,
Stuart.lv_sql || '(arx_full, :b1 || '' within ui'') > 0';
-
Java.sql.SQLException: ORA-01008: not all variables bound
Hi
I have a custom search results page, in the search region user would select a supplier and then searches for the invoices of that supplier by entering the partial value for invoice field, but when i click on invoice LOV i am getting below error.
i am not sure why the system is adding bind variables :3 to :7, please let me know any pointers to resolve the error.
Note: dynamically i am setting the bind variables :1 and :2 but its failing because of the other system added bind variables.
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (select invoice_number,supplier_number,supplier_site,invoice_amount,null invoice_date,null Source,'Invoices' record_location
from audit_invoices
where invoice_number like :1
and supplier_number = :2
union all
select invoice_num,vendor_num,vendor_site_code,invoice_amount,invoice_date,null Source,'InvoiceIT' record_location
from xxit3_invoices
where invoice_num like :1
and vendor_num = :2
union all
select ai.invoice_num,pv.segment1 sup_number,pvs.vendor_site_code,ai.invoice_amount,ai.invoice_date,ai.source,'Payables' record_location
from ap_invoices_all ai,po_vendor_sites_all pvs,po_vendors pv
where invoice_num like :1
and ai.vendor_id = pv.vendor_id
and ai.vendor_site_id = pvs.vendor_site_id
and pv.segment1 = :2) QRSLT WHERE (( UPPER(INVOICE_NUMBER) like :3 AND (INVOICE_NUMBER like :4 OR INVOICE_NUMBER like :5 OR INVOICE_NUMBER like :6 OR INVOICE_NUMBER like :7)))
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormData(OAPageBean.java:2555)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1677)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
at OA.jspService(OA.jsp:33)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
Rgds,
-kamal// Repeated Due to Network Issue.
Kamal,
Replace your VO with the following
* select invoice_number,supplier_number,supplier_site,invoice_amount,null invoice_date,null Source,'Invoices' record_location
from audit_invoices
where invoice_number like :1
and supplier_number = :2
union all
select invoice_num,vendor_num,vendor_site_code,invoice_amount,invoice_date,null Source,'InvoiceIT' record_location
from xxit3_invoices
where invoice_num like :3
and vendor_num = :4
union all
select ai.invoice_num,pv.segment1 sup_number,pvs.vendor_site_code,ai.invoice_amount,ai.invoice_date,ai.source,'Payables' record_location
from ap_invoices_all ai,po_vendor_sites_all pvs,po_vendors pv
where invoice_num like :5
and ai.vendor_id = pv.vendor_id
and ai.vendor_site_id = pvs.vendor_site_id
and pv.segment1 = :6 *
Even though your Bind variable are same but in VO you have to pass the parameter for all the above like above.
And set the whereclause based on the value required in parameter and the others as null.
Hope you got it.
Regards,
Gyan -
Error ORA-01008: Not all variables bound
SELECT
MAX((SELECT TO_CHAR(MAX(a.order_number)) FROM oe_order_headers_All a WHERE a.cust_po_number=ct.purchase_order)) AS order_number1,
MAX(DECODE(CT.PREVIOUS_CUSTOMER_TRX_ID,NULL,ct.interface_header_attribute1,(SELECT ct1.interface_header_attribute1
FROM ra_customer_trx_all CT1
WHERE CT1.CUSTOMER_TRX_ID = CT.PREVIOUS_CUSTOMER_TRX_ID))) AS ORDER_NUMBER,
0 AS order_value,
NVL(ct.purchase_order,SU.LOCATION) purchase_order,
(SELECT SUM(L.ORDERED_QUANTITY*L.UNIT_SELLING_PRICE)
FROM oe_order_lines_all l,
oe_order_headers_all h
WHERE l.header_id = h.header_id
AND h.order_number IN (SELECT MAX(a.order_number) FROM oe_order_headers_All a WHERE a.cust_po_number=ct.purchase_order)) AS order_value1,
null AS CONTRACT_START_DATE,
(SELECT MIN(TRUNC(TO_DATE(l.Attribute14), 'DD'))
FROM oe_order_lines_all l,
oe_order_headers_all h
WHERE l.header_id = h.header_id
AND h.order_number IN (SELECT MAX(a.order_number) FROM oe_order_headers_All a WHERE a.cust_po_number=ct.purchase_order)) AS CONTRACT_START_DATE1,
null AS CONTRACT_END_DATE,
(SELECT MAX(TRUNC(TO_DATE(l.Attribute14), 'DD'))
FROM oe_order_lines_all l,
oe_order_headers_all h
WHERE l.header_id = h.header_id
AND h.order_number IN (SELECT MAX(a.order_number) FROM oe_order_headers_All a WHERE a.cust_po_number=ct.purchase_order)) AS CONTRACT_END_DATE1,
CUST_ACCT.ACCOUNT_NUMBER,
SUBSTRB(party.party_name,1,50) Cust_name,
SU.LOCATION AS MID,
PS.TRX_NUMBER AS INVOICE_NUM,
PS.TRX_DATE AS INVOICE_DATE,
PS.AMOUNT_DUE_ORIGINAL AS INVOICE_VALUE,
ctt.description,
CT.PREVIOUS_CUSTOMER_TRX_ID,
CT.CUSTOMER_TRX_ID,
((SELECT NVL( SUM ( DECODE
( 'Y', 'Y',
(DECODE(ps9.CLASS, 'CM',
DECODE ( ra9.application_type, 'CM',
ra9.acctd_amount_applied_from,
ra9.acctd_amount_applied_to),
ra9.acctd_amount_applied_to) +
NVL(ra9.acctd_earned_discount_taken,0) +
NVL(ra9.acctd_unearned_discount_taken,0) ),
( ra9.amount_applied +
NVL(ra9.earned_discount_taken,0) +
NVL(ra9.unearned_discount_taken,0) )
DECODE
( ps9.CLASS, 'CM',
DECODE(ra9.application_type, 'CM', -1, 1), 1 )
), 0 )
FROM ar_receivable_applications ra9,
ar_cash_receipt_history crh9,
ar_payment_schedules ps9
WHERE (ra9.applied_payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
OR
ra9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID)
AND ra9.status||'' = 'APP'
AND ra9.cash_receipt_history_id = crh9.cash_receipt_history_id(+)
AND (crh9.reversal_gl_date IS NULL
OR crh9.reversal_gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY'))
AND NVL( ra9.confirmed_flag, 'Y' ) = 'Y'
AND ra9.gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY')
AND ps9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
)) + PS.AMOUNT_DUE_REMAINING AMOUNT_DUE_REMAINING,
PS.CUSTOMER_TRX_ID AS PS_CUSTOMER_TRX_ID,
PS.CUST_TRX_TYPE_ID,
PS.CUSTOMER_ID,
PS.CUSTOMER_SITE_USE_ID,
AR1.RECEIPT_NUMBER,
AR1.AMOUNT_APPLIED,
AR1.APPLY_DATE,
ct.interface_header_attribute1,
CASE
WHEN (( ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >=1 ) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 30 ))
THEN ' 1 - 30 Days Due'
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 31) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 60) )
THEN ' 31 - 60 Days Due'
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 61) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 90 ))
THEN ' 61 - 90 Days Due'
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 91) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 180 ))
THEN ' 91 - 180 Days Due'
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 181) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 360 ))
THEN '181 - 360 Days Due'
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 361) )
THEN '361+ Days Due'
ELSE 'Current'
END AS aging,
NULL cash_receipt_id,
AR1.GL_POSTED_DATE,
CASE
WHEN (( ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >=1 ) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 30 ))
THEN
NULL
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 31) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 60) )
THEN
NULL
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 61) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 90 ))
THEN
NULL
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 91) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 180 ))
THEN
NULL
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 181) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 360 ))
THEN
NULL
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 361) )
THEN
NULL
ELSE
((SELECT NVL( SUM ( DECODE
( 'Y', 'Y',
(DECODE(ps9.CLASS, 'CM',
DECODE ( ra9.application_type, 'CM',
ra9.acctd_amount_applied_from,
ra9.acctd_amount_applied_to),
ra9.acctd_amount_applied_to) +
NVL(ra9.acctd_earned_discount_taken,0) +
NVL(ra9.acctd_unearned_discount_taken,0) ),
( ra9.amount_applied +
NVL(ra9.earned_discount_taken,0) +
NVL(ra9.unearned_discount_taken,0) )
DECODE
( ps9.CLASS, 'CM',
DECODE(ra9.application_type, 'CM', -1, 1), 1 )
), 0 )
FROM ar_receivable_applications ra9,
ar_cash_receipt_history crh9,
ar_payment_schedules ps9
WHERE (ra9.applied_payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
OR
ra9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID)
AND ra9.status||'' = 'APP'
AND ra9.cash_receipt_history_id = crh9.cash_receipt_history_id(+)
AND (crh9.reversal_gl_date IS NULL
OR crh9.reversal_gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY'))
AND NVL( ra9.confirmed_flag, 'Y' ) = 'Y'
AND ra9.gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY')
AND ps9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
)) + PS.AMOUNT_DUE_REMAINING
END AS Current_AGE,
CASE
WHEN (( ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >=1 ) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 30 ))
THEN
((SELECT NVL( SUM ( DECODE
( 'Y', 'Y',
(DECODE(ps9.CLASS, 'CM',
DECODE ( ra9.application_type, 'CM',
ra9.acctd_amount_applied_from,
ra9.acctd_amount_applied_to),
ra9.acctd_amount_applied_to) +
NVL(ra9.acctd_earned_discount_taken,0) +
NVL(ra9.acctd_unearned_discount_taken,0) ),
( ra9.amount_applied +
NVL(ra9.earned_discount_taken,0) +
NVL(ra9.unearned_discount_taken,0) )
DECODE
( ps9.CLASS, 'CM',
DECODE(ra9.application_type, 'CM', -1, 1), 1 )
), 0 )
FROM ar_receivable_applications ra9,
ar_cash_receipt_history crh9,
ar_payment_schedules ps9
WHERE (ra9.applied_payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
OR
ra9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID)
AND ra9.status||'' = 'APP'
AND ra9.cash_receipt_history_id = crh9.cash_receipt_history_id(+)
AND (crh9.reversal_gl_date IS NULL
OR crh9.reversal_gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY'))
AND NVL( ra9.confirmed_flag, 'Y' ) = 'Y'
AND ra9.gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY')
AND ps9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
)) + PS.AMOUNT_DUE_REMAINING
END AS S30_Days,
CASE
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 31) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 60) )
THEN
((SELECT NVL( SUM ( DECODE
( 'Y', 'Y',
(DECODE(ps9.CLASS, 'CM',
DECODE ( ra9.application_type, 'CM',
ra9.acctd_amount_applied_from,
ra9.acctd_amount_applied_to),
ra9.acctd_amount_applied_to) +
NVL(ra9.acctd_earned_discount_taken,0) +
NVL(ra9.acctd_unearned_discount_taken,0) ),
( ra9.amount_applied +
NVL(ra9.earned_discount_taken,0) +
NVL(ra9.unearned_discount_taken,0) )
DECODE
( ps9.CLASS, 'CM',
DECODE(ra9.application_type, 'CM', -1, 1), 1 )
), 0 )
FROM ar_receivable_applications ra9,
ar_cash_receipt_history crh9,
ar_payment_schedules ps9
WHERE (ra9.applied_payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
OR
ra9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID)
AND ra9.status||'' = 'APP'
AND ra9.cash_receipt_history_id = crh9.cash_receipt_history_id(+)
AND (crh9.reversal_gl_date IS NULL
OR crh9.reversal_gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY'))
AND NVL( ra9.confirmed_flag, 'Y' ) = 'Y'
AND ra9.gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY')
AND ps9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
)) + PS.AMOUNT_DUE_REMAINING
END AS S31_60_Days,
CASE
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 61) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 90 ))
THEN
((SELECT NVL( SUM ( DECODE
( 'Y', 'Y',
(DECODE(ps9.CLASS, 'CM',
DECODE ( ra9.application_type, 'CM',
ra9.acctd_amount_applied_from,
ra9.acctd_amount_applied_to),
ra9.acctd_amount_applied_to) +
NVL(ra9.acctd_earned_discount_taken,0) +
NVL(ra9.acctd_unearned_discount_taken,0) ),
( ra9.amount_applied +
NVL(ra9.earned_discount_taken,0) +
NVL(ra9.unearned_discount_taken,0) )
DECODE
( ps9.CLASS, 'CM',
DECODE(ra9.application_type, 'CM', -1, 1), 1 )
), 0 )
FROM ar_receivable_applications ra9,
ar_cash_receipt_history crh9,
ar_payment_schedules ps9
WHERE (ra9.applied_payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
OR
ra9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID)
AND ra9.status||'' = 'APP'
AND ra9.cash_receipt_history_id = crh9.cash_receipt_history_id(+)
AND (crh9.reversal_gl_date IS NULL
OR crh9.reversal_gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY'))
AND NVL( ra9.confirmed_flag, 'Y' ) = 'Y'
AND ra9.gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY')
AND ps9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
)) + PS.AMOUNT_DUE_REMAINING
END AS S61_90_Days,
CASE
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 91) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 180 ))
THEN
((SELECT NVL( SUM ( DECODE
( 'Y', 'Y',
(DECODE(ps9.CLASS, 'CM',
DECODE ( ra9.application_type, 'CM',
ra9.acctd_amount_applied_from,
ra9.acctd_amount_applied_to),
ra9.acctd_amount_applied_to) +
NVL(ra9.acctd_earned_discount_taken,0) +
NVL(ra9.acctd_unearned_discount_taken,0) ),
( ra9.amount_applied +
NVL(ra9.earned_discount_taken,0) +
NVL(ra9.unearned_discount_taken,0) )
DECODE
( ps9.CLASS, 'CM',
DECODE(ra9.application_type, 'CM', -1, 1), 1 )
), 0 )
FROM ar_receivable_applications ra9,
ar_cash_receipt_history crh9,
ar_payment_schedules ps9
WHERE (ra9.applied_payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
OR
ra9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID)
AND ra9.status||'' = 'APP'
AND ra9.cash_receipt_history_id = crh9.cash_receipt_history_id(+)
AND (crh9.reversal_gl_date IS NULL
OR crh9.reversal_gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY'))
AND NVL( ra9.confirmed_flag, 'Y' ) = 'Y'
AND ra9.gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY')
AND ps9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
)) + PS.AMOUNT_DUE_REMAINING
END AS S91_180_Days,
CASE
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 181) AND (ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) <= 360 ))
THEN
((SELECT NVL( SUM ( DECODE
( 'Y', 'Y',
(DECODE(ps9.CLASS, 'CM',
DECODE ( ra9.application_type, 'CM',
ra9.acctd_amount_applied_from,
ra9.acctd_amount_applied_to),
ra9.acctd_amount_applied_to) +
NVL(ra9.acctd_earned_discount_taken,0) +
NVL(ra9.acctd_unearned_discount_taken,0) ),
( ra9.amount_applied +
NVL(ra9.earned_discount_taken,0) +
NVL(ra9.unearned_discount_taken,0) )
DECODE
( ps9.CLASS, 'CM',
DECODE(ra9.application_type, 'CM', -1, 1), 1 )
), 0 )
FROM ar_receivable_applications ra9,
ar_cash_receipt_history crh9,
ar_payment_schedules ps9
WHERE (ra9.applied_payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
OR
ra9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID)
AND ra9.status||'' = 'APP'
AND ra9.cash_receipt_history_id = crh9.cash_receipt_history_id(+)
AND (crh9.reversal_gl_date IS NULL
OR crh9.reversal_gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY'))
AND NVL( ra9.confirmed_flag, 'Y' ) = 'Y'
AND ra9.gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY')
AND ps9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
)) + PS.AMOUNT_DUE_REMAINING
END AS S181_360_Days,
CASE
WHEN ((ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 361) )
THEN
((SELECT NVL( SUM ( DECODE
( 'Y', 'Y',
(DECODE(ps9.CLASS, 'CM',
DECODE ( ra9.application_type, 'CM',
ra9.acctd_amount_applied_from,
ra9.acctd_amount_applied_to),
ra9.acctd_amount_applied_to) +
NVL(ra9.acctd_earned_discount_taken,0) +
NVL(ra9.acctd_unearned_discount_taken,0) ),
( ra9.amount_applied +
NVL(ra9.earned_discount_taken,0) +
NVL(ra9.unearned_discount_taken,0) )
DECODE
( ps9.CLASS, 'CM',
DECODE(ra9.application_type, 'CM', -1, 1), 1 )
), 0 )
FROM ar_receivable_applications ra9,
ar_cash_receipt_history crh9,
ar_payment_schedules ps9
WHERE (ra9.applied_payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
OR
ra9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID)
AND ra9.status||'' = 'APP'
AND ra9.cash_receipt_history_id = crh9.cash_receipt_history_id(+)
AND (crh9.reversal_gl_date IS NULL
OR crh9.reversal_gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY'))
AND NVL( ra9.confirmed_flag, 'Y' ) = 'Y'
AND ra9.gl_date+0 > TO_DATE(:SYSDATE1,'DD-MON-YY')
AND ps9.payment_schedule_id = PS.PAYMENT_SCHEDULE_ID
)) + PS.AMOUNT_DUE_REMAINING
END AS S361_plus_Days,
PS.PAYMENT_SCHEDULE_ID
FROM ar_lookups al_status,
ar_collectors ar_coll,
ar_cons_inv_all cons,
ra_cust_trx_types_all ctt,
ra_batch_sources_all bs,
ra_customer_trx_all ct,
hz_cust_site_uses_all su,
hz_cust_accounts cust_acct,
hz_parties party,
ar_payment_schedules_all ps,
AR_RECEIVABLE_APPLICATIONS_V ar1
WHERE
PS.CUSTOMER_ID = CUST_ACCT.CUST_ACCOUNT_ID AND
CUST_ACCT.PARTY_ID = PARTY.PARTY_ID AND
PS.CUSTOMER_SITE_USE_ID = SU.SITE_USE_ID AND
PS.CUSTOMER_TRX_ID = CT.CUSTOMER_TRX_ID AND
CT.BATCH_SOURCE_ID = BS.BATCH_SOURCE_ID AND
CT.CUST_TRX_TYPE_ID = CTT.CUST_TRX_TYPE_ID AND
PS.STATUS = AL_STATUS.LOOKUP_CODE AND
AL_STATUS.LOOKUP_TYPE = 'INVOICE_TRX_STATUS' AND
PS.COLLECTOR_LAST = AR_COLL.COLLECTOR_ID (+) AND
PS.CONS_INV_ID = CONS.CONS_INV_ID (+) AND
PS.STATUS = NVL(ARP_VIEW_CONSTANTS.GET_STATUS,PS.STATUS) AND
su.site_use_code = 'BILL_TO' AND
SU.location NOT LIKE '0%' AND
SU.LOCATION NOT IN ('INTERCO') AND
AR1.CUSTOMER_TRX_ID (+) =PS.CUSTOMER_TRX_ID AND
AR1.CUST_TRX_TYPE_ID(+) =PS.CUST_TRX_TYPE_ID AND
AR1.CUSTOMER_ID (+) =PS.CUSTOMER_ID AND
AR1.BILL_TO_SITE_USE_ID (+) =PS.CUSTOMER_SITE_USE_ID AND
AR1.TRX_CLASS_CODE(+) =PS.CLASS AND
AR1.TRX_NUMBER(+) =PS.TRX_NUMBER AND
SU.ORG_ID =144
--AR1.GL_POSTED_DATE <= TO_DATE(:SYSDATE1,'DD-MON-YY')
--AND ROUND((TO_DATE(:SYSDATE1,'DD-MON-YY') - ps.DUE_DATE),0) >= 181
--and PS.AMOUNT_DUE_REMAINING >0
----and SUBSTRB(party.party_name,1,50) like 'A%'
--AND CUST_ACCT.ACCOUNT_NUMBER IN ( 6319)
&LP_CUST_NO
&LP_CUST_NAME
AND PS.TRX_DATE < = TO_DATE(:SYSDATE1,'DD-MON-YY')
GROUP BY CUST_ACCT.ACCOUNT_NUMBER,
SUBSTRB(party.party_name,1,50),
SU.LOCATION ,
PS.TRX_NUMBER,
PS.TRX_DATE,
PS.AMOUNT_DUE_ORIGINAL,
ctt.description,
CT.PREVIOUS_CUSTOMER_TRX_ID,
CT.CUSTOMER_TRX_ID,
PS.AMOUNT_DUE_REMAINING,
PS.CUSTOMER_TRX_ID,
PS.CUST_TRX_TYPE_ID,
PS.CUSTOMER_ID,
PS.CUSTOMER_SITE_USE_ID,
AR1.RECEIPT_NUMBER,
AR1.AMOUNT_APPLIED,
AR1.APPLY_DATE,
ct.interface_header_attribute1,
ct.purchase_order,
AR1.GL_POSTED_DATE,
ps.DUE_DATE,
PS.PAYMENT_SCHEDULE_IDIn that case do a quick replace of :SYSDATE1 as SYSDATE and try running it.
-
Using bind variables (in & out) with dynamic sql
I got a table that holds pl/sql code snippets to do validations on a set of data. what the code basically does is receiving a ID and returning a number of errors found.
To execute the code I use dynamic sql with two bind variables.
When the codes consists of a simpel query, it works like a charm, for example with this code:
BEGIN
SELECT COUNT (1)
INTO :1
FROM articles atl
WHERE ATL.CSE_ID = :2 AND cgp_id IS NULL;
END;however when I get to some more complex validations that need to do calculations or execute multiple queries, I'm running into trouble.
I've boiled the problem down into this:
DECLARE
counter NUMBER;
my_id NUMBER := 61;
BEGIN
EXECUTE IMMEDIATE ('
declare
some_var number;
begin
select 1 into some_var from dual
where :2 = 61;
:1 := :2;
end;
USING OUT counter, IN my_id;
DBMS_OUTPUT.put_line (counter || '-' || my_id);
END;this code doesn't really make any sense, but it's just to show you what the problem is. When I execute this code, I get the error
ORA-6537 OUT bind variable bound to an IN position
The error doesn't seem to make sense, :2 is the only IN bind variable, and it's only used in a where clause.
As soon as I remove that where clause , the code will work again (giving me 61-61, in case you liked to know).
Any idea whats going wrong? Am I just using the bind variables in a way you're not supposed to use them?
I'm using Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bitCorrection. With execute immediate binding is by position, but binds do not need to be repeated. So my statement above is incorrect..
You need to bind it once only - but bind by position. And the bind must match how the bind variable is used.
If the bind variable never assigns a value in the code, bind as IN.
If the bind variable assigns a value in the code, bind as OUT.
If the bind variable assigns a value and is used a variable in any other statement in the code, bind as IN OUT.
E.g.
SQL> create or replace procedure FooProc is
2 cnt number;
3 id number := 61;
4 begin
5 execute immediate
6 'declare
7 n number;
8 begin
9 select
10 1 into n
11 from dual
12 where :var1 = 61; --// var1 is used as IN
13
14 :var2 := n * :var1; --// var2 is used as OUT and var1 as IN
15 :var2 := -1 * :var2; --// var2 is used as OUT and IN
16 end;
17 '
18 using
19 in out id, in out cnt; --// must reflect usage above
20
21 DBMS_OUTPUT.put_line ( 'cnt='||cnt || ' id=' || id);
22 end;
23 /
Procedure created.
SQL>
SQL> exec FooProc
cnt=-61 id=61
PL/SQL procedure successfully completed.
SQL> -
Ora-01008 error with bind variable
Hi,
We have a test program which have one bind variable on a column which is varchar2(20), in the test program we've passed a 20 character string to the variable. The program returns error in one of the databases but all others are successful. We've checked the column is same in all of them.
Exception in thread "main" java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-01008: not all variables bound
Could you please advise how to troubleshoot this issue?
RegardsWe aren't going to be able to help you if you won't post the database code that is giving the error.
And now we need the Java code that is constructing the query that you are using.
Your error is saying there is a second variable that you are not providing a value for.
And you said
>
We have a test program which have one bind variable on a column which is varchar2(20), in the test program we've passed a 20 character string to the variable.
>
But you are using a string that is 23 characters long
"a3g34-b13fd-efaie-f83fk"How does 23 go into 20? -
BC4J bug with "bind variables" JBO-27122 ORA-01008
I think we are found a BUG using BC4J with bind variables in a view object.
If the bind variable appear in the WHERE condition two or more times at
the beginning of the query the above error occur.
oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement:
SELECT Emp.EMPNO,Emp.ENAME,Emp.JOB,Emp.MGR,Emp.HIREDATE,Emp.SAL,Emp.COMM, Emp.DEPTNO
FROM SCOTT.EMP Emp
WHERE :1 <=10000 and :1 <= sal and :2=20
java.sql.SQLException: ORA-01008: not all variables bound
Otherwise if bind variable apper two or more times, but not together
like this sample:
WHERE :1 <=10000 and :2=20 and :1 <= sal
the error not occur.
We prove this with:
JDeveloper 9.0.5.2 (build 1618)Business Components Version 9.0.5.16.0
JDeveloper 9.0.5.0 (build 1375)Business Components Version 9.0.5.13.52
I looking for a patch! or acceptable workaround.
Tx for your help!
diego.
/* the cliente app */
ApplicationModule am = Configuration.createRootApplicationModule("business_tier.AppModule","AppModuleLocal");
ViewObject vo = am.findViewObject("EmpView");
vo.setWhereClauseParam(0,"100");
vo.setWhereClauseParam(1,"20");
Row emp = vo.first();This is a known bug (1326006). The workaround is to use:
vo.setWhereClauseParam(0,"100");
vo.setWhereClauseParam(1,"20");
vo.setWhereClauseParam(2,"20");
Hope this helps,
Lynn
Java Tools Team -
EA3/EA2/EA1 - Bind Variables in PL/SQL
EA1 seems to have taken a backward step when it comes to supporting bind variables in PL/SQL.
Back in 1.1.3, according to the bugs fixed list, we apparently fixed bug 5884935 (BINDS IN A PL/SQL STATEMENT HAS "NOT ALL VARIABLES BOUND" ERROR), although this was only ever when running as scripts (as per Bind variables in PLSQL bug not fixed?
Now according to the 1.2 documentation, bind variables are not supported in the script runner (section 1.7.2) and the SQL*Plus variable command is not supported (section 1.7.1). However, I can run the following code "successfully" (no errors reported but the substitution text entered does not appear in the dbms_output):
variable bind_text varchar2(30);
declare
l_text varchar2(30);
begin
:bind_text := '&sub_text';
dbms_output.put_line('Bind text: "' || :bind_text || '"');
end;
Now in EA1, running this as a script results in "ORA-01006: bind variable does not exist"
Running the variable statement results in "ORA-00900: Invalid SQL Statement" and running the PL/SQL results in "ORA-1008: not all variables bound".
Can someone from the SQL Developer team please comment on the intended support for bind variables in PL/SQL?
Thanks,
theFurryOneI know that the variable command isn't supported (as I said above), but that was also the case in 1.2, where it did actually sort of work.
I am not talking about local PL/SQL variables declared within the PL/SQL - I am trying to get user entered values into the PL/SQL in the same way as prompting for bind variable values in SQL.
So using SQL Developer bind variables inside PL/SQL is my end goal - preferably when running anonymous PL/SQL blocks as statements in the worksheet.
However, as there have been "fixed" bugs to enable bind variables in PL/SQL, which require the use of SQL Plus commands that are not supported in SQL Developer (ie variable), I am trying to work out what the development team think the intended support for bind variables in PL/SQL is. Then I will know if what I want needs to be reported as a bug or logged as an enhancement request.
theFurryOne -
Parallel Query Error - 1008 Not All Variables Bound
Using DB 10g Enterprise Edition Release 10.2.0.1.0
I am trying to query a table in SQL plus using a bind variable. When I run the query the first time it fails but if I run it again, it works! See the following :
SQL> var b1 number;
SQL> exec :b1 := 133348;
PL/SQL procedure successfully completed.
SQL> set autot on exp stat
SQL> select 2 from pension_details where party_id = :b1;
select 2 from pension_details where party_id = :b1
ERROR at line 1:
ORA-12801: error signaled in parallel query server P001
ORA-01008: not all variables bound
SQL> /
2
2
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1 Bytes=11)
1 0 INDEX (RANGE SCAN) OF 'PENDTL_PK' (INDEX (UNIQUE)) (Cost=2
Card=1 Bytes=11)
If I add a hint suppressing the parallel index option, then it works first time :
1* select /*+NOPARALLEL_INDEX (PENSION_DETAILS) */ 4 from pension_details where party_id = :b1
SQL> /
4
4
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1 Bytes=11)
1 0 INDEX (RANGE SCAN) OF 'PENDTL_PK' (INDEX (UNIQUE)) (Cost=2
Card=1 Bytes=11)
Can anyone shed any light on why this happens or what I need to check on the table and index? I have tried to replicate this on a different table (and a different db) with the parallel option on both the table and index but it works fine!Seeing as there have been no replies, I thought I would update my own thread!
It turns out this is a bug that has been fixed in 11i. The fix has been back-ported to certain versions/os's.
I will post the bug reference (it is on Metalink somewhere!) later. In the meantime, a workaround is to use the noparrallel_index hint. -
Parameters & Not all variables bound
select like this:
select *
from t_department
where (:param is null and parent_id is null) or
parent_id = :param
OracleParameter Param = new OracleParameter("param",OracleDbType.NVarchar2,null,ParameterDirection.Input);
dbCommand.Parameters.Add(Param);
OracleDataReader dbReader = dbCommand.ExecuteReader(CommandBehavior.SingleResult);
Result: ORA-01008: Not all variables bound.You need 2 parameters bind calls for that (even though you use the same name :param, ODP.NET does care about the name by default, more later on that)
You should repeat the same call again to bind to the 2nd ':param'
OracleParameter Param = new OracleParameter("param",OracleDbType.NVarchar2,null,ParameterDirection.Input);
dbCommand.Parameters.Add(Param);
Remember ODP.NET is use bind by position by default (The first OracleParameters in the Collection binds to the first ":param", then the 2nd to ":param"). you can do named bind by setting OracleCommand.BindByName property.
Arnold
Maybe you are looking for
-
Hi, My iMovie program stops responding upon opening. I can't figure it out. I haven't really used it in the past but I would like to start. My Mac is one of those aluminum Macbooks that look like a macbook pro and were on the market for a little b
-
Video Podcasts not being saved.
With a fresh install of Windows XP and iTunes, Video Podcasts were not be saved after download and processing. Discovered that Quicktime must be installed separately for Video Podcasts to work correctly with iTunes. There was a "warning" with iTunes
-
How do you add separate signatures to email accounts
Have a woke email address and personal address, would like to add different signatures. Verizon support says it's not possible.
-
JDeveloper extension with XSL mapper
We want to develop a JDeveloper custom extension (a wizard). In one of the wizard pages, we want to use the JDeveloper's XSL mapper for one of the function. Can you please advise whether it is possible. If yes, any details would be highly appreciated
-
Seeing full Screen in Centurytel's new email program
Centurytel rolled out a new mail program last weekend. When I retrieve my email through the Web, I cannot see the entire Centurytel screen--hence cannot view certain commands on the right side. Centurytel techs think I am stupid. I have screen resolu