ORA-01007 - variable not in select list error in pl\sql code

Hi,
When I tried to run this program I am getting below error:
ORA-01007 - variable not in select list.Please help to resolve.
Code:
create or replace procedure "XX_BPM_DATA_P" (P_PROCESS_ID IN VARCHAR2)
is
TYPE l_entity_type IS TABLE OF xx_BPM_data.ENTITY%TYPE INDEX BY PLS_INTEGER;
TYPE l_data_type IS TABLE OF XX_BPM_DATA.DATA%TYPE INDEX BY PLS_INTEGER;
TYPE l_count_type IS TABLE OF XX_BPM_DATA.count%TYPE INDEX BY PLS_INTEGER;
l_Entity_v l_Entity_type;
l_data_v l_data_type;
l_count_v l_count_type;
l_security_group_id number;
app_id number(20);
l_Actual_value XX_BPM_DATA.DATA%TYPE;
cursor BPM_CUR is select id,process_id , sequence, to_char(query) query,report_num from xx_test_bpm_dynamic
where
    process_id = p_process_id
       and report_num=1
order by process_id, sequence;
BEGIN
--delete xx_bpm_data where process_id = p_process_id;
for bpm_rec in bpm_cur
loop
delete xx_bpm_data
where process_id = bpm_rec.process_id
and sequence = bpm_rec.sequence
and report_num = bpm_rec.report_num;
l_security_group_id := apex_custom_auth.get_session_id_from_cookie;
--dbms_output.put_line(l_security_group_id);
execute immediate bpm_rec.query BULK COLLECT INTO l_ENTITY_v,l_DATA_v,l_count_v;
if (bpm_rec.report_num=2) then
app_id:= 108;--NV('APP_ID');
FORALL i IN l_ENTITY_v.FIRST..L_ENTITY_V.LAST
INSERT INTO XX_BPM_DATA
    (EnTITY,
value,data,count,
Process_ID,
Sequence,report_num)
VALUES(l_entity_v(i),
l_data_v(i),
'<A HREF="f?p='||app_id||':301:'||':APP_SESSION'||'::::P301_process_id,p301_sequence,p301_id,p301_entity:'||bpm_rec.process_id||','||bpm_rec.sequence||','||bpm_rec.id||','||l_entity_v(i)||':">'||l_data_v(i)||'</A>',
    l_count_v(i),bpm_rec.process_id,
BPM_rec.sequence,
bpm_rec.report_num);
else
FORALL i IN l_ENTITY_v.FIRST..L_ENTITY_V.LAST
INSERT INTO XX_BPM_DATA(EnTITY,data,
    count,
Process_ID,
Sequence,report_num)
VALUES(l_entity_v(i),
l_data_v(i),
    l_count_v(i),
    bpm_rec.process_id,
BPM_rec.sequence,
bpm_rec.report_num);
end if;
select round(avg(value),2) into l_actual_value from xx_bpm_data where process_id=bpm_rec.process_id and sequence=bpm_rec.sequence and report_num=bpm_rec.report_num;
update xx_test_bpm_dynamic set value=l_actual_value where process_id=bpm_rec.process_id and sequence=Bpm_rec.sequence and report_num= bpm_rec.report_num;
end loop;
Commit;
END;

When I tried to run this program I am getting below error:
ORA-01007 - variable not in select list.Please help to resolve.
You likely would not need any help in you wrote and tested your code using standard best practices.
Your code has NO exception handler and you are NOT identifying each step in the code so that the exception handler could print/log a message telling you EXACTLY which step raised the exception.,
v_step NUMBER;
-- before step 1
v_step := 1;
-- before step 2
v_step := 2;
Then in the exception handler the value of 'v_step' will tell you which step raised the exception.
The exception you posted refers to a 'select list' so examine ALL of the select lists in your code. If you do that you will see that the primary query being run is obtained from a database table and then executed using dynamic SQL
execute immediate bpm_rec.query BULK COLLECT INTO l_ENTITY_v,l_DATA_v,l_count_v;
We have no way of knowing what query is in 'bpm_rec.query' when the exception happens or what columns that query returns. For all we know the query returns 2 columns and you are trying to load 3 collections. Or maybe the query returns 8 columns and you are trying to load 3 collections.
Why don't you print out the query and execute it manually so you can see exactly what the result set looks like?
dbms_output.put_line(bpm_rec.query);
And don't even get us started on why you are using such security-prone dynamic sql to perform this processing instead of using ordinary SQL statements. Or why you are using associative arrays for the BULK COLLECT instead of nested tables.
In short your code could blow up in several places and, because you have NO logging statements, control statements or exception handlers, anyone having to troubleshoot that code would have absolutely no idea what part of it may be the problem.

Similar Messages

  • Error while extending seeded page VO ORA-01007: variable not in select list

    hi all,
    i am trying to extend seeded vo on page after changing query of VO, i am getting this error on page
    please help it urgent
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT PPF.PERSON_ID, PPF.EFFECTIVE_START_DATE, PPF.EFFECTIVE_END_DATE, VAC.VACANCY_ID, PPB.PAY_BASIS_ID, null as PAY_PROPOSAL_ID, POV.VENDOR_ID, IPC.POSTING_CONTENT_ID, Sex.LOOKUP_TYPE, Sex.LOOKUP_CODE, MAR.LOOKUP_TYPE AS LOOKUP_TYPE1, MAR.LOOKUP_CODE AS LOOKUP_CODE1, TIT.LOOKUP_TYPE AS LOOKUP_TYPE2, TIT.LOOKUP_CODE AS LOOKUP_CODE2, PPF.APPLICANT_NUMBER, PPF.DATE_OF_BIRTH, PPF.EMAIL_ADDRESS, TIT.MEANING, PPF.FULL_NAME, PPF.FIRST_NAME, PPF.HONORS, PPF.LAST_NAME, PPF.KNOWN_AS, PPF.MIDDLE_NAMES, NAT.MEANING AS NATIONALITY, PPF.NATIONAL_IDENTIFIER, PPF.PREVIOUS_LAST_NAME, PPF.SUFFIX, Sex.MEANING AS MEANING1, MAR.MEANING AS MARITAL_STATUS_MEANING, PPF.ATTRIBUTE_CATEGORY, PPF.ATTRIBUTE1, PPF.ATTRIBUTE2, PPF.ATTRIBUTE3, PPF.ATTRIBUTE4, PPF.ATTRIBUTE5, PPF.ATTRIBUTE6, PPF.ATTRIBUTE7, PPF.ATTRIBUTE8, PPF.ATTRIBUTE9, PPF.ATTRIBUTE10, PPF.ATTRIBUTE11, PPF.ATTRIBUTE12, PPF.ATTRIBUTE13, PPF.ATTRIBUTE14, PPF.ATTRIBUTE15, PPF.ATTRIBUTE16, PPF.ATTRIBUTE17, PPF.ATTRIBUTE18, PPF.ATTRIBUTE19, PPF.ATTRIBUTE20, PPF.ATTRIBUTE21, PPF.ATTRIBUTE22, PPF.ATTRIBUTE23, PPF.ATTRIBUTE24, PPF.ATTRIBUTE25, PPF.ATTRIBUTE26, PPF.ATTRIBUTE27, PPF.ATTRIBUTE28, PPF.ATTRIBUTE29, PPF.ATTRIBUTE30, PPF.PER_INFORMATION_CATEGORY, PPF.PER_INFORMATION1, PPF.PER_INFORMATION2, PPF.PER_INFORMATION3, PPF.PER_INFORMATION4, PPF.PER_INFORMATION5, PPF.PER_INFORMATION6, PPF.PER_INFORMATION7, PPF.PER_INFORMATION8, PPF.PER_INFORMATION9, PPF.PER_INFORMATION10, PPF.PER_INFORMATION11, PPF.PER_INFORMATION12, PPF.PER_INFORMATION13, PPF.PER_INFORMATION14, PPF.PER_INFORMATION15, PPF.PER_INFORMATION16, PPF.PER_INFORMATION17, PPF.PER_INFORMATION18, PPF.PER_INFORMATION19, PPF.PER_INFORMATION20, PPF.PER_INFORMATION21, PPF.PER_INFORMATION22, PPF.PER_INFORMATION23, PPF.PER_INFORMATION24, PPF.PER_INFORMATION25, PPF.PER_INFORMATION26, PPF.PER_INFORMATION27, PPF.PER_INFORMATION28, PPF.PER_INFORMATION29, PPF.PER_INFORMATION30, PPF.ORIGINAL_DATE_OF_HIRE, PPF.TOWN_OF_BIRTH, PPF.REGION_OF_BIRTH, COB.TERRITORY_SHORT_NAME AS COUNTRY_OF_BIRTH, ORG.NAME AS ORG_NAME, ORG.ORGANIZATION_ID, VAC.NAME, VAC.DESCRIPTION, PPB.NAME AS NAME3, PPB.PAY_BASIS, PPB.ANNUALIZED_HOURS, null as PROPOSED_SALARY_N, null as REVIEW_DATE, POV.VENDOR_NAME, IPC.NAME AS POSTING_NAME, ( Select pet.input_currency_code from PAY_INPUT_VALUES_F piv, PAY_ELEMENT_TYPES_F pet where piv.input_value_id = PPB.input_value_id AND trunc(sysdate) BETWEEN piv.effective_start_date AND piv.effective_end_date AND pet.element_type_id = piv.element_type_id AND trunc(sysdate) BETWEEN pet.effective_start_date AND pet.effective_end_date ) AS CURRENCY ,null as OFFER_ID, null as DISCRETIONARY_JOB_TITLE, null as PROPOSED_START_DATE, null as EXPIRY_DATE, null as ATTRIBUTE_CATEGORY1, null as OFFERS_ATTRIBUTE1, null as OFFERS_ATTRIBUTE2, null as OFFERS_ATTRIBUTE3, null as OFFERS_ATTRIBUTE4, null as OFFERS_ATTRIBUTE5, null as OFFERS_ATTRIBUTE6, null as OFFERS_ATTRIBUTE7, null as OFFERS_ATTRIBUTE8, null as OFFERS_ATTRIBUTE9, null as OFFERS_ATTRIBUTE10, null as OFFERS_ATTRIBUTE11, null as OFFERS_ATTRIBUTE12, null as OFFERS_ATTRIBUTE13, null as OFFERS_ATTRIBUTE14, null as OFFERS_ATTRIBUTE15, null as OFFERS_ATTRIBUTE16, null as OFFERS_ATTRIBUTE17, null as OFFERS_ATTRIBUTE18, null as OFFERS_ATTRIBUTE19, null as OFFERS_ATTRIBUTE20, null as OFFERS_ATTRIBUTE21, null as OFFERS_ATTRIBUTE22, null as OFFERS_ATTRIBUTE23, null as OFFERS_ATTRIBUTE24, null as OFFERS_ATTRIBUTE25, null as OFFERS_ATTRIBUTE26, null as OFFERS_ATTRIBUTE27, null as OFFERS_ATTRIBUTE28, null as OFFERS_ATTRIBUTE29, null as OFFERS_ATTRIBUTE30 ,null as ASSIGNMENT_ID, null as EFFECTIVE_START_DATE1, null as EFFECTIVE_END_DATE1, null as DATE_PROBATION_END, null as NORMAL_HOURS, null as PERF_REVIEW_PERIOD, null as PERF_REVIEW_PERIOD_FREQUENCY, null as SAL_REVIEW_PERIOD, null as SAL_REVIEW_PERIOD_FREQUENCY, null as TIME_NORMAL_START, null as TIME_NORMAL_FINISH, null as ASS_ATTRIBUTE_CATEGORY, null as ASS_ATTRIBUTE1, null as ASS_ATTRIBUTE2, null as ASS_ATTRIBUTE3, null as ASS_ATTRIBUTE4, null as ASS_ATTRIBUTE5, null as ASS_ATTRIBUTE6, null as ASS_ATTRIBUTE7, null as ASS_ATTRIBUTE8, null as ASS_ATTRIBUTE9, null as ASS_ATTRIBUTE10, null as ASS_ATTRIBUTE11, null as ASS_ATTRIBUTE12, null as ASS_ATTRIBUTE13, null as ASS_ATTRIBUTE14, null as ASS_ATTRIBUTE15, null as ASS_ATTRIBUTE16, null as ASS_ATTRIBUTE17, null as ASS_ATTRIBUTE18, null as ASS_ATTRIBUTE19, null as ASS_ATTRIBUTE20, null as ASS_ATTRIBUTE21, null as ASS_ATTRIBUTE22, null as ASS_ATTRIBUTE23, null as ASS_ATTRIBUTE24, null as ASS_ATTRIBUTE25, null as ASS_ATTRIBUTE26, null as ASS_ATTRIBUTE27, null as ASS_ATTRIBUTE28, null as ASS_ATTRIBUTE29, null as ASS_ATTRIBUTE30, null as PROJECT_TITLE ,JOB.JOB_ID, JOB.NAME AS NAME2 ,null AS ADDRESS_ID, null AS ADDRESS_LINE1, null AS ADDRESS_LINE2, null AS ADDRESS_LINE3, null AS ADDRESS_TYPE, null AS COUNTRY, null AS POSTAL_CODE, null AS REGION_1, null AS REGION_2, null AS REGION_3, null AS TOWN_OR_CITY, null AS DERIVED_LOCALE ,GRD.NAME AS NAME1, GRD.GRADE_ID ,LOC.STYLE, LOC.ADDRESS_LINE_1 AS ADDRESS_LINE11, LOC.ADDRESS_LINE_2 AS ADDRESS_LINE21, LOC.ADDRESS_LINE_3 AS ADDRESS_LINE31, LOC.TOWN_OR_CITY AS TOWN_OR_CITY1, LOC.COUNTRY AS COUNTRY1, LOC.POSTAL_CODE AS POSTAL_CODE1, LOC.REGION_1 AS REGION11, LOC.REGION_2 AS REGION21, LOC.REGION_3 AS REGION31, LOC.DERIVED_LOCALE AS DERIVED_LOCALE1, LOC.LOCATION_ID ,null as POSITION_NAME, null as POSITION_ID, null as POS_EFFECTIVE_START_DATE, null as POS_EFFECTIVE_END_DATE ,MGRTIT.MEANING AS MANAGER_TITLE_MEANING, MGR.FULL_NAME AS FULL_NAME1, MGR.EFFECTIVE_START_DATE AS MGR_EFFECTIVE_START_DATE, MGR.EFFECTIVE_END_DATE AS MGR_EFFECTIVE_END_DATE, MGR.FIRST_NAME AS MANAGER_FIRST_NAME, MGR.LAST_NAME AS MANAGER_LAST_NAME, MGR.HONORS AS MANAGER_HONORS, MGR.KNOWN_AS AS MANAGER_KNOWN_AS, MGR.PERSON_ID AS PERSON_ID1, MGRTIT.LOOKUP_TYPE AS LOOKUP_TYPE4, MGRTIT.LOOKUP_CODE AS LOOKUP_CODE4, MGRPHN.PHONE_NUMBER AS MGR_PHONE_NUMBER, MGRPHN.PHONE_ID, MGRFAX.PHONE_NUMBER AS MGR_FAX_NUMBER, MGRFAX.PHONE_ID AS PHONE_ID1 ,RECTIT.MEANING AS RECRUITER_TITLE_MEANING, REC.FULL_NAME AS RECRUITER_FULL_NAME, REC.EFFECTIVE_START_DATE AS EFFECTIVE_START_DATE2, REC.EFFECTIVE_END_DATE AS EFFECTIVE_END_DATE2, REC.FIRST_NAME AS FIRST_NAME2, REC.LAST_NAME AS LAST_NAME2, REC.HONORS AS HONORS2, REC.KNOWN_AS AS KNOWN_AS2, REC.PERSON_ID AS PERSON_ID2, RECTIT.LOOKUP_TYPE AS LOOKUP_TYPE3, RECTIT.LOOKUP_CODE AS LOOKUP_CODE3, RECPHN.PHONE_NUMBER AS REC_PHONE_NUMBER, RECPHN.PHONE_ID AS PHONE_ID2, RECFAX.PHONE_NUMBER AS REC_FAX_NUMBER3, RECFAX.PHONE_ID AS PHONE_ID3 FROM PER_ALL_PEOPLE_F PPF, PER_ALL_VACANCIES VAC, PER_PAY_BASES PPB, PO_VENDORS POV, HR_ALL_ORGANIZATION_UNITS_VL ORG, IRC_AGENCY_VACANCIES IAV, IRC_POSTING_CONTENTS_VL IPC, HR_LOOKUPS Sex, HR_LOOKUPS MAR, HR_LOOKUPS TIT, HR_LOOKUPS NAT, FND_TERRITORIES_VL COB ,PER_JOBS_VL JOB ,PER_GRADES_VL GRD ,HR_LOCATIONS_ALL_VL LOC ,PER_ALL_PEOPLE_F MGR, HR_LOOKUPS MGRTIT, PER_PHONES MGRPHN, PER_PHONES MGRFAX ,PER_ALL_PEOPLE_F REC, HR_LOOKUPS RECTIT, PER_PHONES RECPHN, PER_PHONES RECFAX WHERE PPF.person_id = 1476389 and trunc(sysdate) between PPF.effective_start_date and PPF.effective_end_date and VAC.vacancy_id = 52851 and PPB.pay_basis_id(+) = 350 and ORG.organization_id(+) = 7036 and VAC.vacancy_id = IAV.vacancy_id(+) and IAV.agency_id = POV.vendor_id(+) and VAC.primary_posting_id = IPC.posting_content_id(+) and PPF.sex = SEX.lookup_code(+) and SEX.lookup_type(+) = 'SEX' and PPF.title = TIT.lookup_code(+) and TIT.lookup_type(+) = 'TITLE' and PPF.marital_status = MAR.lookup_code(+) and MAR.lookup_type(+) = 'MAR_STATUS' and PPF.nationality = NAT.lookup_code(+) and NAT.lookup_type(+) = 'NATIONALITY' and PPF.COUNTRY_OF_BIRTH = COB.TERRITORY_CODE(+) and JOB.job_id(+) = 10772 and GRD.grade_id(+) = 2265 and LOC.location_id(+) = 1057 and MGR.person_id(+) = 730283 and trunc(sysdate) between MGR.effective_start_date(+) and MGR.effective_end_date(+) and MGR.title = MGRTIT.lookup_code(+) and MGRTIT.lookup_type(+) = 'TITLE' and MGR.PERSON_ID = MGRPHN.PARENT_ID(+) and MGRPHN.PARENT_TABLE(+) = 'PER_ALL_PEOPLE_F' and nvl(MGRPHN.phone_type(+), 'W1') = 'W1' and trunc(sysdate) between nvl(MGRPHN.date_from, trunc(sysdate)) and NVL(MGRPHN.date_to, trunc(sysdate)) and MGR.PERSON_ID = MGRFAX.PARENT_ID(+) and MGRFAX.PARENT_TABLE(+) = 'PER_ALL_PEOPLE_F' and nvl(MGRFAX.phone_type(+), 'WF') = 'WF' and trunc(sysdate) between nvl(MGRFAX.date_from, trunc(sysdate)) and NVL(MGRPHN.date_to, trunc(sysdate)) and REC.person_id(+) = 704260 and trunc(sysdate) between REC.effective_start_date(+) and REC.effective_end_date(+) and REC.title = RECTIT.lookup_code(+) and RECTIT.lookup_type(+) = 'TITLE' and REC.PERSON_ID = RECPHN.PARENT_ID(+) and RECPHN.PARENT_TABLE(+) = 'PER_ALL_PEOPLE_F' and nvl(RECPHN.phone_type(+), 'W1') = 'W1' and trunc(sysdate) between nvl(RECPHN.date_from, trunc(sysdate)) and NVL(RECPHN.date_to, trunc(sysdate)) and REC.PERSON_ID = RECFAX.PARENT_ID(+) and RECFAX.PARENT_TABLE(+) = 'PER_ALL_PEOPLE_F' and trunc(sysdate) between nvl(RECFAX.date_from, trunc(sysdate)) and NVL(RECFAX.date_to, trunc(sysdate))
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:975)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:211)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:133)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:784)
         at oracle.apps.per.irc.offers.webui.IrcSaveForLaterCO.processFormRequest(IrcSaveForLaterCO.java:208)
         at oracle.apps.per.irc.offers.webui.CreateOfferCO.processFormRequest(CreateOfferCO.java:181)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:810)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1159)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2675)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1682)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         at oa_html._OA._jspService(_OA.java:85)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01007: variable not in select list
         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:590)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1973)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1119)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2566)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2963)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:658)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:584)
         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:4507)
         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.per.irc.offers.server.OfferLetterDetailsVOImpl.executeQuery(OfferLetterDetailsVOImpl.java:621)
         at oracle.apps.per.irc.offers.server.OffersAMImpl.getXMLDataFromBaseTables(OffersAMImpl.java:1523)
         at oracle.apps.per.irc.offers.server.OffersAMImpl.getOfferLetterDataBlobDirect(OffersAMImpl.java:2186)
         at oracle.apps.per.irc.offers.server.OffersAMImpl.getXMLData(OffersAMImpl.java:1627)
         at oracle.apps.per.irc.offers.server.OffersAMImpl.apiValidate(OffersAMImpl.java:2167)
         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:324)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:190)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:133)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:784)
         at oracle.apps.per.irc.offers.webui.IrcSaveForLaterCO.processFormRequest(IrcSaveForLaterCO.java:208)
         at oracle.apps.per.irc.offers.webui.CreateOfferCO.processFormRequest(CreateOfferCO.java:181)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:810)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1159)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2675)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1682)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         at oa_html._OA._jspService(_OA.java:85)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    java.sql.SQLException: ORA-01007: variable not in select list
         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:590)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1973)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1119)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2566)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2963)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:658)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:584)
         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:4507)
         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.per.irc.offers.server.OfferLetterDetailsVOImpl.executeQuery(OfferLetterDetailsVOImpl.java:621)
         at oracle.apps.per.irc.offers.server.OffersAMImpl.getXMLDataFromBaseTables(OffersAMImpl.java:1523)
         at oracle.apps.per.irc.offers.server.OffersAMImpl.getOfferLetterDataBlobDirect(OffersAMImpl.java:2186)
         at oracle.apps.per.irc.offers.server.OffersAMImpl.getXMLData(OffersAMImpl.java:1627)
         at oracle.apps.per.irc.offers.server.OffersAMImpl.apiValidate(OffersAMImpl.java:2167)
         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:324)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:190)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:133)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:784)
         at oracle.apps.per.irc.offers.webui.IrcSaveForLaterCO.processFormRequest(IrcSaveForLaterCO.java:208)
         at oracle.apps.per.irc.offers.webui.CreateOfferCO.processFormRequest(CreateOfferCO.java:181)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:810)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1159)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2675)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1682)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         at oa_html._OA._jspService(_OA.java:85)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)

    Hi Vivek,
    have a look on below comments, it may help you.
    This problem will occur if you have application developed in older JDeveloper version (i.e. 9.0.5) deployed on OAS 9.0.x. In older versions there was no syntax check of this type in a data source class. But there is a workaround. Instead of using oracle.jdbc.pool.OracleDataSource data source class within ojdbc14.jar you can use oracle.jdbc.pool.OracleDataSource within classes12.jar.
    Classes12.jar was used in older OAS versions.
    All you have to do is to copy classes12.jar to $ORACLE_HOME/jdbc/lib and then in OAS Server Properties screen in java options add:
    -Xbootclasspath/p:/$ORACLE_HOME/jdbc/lib/classes12.jar statement.
    Rename ojdbc14.jar to ojdbc14.zip, restart the OAS instance. This should work.
    Regards,
    Naren.

  • List View Report with pipelined function in Mobile application and ORA-01007: variable not in select list

    Hi!
    I have a problem with List View Report in mobile application (theme 50 in apex) after updating to apex 4.2.2. I created Report -> List View. I used select from pipelined function in Region Source. Then when page is running and submited three times (or refreshed three times) I get an error:
    Error during rendering of region "LIST VIEW".
    ORA-01007: variable not in select list
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -1007
    ora_sqlerrm: ORA-01007: variable not in select list
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 21230833903737364557
    component.name: LIST VIEW
    error_backtrace:
         ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 4613
         ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3220
    I get this error only when I use select from pipelined function in Region Source (for example: "select value1, value2 from table(some_pipelined_function(param1, param2)) ").
    You can check it on http://apex.oracle.com/pls/apex/f?p=50591 (login - demo, password - demo).
    In this application:
    - I created package TAB_TYPES_PKG:
    create or replace PACKAGE TAB_TYPES_PKG IS
    TYPE cur_rest_r IS RECORD (
        STR_NAME          VARCHAR2(128),
        INFO              VARCHAR2(128)
    TYPE cur_rest_t IS TABLE OF cur_rest_r;
    END TAB_TYPES_PKG;
    - I created pipelined function TEST_FUNC:
    create or replace
    FUNCTION TEST_FUNC
    RETURN TAB_TYPES_PKG.cur_rest_t  PIPELINED IS
    r_cur_rest TAB_TYPES_PKG.cur_rest_r;
    BEGIN
    r_cur_rest.STR_NAME := 'ROW 1';
    r_cur_rest.INFO := '10';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 2';
    r_cur_rest.INFO := '20';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 3';
    r_cur_rest.INFO := '30';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 4';
    r_cur_rest.INFO := '40';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 5';
    r_cur_rest.INFO := '50';
    PIPE ROW (r_cur_rest);
    RETURN;
    END TEST_FUNC;
    - I created List View Report on Page 1:
    Region Source:
    SELECT str_name,
           info
    FROM TABLE (TEST_FUNC)
    We can see error ORA-01007 after refresing (or submiting) Page 1 three times or more.
    How to fix it?

    Hi all
    I'm experiencing the same issue.  Predictably on every third refresh I receive:
    Error
    Error during rendering of region "Results".
    ORA-01007: variable not in select list
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -1007
    ora_sqlerrm: ORA-01007: variable not in select list
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 6910805644140264
    component.name: Results
    error_backtrace: ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 4613 ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3220
    OK
    I am running Application Express 4.2.2.00.11 on GlassFish 4 using Apex Listener 2.0.3.221.10.13.
    Please note: this works perfectly using a classic report in my desktop application; however, no joy on the mobile side with a list view.  I will use a classic report in the interim.
    My region source is as follows:
    SELECT description AS "DESCRIPTION", reference AS "REFERENCE" FROM TABLE(AUTOCOMPLETE_LIST_VIEW_FNC('RESULTS'))
    The procedure:
      FUNCTION AUTOCOMPLETE_LIST_VIEW_FNC(
          p_collection_name IN VARCHAR2)
        RETURN list_row_table_type
      AS
        v_tab list_row_table_type := list_row_table_type();
      BEGIN
        DECLARE
          jsonarray json_list;
          jsonobj json;
          json_clob CLOB;
        BEGIN
          SELECT clob001
          INTO json_clob
          FROM apex_collections
          WHERE collection_name = p_collection_name;
          jsonobj              := json(json_clob);
          jsonarray            := json_ext.get_json_list(jsonobj, 'predictions');
          FOR i IN 1..jsonArray.count
          LOOP
            jsonobj := json(jsonArray.get(i));
            v_tab.extend;
            v_tab(v_tab.LAST) := list_row_type(json_ext.get_string(jsonobj, 'description'), json_ext.get_string(jsonobj, 'reference'));
          END LOOP;
          RETURN(v_tab);
        END;  
      END AUTOCOMPLETE_LIST_VIEW_FNC;
    Thanks!
    Tim

  • ORA-01007 - variable not in select list - Oracle forms 6i

    Hi!
    I´m creating an form with one field called "txtquery". The user can write a query on this field and click on button with code above. The form will create a text file with the result of the query writing. I managed to create a function in oracle and it worked perfectly but I want to solve without creating any object in the database.
    Sorry for my bad english!
    I wrote the following code:
    DECLARE
       VISCONNECTED BOOLEAN;
       VCONEXAO EXEC_SQL.CONNTYPE;
       VARQUIVO_SAIDA TEXT_IO.FILE_TYPE;
       VCURSOR EXEC_SQL.CURSTYPE;
       VCOLUMNVALUE VARCHAR2(2000);
       VSTATUS PLS_INTEGER;
       VNUMCOLUNAS NUMBER DEFAULT 0;
       VSEPARADOR VARCHAR2(10) DEFAULT ';';
       VCONTADOR NUMBER DEFAULT 0;
    BEGIN
       VCONEXAO := EXEC_SQL.DEFAULT_CONNECTION;
       VISCONNECTED := EXEC_SQL.IS_CONNECTED;
       IF NOT VISCONNECTED THEN
          MSG_ALERT('Não conectado.', 'E', TRUE);
       ELSE
          VCURSOR := EXEC_SQL.OPEN_CURSOR;
       END IF;
       BEGIN
          EXEC_SQL.PARSE(VCONEXAO, VCURSOR, :BLK.TXTQUERY, EXEC_SQL.V7);
       EXCEPTION
       WHEN OTHERS THEN
          MSG_ALERT('Ocorreu o erro ' || SQLERRM || ' executando parse da query!', 'E', TRUE);
       END;
       BEGIN
          IF TEXT_IO.IS_OPEN(VARQUIVO_SAIDA) THEN
             TEXT_IO.FCLOSE(VARQUIVO_SAIDA);
          END IF;
          VARQUIVO_SAIDA := TEXT_IO.FOPEN(:BLK.TXTDIRECTORY || :BLK.TXTFILENAME, 'w');
       EXCEPTION
       WHEN OTHERS THEN
          MSG_ALERT('Ocorreu o erro ' || SQLERRM || ' criando arquivo no disco!', 'E', TRUE);
       END;
       BEGIN
          FOR I IN 1 .. 255 LOOP
             BEGIN
                EXEC_SQL.DEFINE_COLUMN(VCURSOR, I, VCOLUMNVALUE, 2000);
                VNUMCOLUNAS := I;
             EXCEPTION
             WHEN OTHERS THEN
                IF (SQLCODE = -1007) THEN
                   EXIT;
                ELSE
                   RAISE FORM_TRIGGER_FAILURE;
                END IF;
             END;
          END LOOP;
       EXCEPTION
       WHEN OTHERS THEN
          MSG_ALERT('Ocorreu o erro ' || SQLERRM || ' executando define_column!', 'E', TRUE);
       END;
       EXEC_SQL.DEFINE_COLUMN(VCURSOR, 1, VCOLUMNVALUE, 20000);
       BEGIN
          VSTATUS := EXEC_SQL.EXECUTE(VCURSOR); -- ----------------------->> ERROR HERE!!!!!!!!
       EXCEPTION
       WHEN OTHERS THEN
          MSG_ALERT('Ocorreu o erro ' || EXEC_SQL.LAST_ERROR_MESG || ' fazendo execute para a query!', 'E', TRUE);
       END;
       BEGIN
          LOOP
             EXIT WHEN(EXEC_SQL.FETCH_ROWS(VCURSOR) <= 0);
             VSEPARADOR := '';
             FOR I IN 1 .. VNUMCOLUNAS LOOP
                 EXEC_SQL.COLUMN_VALUE(VCURSOR, I, VCOLUMNVALUE);
                 TEXT_IO.PUT_LINE(VARQUIVO_SAIDA, VSEPARADOR || VCOLUMNVALUE);
                 VSEPARADOR := :BLK.TXTSEPARATOR;
             END LOOP;
             TEXT_IO.NEW_LINE(VARQUIVO_SAIDA);
             VCONTADOR := VCONTADOR + 1;
          END LOOP;
       EXCEPTION
       WHEN OTHERS THEN
          MSG_ALERT('Ocorreu o erro ' || SQLERRM || ' criando linhas no arquivo texto!', 'E', TRUE);
       END;
       BEGIN
          EXEC_SQL.CLOSE_CURSOR(VCURSOR);
       EXCEPTION
       WHEN OTHERS THEN
          MSG_ALERT('Ocorreu o erro ' || SQLERRM || ' fechando cursor!', 'E', TRUE);
       END;
       BEGIN
          TEXT_IO.FCLOSE(VARQUIVO_SAIDA);
       EXCEPTION
       WHEN OTHERS THEN
          MSG_ALERT('Ocorreu o erro ' || SQLERRM || ' fechando arquivo!', 'E', TRUE);
       END;
    END;------------------------------------------
    But, on line "VSTATUS := EXEC_SQL.EXECUTE(VCURSOR);" i get the error (ORA-01007 - VARIABLE NOT IN SELECT LIST). Whats is wrong?
    Thanks a lot!!!

    The user can write a query on this field and click on button with code above.This is such a big NO NO NO! A user writing his own queries? You are really asking for problems.
    VSTATUS := EXEC_SQL.EXECUTE(VCURSOR); -- ----------------------->> ERROR HERE!!!!!!!!What is the value of vcursor?

  • ORA-01007: variable not in select list

    Using Oracle 8 on Linux, I have editted one main Pro*C program (tpc1.pc) which logon database and called two functions each implemented in separate source Pro*C program (txna.pc and txnb.pc). After linking into an executable program and running it, the mentioned error occurs. I tried to look into the source code and I cannot locate the error. Please help.
    null

    I hate to say this, but you ever get this running you are going to kill whatever database you put it into.

  • Getting 'variable not in select list' error after extending VO

    Hi,
    My page is based on two VO. one VO has all transient attribute(LearnerSearchCritVO) and used to capture Search Criteria, The other VO is used for query(LearnerSearchVO).
    I have exteneded LearnerSearchCritVO to add 4 new additional Transient attributes
    and LearnerSerachVO and its IMPL class to add additional where clause.
    After substitution and personalization when I am querying through page I am getting the following error -
    ## Detail 0 ##
    java.sql.SQLException: ORA-01007: variable not in select list
    The query is working fine at backend and the same thing was working fine before instance is refreshed.
    I am not able to find why this error is coming.
    please help me out to sort this issue.

    Hi All
    Sorry to bring this one up again, but I've had a bit of a look around and done as much as I can based on the information given in this and other threads on the subject.
    I'm getting the java.sql.SQLException: ORA-01007: variable not in select list error from my extended VO/substitution.
    The query is based on a view for easy editing after deployment, so could that have anything to do with it?
    Here's the query from the error message:
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement:
    SELECT * FROM (SELECT
    SSH.FULL_NAME,
    SSH.ASSIGNMENT_NUMBER,
    SSH.JOB,
    SSH.GRADE,
    SSH.ANNUALIZED_SALARY,
    SSH.CURRENCY,
    SSH.CHANGE_DATE,
    SSH.SALARY_BASIS,
    SSH.PERSON_ID,
    SSH.ASSIGNMENT_ID,
    SSH.SUPERVISOR_ID,
    SSH.LAST_CHANGE_DATE,
    SSH.PAYROLL_NAME,
    SSH.NEXT_CHANGE_DATE,
    SSH.EMPLOYEE_NUMBER,
    SSH.CWK_NUMBER,
    SSH.PERSON_TYPE,
    SSH.EFFECTIVE_DATE,
    SSH.SUPERVISOR_ASSIGNMENT_ID,
    SSH.LEGISLATIONCODE,
    SSH.MANAGER_ENABLED
    FROM XX_SAL_SUP_HRCHY_VO_V SSH) QRSLT
    WHERE (((:1 = SUPERVISOR_ID)
    AND (:2 = EFFECTIVE_DATE)
    AND (:3 = SUPERVISOR_ASSIGNMENT_ID
    OR hr_general2.supervisor_assignments_in_use = 'FALSE')))
    ORDER BY FULL_NAME
    So... What's missing?
    Any help appreciated.
    CK

  • Variable not in select list -- Error in VO substitution

    I substitution VO using the query below it show message error "variable not in select list". I tested to removed bind variables from the query and substitution again it still show this error message.
    What is the cause of this problems.
    Please provide me the solution step by step for this issue.
    SELECT poe.objective_id, poe.NAME, poe.target_date, poe.start_date,
    poe.business_group_id, poe.object_version_number,
    poe.owning_person_id, poe.achievement_date, poe.detail,
    poe.comments, poe.success_criteria, poe.appraisal_id,
    poe.attribute_category, poe.attribute1, poe.attribute2,
    poe.attribute3, poe.attribute4, poe.attribute5,
    poe.attribute6, poe.attribute7, poe.attribute8,
    poe.attribute9, poe.attribute10, poe.attribute11,
    poe.attribute12, poe.attribute13, poe.attribute14,
    poe.attribute15, poe.attribute16, poe.attribute17,
    poe.attribute18, poe.attribute19, poe.attribute20,
    ppr.performance_rating_id,
    ppr.objective_id AS perf_objective_id,
    ppr.object_version_number AS perf_object_version_number,
    ppr.appraisal_id AS perf_appraisal_id,
    ppr.performance_level_id, ppr.comments AS perf_comments,
    ppr.person_id,
    DECODE
    (fnd_global.employee_id,
    pap.main_appraiser_id, 'EnableUpdate',
    (DECODE (owning_person_id,
    :1, DECODE (pap.appraisee_person_id,
    owning_person_id, 'EnableUpdate',
    'EnableRatUpdate'
    -3, 'EnableUpdate',
    NVL2 (:2, 'EnableRatUpdate', 'DisableUpdate')
    ) AS creator,
    ppr.performance_level_id AS perf_level_id,
    DECODE
    (fnd_global.employee_id,
    pap.main_appraiser_id, (NVL
    ((SELECT DISTINCT 'DisableDelete'
    FROM per_performance_ratings ratings
    WHERE ratings.objective_id =
    poe.objective_id
    AND ratings.person_id <>
    pap.main_appraiser_id),
    'EnableDelete'
    (DECODE (owning_person_id,
    :3, NVL ((SELECT DISTINCT 'DisableDelete'
    FROM per_performance_ratings ratings
    WHERE ratings.objective_id =
    poe.objective_id
    AND ratings.person_id <>
    poe.owning_person_id),
    'EnableDelete'
    'DisableDelete'
    ) AS delete_obj,
    ppr.attribute_category AS perf_attr_category,
    ppr.attribute1 AS perf_attribute1,
    ppr.attribute2 AS perf_attribute2,
    ppr.attribute3 AS perf_attribute3,
    ppr.attribute4 AS perf_attribute4,
    ppr.attribute5 AS perf_attribute5,
    ppr.attribute6 AS perf_attribute6,
    ppr.attribute7 AS perf_attribute7,
    ppr.attribute8 AS perf_attribute8,
    ppr.attribute9 AS perf_attribute9,
    ppr.attribute10 AS perf_attribute10,
    ppr.attribute11 AS perf_attribute11,
    ppr.attribute12 AS perf_attribute12,
    ppr.attribute13 AS perf_attribute13,
    ppr.attribute14 AS perf_attribute14,
    ppr.attribute15 AS perf_attribute15,
    ppr.attribute16 AS perf_attribute16,
    ppr.attribute17 AS perf_attribute17,
    ppr.attribute18 AS perf_attribute18,
    ppr.attribute19 AS perf_attribute19,
    ppr.attribute20 AS perf_attribute20,
    ppr.comments AS perf_comments_oa,
    ppr1.performance_rating_id AS ref1_perf_rating_id,
    ppr1.performance_level_id AS ref1_perf_level_id,
    ppr1.comments AS ref1_comments,
    ppr1.attribute_category AS ref1_attribute_category,
    ppr1.attribute1 AS ref1_attribute1,
    ppr1.attribute2 AS ref1_attribute2,
    ppr1.attribute3 AS ref1_attribute3,
    ppr1.attribute4 AS ref1_attribute4,
    ppr1.attribute5 AS ref1_attribute5,
    ppr1.attribute6 AS ref1_attribute6,
    ppr1.attribute7 AS ref1_attribute7,
    ppr1.attribute8 AS ref1_attribute8,
    ppr1.attribute9 AS ref1_attribute9,
    ppr1.attribute10 AS ref1_attribute10,
    ppr1.attribute11 AS ref1_attribute11,
    ppr1.attribute12 AS ref1_attribute12,
    ppr1.attribute13 AS ref1_attribute13,
    ppr1.attribute14 AS ref1_attribute14,
    ppr1.attribute15 AS ref1_attribute15,
    ppr1.attribute16 AS ref1_attribute16,
    ppr1.attribute17 AS ref1_attribute17,
    ppr1.attribute18 AS ref1_attribute18,
    ppr1.attribute19 AS ref1_attribute19,
    ppr1.attribute20 AS ref1_attribute20,
    ppr2.performance_rating_id AS ref2_perf_rating_id,
    ppr2.performance_level_id AS ref2_perf_level_id,
    ppr2.comments AS ref2_comments,
    ppr2.attribute_category AS ref2_attribute_category,
    ppr2.attribute1 AS ref2_attribute1,
    ppr2.attribute2 AS ref2_attribute2,
    ppr2.attribute3 AS ref2_attribute3,
    ppr2.attribute4 AS ref2_attribute4,
    ppr2.attribute5 AS ref2_attribute5,
    ppr2.attribute6 AS ref2_attribute6,
    ppr2.attribute7 AS ref2_attribute7,
    ppr2.attribute8 AS ref2_attribute8,
    ppr2.attribute9 AS ref2_attribute9,
    ppr2.attribute10 AS ref2_attribute10,
    ppr2.attribute11 AS ref2_attribute11,
    ppr2.attribute12 AS ref2_attribute12,
    ppr2.attribute13 AS ref2_attribute13,
    ppr2.attribute14 AS ref2_attribute14,
    ppr2.attribute15 AS ref2_attribute15,
    ppr2.attribute16 AS ref2_attribute16,
    ppr2.attribute17 AS ref2_attribute17,
    ppr2.attribute18 AS ref2_attribute18,
    ppr2.attribute19 AS ref2_attribute19,
    ppr2.attribute20 AS ref2_attribute20, poe.scorecard_id,
    poe.attribute21, poe.attribute22, poe.attribute23,
    poe.attribute24, poe.attribute25, poe.attribute26,
    poe.attribute27, poe.attribute28, poe.attribute29,
    poe.attribute30, poe.copied_from_library_id,
    poe.copied_from_objective_id, poe.aligned_with_objective_id,
    poe.next_review_date, poe.group_code, poe.priority_code,
    poe.appraise_flag, poe.verified_flag, poe.weighting_percent,
    poe.complete_percent, poe.target_value, poe.actual_value,
    poe.uom_code, poe.measurement_style_code, poe.measure_name,
    poe.measure_type_code, poe.measure_comments,
    poe.sharing_access_code,
    DECODE (NVL (poe.measurement_style_code, 'N_M'),
    'N_M', 0,
    1
    ) render_none,
    DECODE (NVL (poe.measurement_style_code, 'QUALIT_M'),
    'QUALIT_M', 0,
    (DECODE (poe.measurement_style_code,
    'QUANT_M', 1,
    0
    ) render_quant,
    DECODE (NVL (poe.measurement_style_code, 'QUANT_M'),
    'QUANT_M', 0,
    (DECODE (poe.measurement_style_code,
    'QUALIT_M', 1,
    0
    ) render_quali
    ,Fao_pems_utility.Avg_step_value(POE.APPRAISAL_ID,
    'MULTIRATER',
    'WO',
    PPR.OBJECTIVE_ID) MULTIRATERS_AVERAGE,
    Fao_pems_utility.Count_ratings(Null,
    Null,
    POE.APPRAISAL_ID,
    PPR.OBJECTIVE_ID,
    NULL,
    'MULTIRATER',
    'WO') || ' out of ' ||
    (Fao_pems_utility.How_many_rating(POE.APPRAISAL_ID,
    'GROUPAPPRAISER') +
    Fao_pems_utility.How_many_rating(POE.APPRAISAL_ID,
    'REVIEWER')) COUNT_MULTIRATERS
    FROM per_objectives poe,
    per_performance_ratings ppr,
    per_performance_ratings ppr1,
    per_performance_ratings ppr2,
    per_appraisals pap
    WHERE poe.objective_id = ppr.objective_id(+)
    AND poe.objective_id = ppr1.objective_id(+)
    AND poe.objective_id = ppr2.objective_id(+)
    AND poe.appraisal_id = :4
    AND ppr.person_id(+) = :5
    AND ppr1.person_id(+) = :6
    AND ppr2.person_id(+) = :7
    AND pap.appraisal_id = poe.appraisal_id

    Hi,
    I think the error is due to the following column
    DECODE
    (fnd_global.employee_id,
    pap.main_appraiser_id, (NVL
    ((SELECT DISTINCT 'DisableDelete'
    FROM per_performance_ratings ratings
    WHERE ratings.objective_id =
    poe.objective_id
    AND ratings.person_id
    pap.main_appraiser_id),
    'EnableDelete'
    (DECODE (owning_person_id,
    :3, NVL ((SELECT DISTINCT 'DisableDelete'
    FROM per_performance_ratings ratings
    WHERE ratings.objective_id =
    poe.objective_id
    AND ratings.person_id
    poe.owning_person_id),
    'EnableDelete'
    'DisableDelete'
    ) AS delete_obj
    Verify it and let us know ..
    Thanks,
    Kumar

  • ORA-01007 variables not in list

    Hello all
    I am trying to run a full load
    n changed some mapping that is imported from another m/c
    Two mappping r giving this error ORA-01007 variables not in list.
    Severity     Timestamp     Node     Thread     Message Code     Message
    ERROR     8/21/2012 11:02:00 AM     node01_DMMINFORZ2     READER_1_1_1     RR_4035     SQL Error [
    ORA-01007: variable not in select list
    Database driver error...
    Function Name : Fetch
    SQL Stmt : SELECT AP_INVOICE_PAYMENTS_ALL.ACCOUNTING_DATE, AP_INVOICE_PAYMENTS_ALL.AMOUNT, AP_INVOICE_PAYMENTS_ALL.INVOICE_ID, AP_INVOICE_PAYMENTS_ALL.INVOICE_PAYMENT_ID, AP_INVOICE_PAYMENTS_ALL.LAST_UPDATED_BY, AP_INVOICE_PAYMENTS_ALL.LAST_UPDATE_DATE, AP_INVOICE_PAYMENTS_ALL.CREATED_BY, AP_INVOICE_PAYMENTS_ALL.CREATION_DATE, AP_INVOICE_PAYMENTS_ALL.DISCOUNT_TAKEN, AP_PAYMENT_SCHEDULES_ALL.PAYMENT_NUM, AP_PAYMENT_SCHEDULES_ALL.DUE_DATE, AP_INVOICES_ALL.INVOICE_NUM, AP_AE_HEADERS_ALL.SET_OF_BOOKS_ID, AP_INVOICES_ALL.INVOICE_CURRENCY_CODE,
    AP_INVOICES_ALL.VENDOR_ID,
    AP_INVOICES_ALL.VENDOR_SITE_ID, AP_INVOICES_ALL.INVOICE_DATE, AP_INVOICES_ALL.INVOICE_TYPE_LOOKUP_CODE, AP_INVOICES_ALL.TERMS_ID, AP_PAYMENT_SCHEDULES_ALL.PAYMENT_METHOD_LOOKUP_CODE, AP_PAYMENT_SCHEDULES_ALL.PAYMENT_STATUS_FLAG,
    AP_INVOICES_ALL.INVOICE_RECEIVED_DATE,
    AP_INVOICES_ALL.CREATION_DATE INVOICE_CREATION_DATE,
    AP_INVOICES_ALL.EXCHANGE_RATE, AP_INVOICES_ALL.ORG_ID, AP_INVOICES_ALL.INVOICE_AMOUNT, AP_CHECKS_ALL.BANK_ACCOUNT_ID, AP_CHECKS_ALL.CHECK_DATE, AP_CHECKS_ALL.CHECK_NUMBER, AP_CHECKS_ALL.CLEARED_DATE, PO_HEADERS_ALL.SEGMENT1, PO_HEADERS_ALL.START_DATE, AP_AE_LINES_ALL.AE_LINE_ID, AP_AE_LINES_ALL.AE_HEADER_ID, AP_AE_LINES_ALL.AE_LINE_NUMBER, AP_AE_LINES_ALL.CODE_COMBINATION_ID, AP_AE_LINES_ALL.ENTERED_DR, AP_AE_LINES_ALL.ENTERED_CR,
    AP_AE_LINES_ALL.ACCOUNTED_DR,
    AP_AE_LINES_ALL.ACCOUNTED_CR,
    AP_AE_LINES_ALL.GL_SL_LINK_ID,
    AP_AE_LINES_ALL.LAST_UPDATE_DATE,
    AP_CHECKS_ALL.LAST_UPDATE_DATE,
    AP_PAYMENT_SCHEDULES_ALL.LAST_UPDATE_DATE,
    AP_INVOICES_ALL.LAST_UPDATE_DATE,
    AP_INVOICES_ALL.SOURCE,
    AP_INVOICES_ALL.PROJECT_ID,
    AP_INVOICES_ALL.TASK_ID,
    AP_INVOICES_ALL.EXPENDITURE_TYPE,
    AP_INVOICES_ALL.EXPENDITURE_ORGANIZATION_ID
    FROM
    AP_INVOICE_PAYMENTS_ALL, AP_CHECKS_ALL, AP_PAYMENT_SCHEDULES_ALL, PO_HEADERS_ALL, AP_INVOICES_ALL, AP_AE_LINES_ALL, AP_AE_HEADERS_ALL
    WHERE AP_INVOICE_PAYMENTS_ALL.INVOICE_ID=AP_PAYMENT_SCHEDULES_ALL.INVOICE_ID AND AP_INVOICE_PAYMENTS_ALL.PAYMENT_NUM = AP_PAYMENT_SCHEDULES_ALL.PAYMENT_NUM AND
    AP_INVOICE_PAYMENTS_ALL.CHECK_ID=AP_CHECKS_ALL.CHECK_ID AND
    AP_INVOICE_PAYMENTS_ALL.INVOICE_ID=AP_INVOICES_ALL.INVOICE_ID AND
    AP_INVOICES_ALL.ACCTS_PAY_CODE_COMBINATION_ID IS NOT NULL AND
    AP_INVOICE_PAYMENTS_ALL.INVOICE_PAYMENT_ID=AP_AE_LINES_ALL.REFERENCE9 AND
    UPPER(AP_AE_LINES_ALL.REFERENCE6)='AP PAYMENTS' AND
    AP_AE_LINES_ALL.AE_LINE_TYPE_CODE='LIABILITY' AND
    AP_INVOICES_ALL.PO_HEADER_ID=PO_HEADERS_ALL.PO_HEADER_ID(+) AND
    AP_AE_HEADERS_ALL.AE_HEADER_ID = AP_AE_LINES_ALL.AE_HEADER_ID AND
    AP_INVOICE_PAYMENTS_ALL.CREATION_DATE > TO_DATE('01/01/1997 00:00:00', 'MM/DD/YYYY HH24:MI:SS')
    Oracle Fatal Error].
    N same for SDE_ORA_GLJournal.
    I am importing from Inforamatica 8.6.1
    to 9.0.1
    Please give me solution as soon as possible..

    I dont think we can import informatica objects (Mapping,Session ,Workflow etc) from lower version to higher version.
    Informatica old version repository should follow by upgrade process by higher version.
    Hope this helps

  • Error - Variable not in select list

    Hi everybody;
    I get an error with this code :
    type t_doubl_mod_port is table of COUPLE_BOOL_A%rowtype;
    doublons t_doubl_mod_port;
    FUNCTION recherche_doublon (tabl IN VARCHAR2)
    RETURN t_doubl
    IS
         return_doubl t_doubl
    BEGIN
         EXECUTE IMMEDIATE 'SELECT MODELE,PORT FROM '|| tabl ||' group by MODELE,PORT having count(*) > 1' BULK COLLECT INTO return_doubl;
         RETURN return_doubl;
    END recherche_doublon;I got this error :
    ERROR at line 1:
    ORA-01007: variable not in select list
    ORA-06512: at line 10
    ORA-06512: at line 16Need help please. :/
    Edited by: Moostiq on 7 janv. 2010 15:46

    I created the type triplet like that :
    CREATE TYPE triplet AS OBJECT (MODELE VARCHAR2(16), PORT VARCHAR2(16), N0_OCCURRENCE NUMERIC(2));OK.
    Then I change the type of what I want to display with dbms_output:
    type t_doubl_mod_port_occ is table of triplet;
    doublons t_doubl_mod_port_occ;But I get this error :
    *** table : COUPLE
    DECLARE
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected UDT got CHAR
    ORA-06512: at line 27 ==> EXECUTE IMMEDIATE etc...
    ORA-06512: at line 36 ==> doublons:=recherche_doublon_mod_port (collection(i));My actual code :
    FUNCTION recherche_doublon_mod_port (tabl IN VARCHAR2)
    RETURN t_doubl_mod_port_occ
    IS
         return_doubl t_doubl_mod_port_occ;
    BEGIN
         EXECUTE IMMEDIATE 'SELECT MODELE,PORT,N0_OCCURRENCE FROM '|| tabl ||' group by MODELE,PORT,N0_OCCURRENCE having count(*) > 1' BULK COLLECT INTO return_doubl;
         RETURN return_doubl;
    END recherche_doublon_mod_port;
    BEGIN
         collection := get_tables_with_columns('MODELE','PORT');
         IF collection IS NOT NULL AND collection.count()> 0 THEN
              FOR i IN collection.first()..collection.last() LOOP
                   dbms_output.put_line(' *** table : '|| collection(i));
                   doublons:=recherche_doublon_mod_port (collection(i));
                   IF doublons IS NOT null AND doublons.count() > 0 THEN
                        FOR i IN doublons.first()..doublons.last()
                        LOOP
                             dbms_output.put_line('doublons modele/port MODELE:'||doublons(i).MODELE);
                        END LOOP;
                   END IF;
              END LOOP;
         END IF;
    END;
    /Someone could help me ?
    Edited by: Moostiq on 7 janv. 2010 16:38
    Edited by: Moostiq on 7 janv. 2010 16:43
    Edited by: Moostiq on 7 janv. 2010 16:44
    Edited by: Moostiq on 7 janv. 2010 16:44

  • Variable not in select list issue

    Hi friends,
    To the existing OBIA mapping, that is for one of the SDE mapping i dragged a single column from source to source qualifier and also updated that column in the sql query of the source qualifier and finally dragged it to my target staging table.
    After that if i tried to run that SDE task in my DAC means, it is failing and returning the below error in log
    ora-01007 variable not in select list in informatica
    since i have checked and verified the order of the column in the source qualifier port and the query. It is same, but then too returning the above error.
    What is the fix for it.
    Thanks in advance.
    Regards,
    Saro

    Hi Svee,
    Thanks for the reply.
    I followed the below link for adding the extra column to the per-built mapping
    http://www.rittmanmead.com/2008/07/amending-existing-category-1-sde-and-sil-mappings-in-oracle-bi-apps-795/+_
    Hence for example, i copied the workflow of SDE_ORA_AbsenceEvent to my new custom folder. In that i just tried only with SDE mapping(from source to staging)
    i had three source tables for it
    per_absence_attendances
    per_absence_attendance_types
    per_abs_attendance_reasons
    Target(staging table)
    W_absence_event_ds
    i tried of adding a date column "last_updated_by" from the table "per_absence_attendances" to the staging table "W_absence_event_ds"
    Before adding the date column, i just tried by copying the SDE_ORA_AbsenceEvent to my custom folder and tried to execute that in DAC as it is loading successfully in my target(staging table) "W_absence_event_ds".
    After that i added the date column to the target(staging table) "W_absence_event_ds" and tried to execute the same in DAC, but @ that time only im receiving the variable error.
    Like you said
    since its OOB mapping you should have 2 workflows(full and incr) for the same mapping, make sure your changes are affected to workflow ending with _Full.I dint copied the workflow SDE_ORA_AbsenceEvent_full to my custom folder. Whether is this the problem for this variable error whether can i copy the full(workflow) and can i try.
    And also a good news that OBIA 7.9.6.4 and DAC 11g released.
    http://www.oracle.com/technetwork/middleware/bi-enterprise-edition/downloads/bi-downloads-1525270.html_+
    Regards,
    Saro

  • Embedded SQL query in C - variable not in select list

    Hello everyone,
    I am new to using embedded SQL in C. I have written a query based on some very similar code I have found and I keep getting this error:
    ID: ORA-XXXX
    OVRD:
    TEXT: Oracle Errors Found - Consult Application Development Team
    INFO:
    SQLC: -1007
    GLM: ORA-01007: variable not in select list
    If anyone could help me figure out what I am doing wrong that is causing this error it would be much appreciated. Thanks in advance!
    Here is the query that is generating the error, I have changed the variable names but the syntax is the same:
    SELECT TEMP_TABLE.tble,
    TEMP_TABLE.item_date,
    TEMP_TABLE.item_number,
    TEMP_TABLE.item_id,
    TEMP_TABLE.amount,
    TEMP_TABLE.method
    FROM (
    SELECT 'C' tble,
    item_date,
    item_number,
    item_id,
    amount,
    method
    FROM current
    WHERE (settlement_date IS NULL)
    UNION ALL
    SELECT '1' tble,
    item_date,
    item_number,
    item_id,
    amount,
    method
    FROM prev1
    WHERE (date IS NULL)
    UNION ALL
    SELECT '2' tble,
    item_date,
    item_number,
    item_id,
    amount,
    pay_method
    FROM prev2
    WHERE (date IS NULL)
    UNION ALL
    SELECT '3' tble,
    item_date,
    item_number,
    item_id,
    amount,
    pay_method
    FROM prev3
    WHERE (date IS NULL)
    UNION ALL
    SELECT '4' tble,
    item_date,
    item_number,
    item_id,
    amount,
    method
    FROM prev4
    WHERE (date IS NULL)) TEMP_TABLE
    WHERE (TEMP_TABLE.item_date,
    TEMP_TABLE.item_number,
    TEMP_TABLE.item_id) IN
    (SELECT item_date, item_number, item_id
    FROM item
    WHERE (source, location) IN
    (SELECT source, location
    FROM SOURCE_REF
    WHERE online = 'O'
    AND (source, location) IN
    (SELECT source,
    location
    FROM SOURCE_METHOD_REF
    WHERE type = 'P')))

    Oh yeah I forgot to add that I have tested the query in TOAD and it works just fine so its something to do with embedding it into C I believe.

  • APEX 4.01 Tabular form with select list error

    When i create a tabular form and i add a select list(query based LOV) the form is not displayed but gives me the next error
    report error:
    ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    somebody have an idea what is happening here
    is this still a bug in APEX 4.01?
    hope to have an answer soon.
    Hugo Perfors

    Hi Jari,
    It returns about 1100 records which i think is not much.
    But even when i narrow the amount of records the problem is not solved.
    it this a bug?
    Best
    Hugo

  • Multiple Select List looping thru PL/SQL function body returning SQL query

    Hi,
    I have a Multiple Select List. I want to loop through the values from the Select List and process them in a PL/SQL function body returning a SQL query. Currently, my code only returns the SQL SELECT results of one item in the select list. How do I change my code to make it return the results of all of the items in the select list? (I tested it and it is definitely picking up all the values in the select list).
    <b>
    DECLARE
    selected_items HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
    s   VARCHAR2(20);
    q varchar2(32767);
    BEGIN
    selected_items := HTMLDB_UTIL.STRING_TO_TABLE(:P50_SELECTED_INSTRUMENTS);
    -- htp.p('COUNT: '||selected_items.count);
      FOR i in 1..selected_items.count LOOP
      s := TO_CHAR(selected_items(i));
    -- htp.p('First: '||s);
    -- htp.p('Second: '||:s);
    -- htp.p('Third: '||TO_CHAR(selected_items(i)));
      q:= 'SELECT  '||
    'SUBSTR(orig_geo_loc_sys,1,INSTR(orig_geo_loc_sys,''-'')-1) AS INSTRUMENT, '||
    'SUBSTR(orig_geo_loc_sys,INSTR(orig_geo_loc_sys,''-'')+1, LENGTH'||
    ' (orig_geo_loc_sys)) AS ORIG_LINENUM, '||
    'sum(orig_intrl) orig_intrl, '||
    'sum(orig_extrl) orig_extrl, '||
    'sum(recv_intrl) recv_intrl, '||
    'sum(recv_extrl) recv_extrl '||
    'FROM line_usage_sum_view '||
    'WHERE TO_CHAR(orig_geo_loc_sys) LIKE ''' || s ||'%'' '||
    --'WHERE TO_CHAR(orig_geo_loc_sys) LIKE ''2213003%'' '||
    'AND switch_id = ''' || :P1_SWITCH_ID || ''' ' ||
    'AND call_start_date > TO_DATE(''30-NOV-1999'') ' ||
    'AND call_clear_time > TO_DATE(''30-NOV-1999'') '||
    'AND '||
    :SORTFIELD||' BETWEEN '||
    'TO_DATE(:STARTDATE,''dd-MON-YYYY HH24:MI'') AND '||
    'TO_DATE(:STOPDATE, ''dd-MON-YYYY HH24:MI'') '||
    'GROUP BY GROUPING SETS (orig_geo_loc_sys)';
    -- htp.p('SQL query: '||q);
      RETURN q;
      END LOOP;
    END;</b>
    Thank you,
    Laura

    Laura,
    First, I would be careful of introducing SQL Injection possibilities. Any time I see
    'Select ... ' || :P123_FOO || ' ... '
    I worry about sql injection. In your case you are converting :P50_SELECTED_INSTRUMENTS into selected_items and then selected_items into s. So when I see
    'WHERE TO_CHAR(orig_geo_loc_sys) LIKE ''' || s ||'%'' '||
    I think, "I could use sql Injection and hack this."
    So, I would do some validation on :P50_SELECTED_INSTRUMENTS or some other method to avoid this.
    I'm not certain I understand your query. Do you really intend to allow the user to select the beginning of a string and then find all rows that start with that string? Or, do you just want to let them find when it matches the string. This is one way if you want to do matching:
    DECLARE
    selected_items HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
    s VARCHAR2(32767);
    q varchar2(32767);
    BEGIN
    -- Change the : separate string to be comma separated with quoted strings
    s := '''' || replace(:P50_SELECTED_INSTRUMENTS, ',', ''',''')|| '''' ;
    -- htp.p('COUNT: '||selected_items.count);
    q:= 'SELECT '||
    'SUBSTR(orig_geo_loc_sys,1,INSTR(orig_geo_loc_sys,''-'')-1) AS INSTRUMENT, '||
    'SUBSTR(orig_geo_loc_sys,INSTR(orig_geo_loc_sys,''-'')+1, LENGTH'||
    ' (orig_geo_loc_sys)) AS ORIG_LINENUM, '||
    'sum(orig_intrl) orig_intrl, '||
    'sum(orig_extrl) orig_extrl, '||
    'sum(recv_intrl) recv_intrl, '||
    'sum(recv_extrl) recv_extrl '||
    'FROM line_usage_sum_view '||
    'WHERE TO_CHAR(orig_geo_loc_sys) in (' || s ||' ) '||
    --'WHERE TO_CHAR(orig_geo_loc_sys) LIKE ''2213003%'' '||
    'AND switch_id = ''' || :P1_SWITCH_ID || ''' ' ||
    'AND call_start_date > TO_DATE(''30-NOV-1999'') ' ||
    'AND call_clear_time > TO_DATE(''30-NOV-1999'') '||
    'AND '||
    :SORTFIELD||' BETWEEN '||
    'TO_DATE(:STARTDATE,''dd-MON-YYYY HH24:MI'') AND '||
    'TO_DATE(:STOPDATE, ''dd-MON-YYYY HH24:MI'') '||
    'GROUP BY GROUPING SETS (orig_geo_loc_sys)';
    -- htp.p('SQL query: '||q);
    RETURN q;
    END;
    If you want to do something more like you originally stated, try this:
    DECLARE
    selected_items HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
    s VARCHAR2(20);
    q varchar2(32767);
    BEGIN
    selected_items := HTMLDB_UTIL.STRING_TO_TABLE(:P50_SELECTED_INSTRUMENTS);
    -- htp.p('COUNT: '||selected_items.count);
    q:= 'SELECT '||
    'SUBSTR(orig_geo_loc_sys,1,INSTR(orig_geo_loc_sys,''-'')-1) AS INSTRUMENT, '||
    'SUBSTR(orig_geo_loc_sys,INSTR(orig_geo_loc_sys,''-'')+1, LENGTH'||
    ' (orig_geo_loc_sys)) AS ORIG_LINENUM, '||
    'sum(orig_intrl) orig_intrl, '||
    'sum(orig_extrl) orig_extrl, '||
    'sum(recv_intrl) recv_intrl, '||
    'sum(recv_extrl) recv_extrl '||
    'FROM line_usage_sum_view '||
    'WHERE 1=1 ';
    FOR i in 1..selected_items.count LOOP
    s := TO_CHAR(selected_items(i));
    q := q || ' and TO_CHAR(orig_geo_loc_sys) LIKE '''|| s ||'%'' ' ;
    END LOOP;
    q := q || ||'%'' '||
    --'WHERE TO_CHAR(orig_geo_loc_sys) LIKE ''2213003%'' '||
    'AND switch_id = ''' || :P1_SWITCH_ID || ''' ' ||
    'AND call_start_date > TO_DATE(''30-NOV-1999'') ' ||
    'AND call_clear_time > TO_DATE(''30-NOV-1999'') '||
    'AND '||
    :SORTFIELD||' BETWEEN '||
    'TO_DATE(:STARTDATE,''dd-MON-YYYY HH24:MI'') AND '||
    'TO_DATE(:STOPDATE, ''dd-MON-YYYY HH24:MI'') '||
    'GROUP BY GROUPING SETS (orig_geo_loc_sys)';
    -- htp.p('SQL query: '||q);
    RETURN q;
    END;
    Hope this helps...
    Anton

  • How-To populate SELECT LIST default value from SQL Query

    OK, I've done my homework, and did not find my answer in the Forum, so here it is.
    I have a Page that displays fields from a SQL Query. The Page also has below that radiogroups, checkboxes, and Select Lists to allow the user to change values in the fields that are displayed at the top of the Region. I am able to pre-populate the radiogroups and checkboxes by performing a SELECT in the 'Source value or expression' of the Source area of the Page Item.
    However, I am unable to do the same for the Select List fields. Their default value ends up being the first value in the LOV ('-- None --' for NULL values). Source Used: Only when current value in session state is null. Source Type: SQL Query. Also, when I first go into the Page when running it, and check the Session State values, they are all null, so I don't understand why the field is not populated by the SQL Query statement as the radiogroups and checkboxes are.
    Any suggestions??? I've tried all sorts of combinations.

    Thank you for the suggestion.
    I had considered that, but cannot do so, because we are using Oracle Application Express more for development than for data containment.
    We have all our data in an Oracle 10.g DB which is separate from the OAEX server, and the OAEX app will reference that data via VIEWs and DB LINKs. We are doing so primarily as an added data security layer, where the data is housed separate from the app, in case the Web site is ever compromised. The data that can be viewed is restricted to a subset of the actual data that is available.
    Since the data is on a separate server, (I assume) we will not be able to set the source type to Database column, because (I asume) that is dependent upon the data being housed by the OAEX server.
    That still leaves me with having to populate the field with a SELECT statement from the Oracle DB. This unfortuneately is almost a show-stopper for me because of down-stream processing data requirements. Have not been able to come up with contingencies yet.

  • Select list with entires contain HTMLname code (&nbsp)

    soory i have already enter this information but it seems to be gone.
    In Apex is the query for the select list define as:
    SELECT to_char(acv_from,'dd.mm.yyyy')||' - ' ||nvl(to_char(acv_to,'dd.mm.yyyy'),'&amp;nbsp;') d,
    acv_id r
    FROM ac_version where acv_reg_id= :P7_INF_REG_ID order by acv_from
    APEX 3 generate following HTML code:
    <select name="p_t09" size="1" id="P7_INF_SEL_TIME_PERIOD" onchange="document.getElementById('P7_INF_ACV_ID').value=document.getElementById('P7_INF_SEL_TIME_PERIOD').value;doSubmit('P7_INF_SEL_TIME_PERIOD'); ">
    <option value="-1">- New Period -</option>
    <option value="4928">27.11.2007 - 27.04.2009</option>
    <option value="6121">28.04.2009 - 24.10.2009</option>
    <option value="6827">25.10.2009 - 14.05.2010</option>
    <option selected="selected" value="8405">15.05.2010 - &amp;nbsp;</option>
    </select>
    APEX 4 generate following HTML code:
    <select name="p_t09" id="P7_INF_SEL_TIME_PERIOD" size="1" onchange="document.getElementById('P7_INF_ACV_ID').value=document.getElementById('P7_INF_SEL_TIME_PERIOD').value;doSubmit('P7_INF_SEL_TIME_PERIOD'); "><option value="-1">- New Period -</option>
    <option value="4928">27.11.2007 - 27.04.2009</option>
    <option value="6121">28.04.2009 - 24.10.2009</option>
    <option value="6827">25.10.2009 - 14.05.2010</option>
    <option value="8405" selected="selected" >15.05.2010 &amp;amp;nbsp;</option>
    </select>
    my question was who can i disable the substitution of the & to &amp;amp;
    Edited by: user12002118 on 08.11.2010 23:42
    Edited by: user12002118 on 09.11.2010 01:54

    Hi,
    @user12002118: What is the purpose of
    nvl(to_char(acv_to,'dd.mm.yyyy'),' ')I think the NVL isn't really necessary, because in the select list you will not see the blank anyway because it's the last character. Just remove the NVL and I think you should be fine. Or if you think you need it, just replace the   with a real blank.
    @Paul: In general a select list doesn't render any HTML tags. So a &lt;strong> will never show a bold text. That's why we have decided that the output should always be escaped to prevent any XSS attacks but also to prevent that user data accidentally breaks the HTML code like with & or >. But I see the problem if someone wants to have protected blanks where he would have to use the HTML entity &amp;nbsp; so that the browser really renders each single blank. But I think that it's a really rare case for a select list. But as always, there are two workarounds available:
    1) Use your unicode trick
    2) Add htf.escape_sc somewhere in your SQL statement. That could also be in a comment like /* htf.escape_sc */ Because in that case APEX thinks you are already taking care of escaping and doesn't do it's own escaping.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

Maybe you are looking for

  • Userexit in va41

    I wish to check every field in va41 before saving va41. Please tell some userexit/badi/etc thanks rajeev

  • Slow Motion Help

    Hello, I am shooting HDV with Canon XH-A1 in 60i for slow mo shots. I bring it into JES de-interlacer to slow the footage down and now I want to convert it to 24p to bring it into a 24fps timeline in FCP. When I open the clip in Cinema Tools, it wont

  • Djvu viewer

    I have an iMac G5 computer with a 2Ghz intel duo processor. I have downloaded the Djvu image viewer/plug in for use with a family history search site. I downloaded and installed sucessfully. When I view on the trial image at the end of the download a

  • Repair Python framework

    Hello, I've been scouring these boards for a way to repair my Leopard installation. In my zeal while trying to install SciPy / Numpy, etc. and update to the latest version of Python, I deleted some key components to the Python framework. I was so fru

  • Servlet class

    ok the servlet class is suppose to be in the j2sdk1.4.0right well every time i try to compile a servlet it tells me the package does not exist like when i use import java.servlet.*;. What im i doing wrong and how can i fix this . thanks