Bind variables problem, very urgent

hi,
Oracle gurus,
In my current project while executing the following ststement i am getting the run time error"ORA-01008: not all variables bound".
This statement is used inside of a procedure and some bind arguments have values and some arguments have NULL values.
EXECUTE IMMEDIATE ' insert into trn_billtask
(area_id,
asn_no,
batch_no,
cases_per_pallet,
color_zone,
comp_id,
cube,
currdate,
eachs_per_case,
ebiz_sku_no,
ebiz_user_no,
footage,
hazmat_flag,
home_zone,
intf_conf_flag,
line_no,
location,
lp,
merge_flag,
no_of_cases,
no_of_units,
packcode,
po_line_no,
po_no,
putaway_strategy,
qty
,rcv_type,
site_id,
sku,
skudesc1,
skufam,
skugroup,
sku_status,
status_flag,
task_date,
task_desc,
task_type,
type_stor_equip,
uom_id,
wght)
select null,
rh.rec_no,
p.lot,
pr.each_qty,
sl.color_zone,
''MR'',
pr.unit_cube*(nvl(p.qty,0)/nvl(pr.each_qty,1)),
sysdate,
pr1.each_qty,
p.prod_no,
1,
nvl(sl.wdth,0) * nvl(sl.dpth,0),
decode(s.haz_mat_class,null,''N'',''Y''),
sl.home_zone,
''N'',
r.line_no,
p.end_loc,
p.lp,
nvl(p.access_aisle,''N''),
round(nvl(p.qty,0)/nvl(pr.each_qty,1)),
1,
p.pkg_no,
r.p_line_no,
rh.po_no,
r.putaway_strategy,
p.qty,
rh.rec_type,
''HW'',
s.sku,
s.sku_desc1_35,
s.prod_fam,
s.prod_cat,
p.prod_stat,
2,
sysdate,
''Handling'',
bt.task_type,
nvl(sl.type_stor_equip,''100''),
p.uom,
pr.unit_wght*(nvl(p.qty,0)/nvl(pr.each_qty,1))
     from [email protected] s,mast_abbtype bt,mast_company bc,[email protected] pr,[email protected] sl,
     [email protected] r,[email protected] rh,[email protected] p,[email protected] pr1
     where p.end_time is not null
          and decode(bt.comp_id,null,:p_comp_id,bt.comp_id)= :p_comp_id
          and decode(bt.site_id,null,:p_site_id,bt.site_id)=:p_site_id
          and bt.task_type = :p_task_type
          and bc.comp_id = :p_comp_id
          and p.proc_cntrl_no =r.rec_cntrl_no
          and bc.ebiz_appown_no= 40
          and bt.delete_flag=''N''
          and r.rec_cntrl_no = rh.rec_cntrl_no
          and p.proc_cntrl_no = nvl(:p_po_no,p.proc_cntrl_no)
          and p.prod_no = nvl(:p_ebiz_sku_no, p.prod_no)
          and nvl(p.prod_stat, ''~'') =nvl(:p_sku_status, nvl(p.prod_stat, ''~''))
          and p.lp = nvl(:p_lp, p.lp)
          and nvl(p.lot, ''~'') = nvl(:p_batch_no, nvl(p.lot, ''~''))
          and r.lp = p.lp
          and p.prod_no = s.prod_no
          and p.prod_no = pr.prod_no
          and p.pkg_no = pr.pkg_no
          and pr.logical_case_flg = ''Y''
          and p.end_loc = sl.loc
          and nvl(p.sku_key3,''A'') != ''1''
          and decode(''COMP'',''BYID'',s.buyer_id,s.comp_code) = bc.comp_id
          and bc.comp_id =:p_comp_id
          and r.cart_lp is null
          and trunc(p.date_time_created) between trunc(nvl(SYSDATE-10000,p.date_time_created))
          and trunc(nvl(SYSDATE,p.date_time_created))
          and trunc(p.date_time_created) >= trunc(bc.effective_date)
          and pr.prod_no = pr1.prod_no and pr.pkg_no = pr1.pkg_no and pr1.logical_plt_flg = ''Y'' '
     using p_comp_id,p_site_id,p_task_type,p_po_no,p_ebiz_sku_no,p_sku_status,p_lp,p_batch_no;
ur suggestions r most welcome
thanks
RR

Placeholders (:name) are bound by position in EXECUTE IMMEDIATE SQL statement. Hence Oracle does not consider multiple :p_comp_id in your statement to be the same thing. You would need to repeatedly bind them for each occurrence, or use an approach (DBMS_SQL.BIND_VARIABLE or EXECUTE IMMEDIATE PL/SQL block) which binds by name or position / name.
In the case of the above example you would have a USING clause similar to the below (Note that I am unable to test this).
EXECUTE IMMEDIATE sql_statement
   USING p_comp_id, p_comp_id, p_site_id,
      p_site_id, p_task_type, p_comp_id,
      p_po_no, p_ebiz_sku_no, p_sku_status,
      p_lp, p_batch_no, p_comp_id;

Similar Messages

  • Bad Bind Variable Problem

    Hi
    I am trying to create a trigger and facing Bad Bind Variable problem.
    Plz let me know, what's the problem in this trigger.
    CREATE OR REPLACE TRIGGER Tender_tax_update AFTER
    INSERT
    OR UPDATE
    OR DELETE OF ITEM_QTY,ITEM_RATE,TENDER_ACC_QTY ON TENDER_ENQUIRY_ITEM_D REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
    Declare
         v_amt TENDER_VENDOR_TAX_D.TAX_AMOUNT%TYPE;
         v_tax_ty TENDER_VENDOR_TAX_D.TAX_TYPE%TYPE;
         v_tax_cd TENDER_VENDOR_TAX_D.TAX_CODE%TYPE;
         v_ven_cd TENDER_VENDOR_TAX_D.VENDOR_CODE%TYPE;     
         v_item_cd TENDER_VENDOR_TAX_D.item_cd%TYPE;     
         v_tenno TENDER_VENDOR_TAX_D.tender_enquiry_no%TYPE;
    Begin
         if inserting then
              v_tax_ty:=:new.TAX_TYPE;
              v_tax_cd:=:new.TAX_CODE;
              v_ven_cd:=:new.vendor_code;
              v_item_cd:=:new.item_cd;
              v_tenno:=:new.tender_enquiry_no;
    select TAX_AMOUNT into v_amt from TENDER_TAX_DETAILS where tender_enquiry_no=v_tenno and TAX_CODE=v_tax_cd and TAX_TYPE=v_tax_ty and item_cd=v_item_cd and vendor_code=v_ven_cd;
    update TENDER_VENDOR_TAX_D set TAX_AMOUNT=v_amt where tender_enquiry_no=v_tenno and TAX_CODE=v_tax_cd and TAX_TYPE=v_tax_ty and item_cd=v_item_cd and vendor_code=v_ven_cd;
         end if;
    End Tender_tax_update;
    Database deails are as follows:
    TENDER_VENDOR_TAX_D
    Name Null? Type
    TENDER_ENQUIRY_NO NOT NULL VARCHAR2(8)
    VENDOR_CODE NOT NULL VARCHAR2(4)
    TAX_CODE NOT NULL VARCHAR2(4)
    PERCENTAGE NUMBER(5,2)
    TAX_AMOUNT NUMBER(15,2)
    ITEM_CD NOT NULL VARCHAR2(10)
    TAX_FLAG VARCHAR2(1)
    TAX_TYPE CHAR(3)
    TENDER_TAX_DETAILS
    Name Null? Type
    TENDER_ENQUIRY_NO NOT NULL VARCHAR2(8)
    VENDOR_CODE VARCHAR2(4)
    ITEM_CD VARCHAR2(10)
    TAX_CODE NOT NULL VARCHAR2(4)
    TAX_TYPE CHAR(3)
    TAX_AMOUNT NUMBER
    Message was edited by:
    user648065

    facing Band Bind Variable problem.Doesn't the error message tell you which bind variable is the problem?

  • Urgent Sql Query Problem - -Very Urgent

    Hi Guys,
    I need a urgent solution for a problem.I am
    using the following query
    select ename from emp where deptno =10
    Now I will declare a bind variable and if user passes 'A'
    then the query will run as it is and if he passes B
    then it should run the above query with this additional clause -> birthdate - hiredate >15.
    Please can any one help its very urgent

    Assuming that you have a birthdate column in your emp table, the following will do what you are asking for:
    VARIABLE bind_var VARCHAR2(1)
    EXECUTE :bind_var := '&bind_variable'
    SELECT ename FROM
    (SELECT 'A' AS selection, ename FROM emp WHERE deptno = 10
    UNION ALL
    SELECT 'B' AS selection, ename FROM emp WHERE deptno = 10 AND birthdate - hiredate > 15)
    WHERE selection = :bind_var
    However, the clause "birthdate - hiredate > 15" will only retrieve rows for employees who were born more than 15 days after they were hired. I doubt that this is what you really want, since this is impossible.

  • SAPscript Output Problem - Very Urgent - Please help

    Hi,
    I am having the following problem with SAPscript.
    In the Main Window, I have instructions to the printer in the ZPL2 language (For Zebra Printer).
    There are also several variables, which are highlighted in Gray and enclosed in the’&’.
    There are also several elements – all of them empty except for the one where this code is.
    Now, I received this program to modify in terms of code and the output.
    IF you have never done any work with Zebra Printing, the way it is done is that you create a label using the Zebra BarOne or Zebra Designer program, then output it to an ‘itf’ file, upload it into a standard text as .itf and copy the uploaded contents to the main window. When printing to a Zebra printer, the Zebra printer will read the instructions and will print the output.
    Here is the problem: The config for the output type is correct.
    When doing a printing test from SAPscript, I get the right output and the Zebra printer is able to print it.
    However, the real process for this task will go through MB02. There, if I create a spool request using the proper method (select output type and etc.), it will go the spool. However, if I print preview or output (doesn’t work with the Zebra printer, so I have to output to the Laser printer), it will output the following (none of the following includes any of the ZPL2 code/instructions. Instead, it seams to print the variables contents with the field name next to it – This isn’t whats it’s the Main window!!!)
    http://img244.imageshack.us/img244/6915/66052475zk2.jpg
    Please help. I have debugged but don’t know what to do and can’t find anything wrong.
    This is very urgent. Any help will be useful.
    Thanks,
    John

    Ok, maybe I have confused others in regards to the issue as well.
    We expect this label to be output from a Zebra Printer.
    When output through Sapscripts printing test, the preview from the spool shows the ZPL2 code in small font (non readible if a created a screenshot) and if sent to the Zebra Printer, it prints the label correctly.
    When output through MB02, the preview from the spool shows the code that I have attached to the 1st post in this thread. If I try to output to the Zebra Printer, nothing happens because the ZPL2 instructions are not even in the preview and therefore, the Zebra printer recieves no instructions. I should not have mentioned the laser printer, because it has nothing to do with this issue.
    I hope that this makes the issue a little more clear and understandable. Please help.
    Here is the ZPL2 coding before uploading to standard text (only difference is that once uploaded,  the '/' characters are removed.) However, I believe that the problem may lie in the print program and how it compiles but I debugged and haven't really seen where it comes from:
    /:NEW-PAGE
    / ^XA
    / DFNEW-RE-1FS
    / ^PRC
    / LH0,0FS
    / ^LL1830
    / ^MD0
    / ^MNY
    / LH0,0FS
    / FO244,854A0N,55,46CI13FRFB154,1,0,LFN999^FS
    / FO819,698A0N,55,46CI13FRFN998FS
    / FO245,477A0N,55,46CI13FRFB755,1,0,RFN997^FS
    / FO389,926A0N,55,46CI13FRFB654,1,0,RFN996^FS
    / BY3,3.0FO42,1072B3N,N,152,N,YFRFN995FS
    / FO276,1258A0N,55,46CI13FRFN995FS
    / FO484,774A0N,55,46CI13FRFN994FS
    / FO817,774A0N,55,46CI13FRFN993FS
    / FO611,556A0N,55,46CI13FRFN992FS
    / FO245,556A0N,55,46CI13FRFN991FS
    / FO397,117A0N,55,46CI13FRFN990FS
    / FO245,405A0N,55,46CI13FRFB880,1,0,RFN989^FS
    / FO244,698A0N,55,46CI13FRFN988FS
    / FO629,998A0N,55,46CI13FRFN987FS
    / FO244,623A0N,52,42CI13FRFN986FS
    / FO397,261A0N,55,46CI13FRFB404,1,0,RFN985^FS
    / FO819,854A0N,55,46CI13FRFN984FS
    / FO725,554A0N,55,46CI13FRFN983FS
    / FO397,189A0N,55,42CI13FRFB695,1,0,RFN982^FS
    / FO397,333A0N,55,42CI13FRFN981FS
    / FO638,333A0N,55,42CI13FRFN980FS
    / FO391,21A0N,63,63CI13FRFB433,1,0,CFN979^FS
    / FO36,698A0N,55,46CI13FR
    / FDWBS:FS
    / FO37,405A0N,55,46CI13FR
    / FDMATL:FS
    / FO37,478A0N,62,44CI13FR
    / FDDESC:FS
    / FO554,698A0N,55,46CI13FR
    / FDSUPPLIER:FS
    / FO32,625A0N,55,46CI13FR
    / FDTEXT:FS
    / FO35,1258A0N,55,46CI13FR
    / FDBATCH NO:FS
    / FO770,775A0N,63,51CI13FR
    / FD/FS
    / FO32,854A0N,55,46CI13FR
    / FDESHM:FS
    / FO37,556A0N,55,46CI13FR
    / FDQTY:FS
    / FO32,998A0N,55,46CI13FR
    / FDSAP MATERIAL DOC NO:FS
    / FO525,333A0N,55,46CI13FR
    / FDofFS
    / FO556,854A0N,55,46CI13FR
    / FDINSPECT:FS
    / FO32,926A0N,55,46CI13FR
    / FDUNLOADING:FS
    / FO37,117A0N,55,46CI13FR
    / FDSTOCK TYPE:FS
    / FO32,774A0N,55,46CI13FR
    / FDPURCHASE ORDER:FS
    / FO37,188A0N,55,46CI13FR
    / FDDELIVER TO:FS
    / FO37,260A0N,55,46CI13FR
    / FDSTORAGE LOC:FS
    / FO37,332A0N,55,46CI13FR
    / FDCONTAINERS:FS
    / FO1,1359GB1217,0,6^FS
    / FO594,1359GB0,474,6^FS
    / ^XZ
    /:NEW-PAGE
    / ^XA
    / ^XFNEW-RE-1.ZPL
    / FN999FD&ATWRT_HAZAMAT(6)&^FS
    / FN998FD&EKKO-LIFNR&^FS
    / FN997FD&MABDR-MAKTX&^FS
    / FN996FD&MSEG-ABLAD&^FS
    / FN995FD&MSEG-CHARG&^FS
    / FN994FD&MSEG-EBELN&^FS
    / FN993FD&MSEG-EBELP&^FS
    / FN992FD&MSEG-ERFME&^FS
    / FN991FD&MSEG-ERFMG&^FS
    / FN990FD&MSEG-INSMK(1)&^FS
    / FN989FD&MSEG-MATNR&^FS
    / FN988FD&MSEG-MAT_PSPNR&^FS
    / FN987FD&MSEG-MBLNR&^FS
    / FN986FD&MSEG-SGTXT(40)&^FS
    / FN985FD&MSEG-UMLGO&^FS
    / FN984FD&QALS-PRUEFLOS&^FS
    / FN983FD&V_BACKORDER&^FS
    / FN982FD&V_NAME3&^FS
    / FN981FD&WS_CNTR&^FS
    / FN980FD&WS_CON&^FS
    / FN979FD&WS_HEADER& &^FS
    / ^PQ1,0,1,N
    / ^XZ
    / ^FX End of job

  • Report Query with Bind variables working very slowly

    Hi everyone,
    I'm having a hard time with one of my Reports.
    Basically the query looks like this:
    Select *
    from x,y,z
    where x.lang_id = :P1_LANG
    and y.name = :P1_LANG;
    I have a textfield and a Select List on my Page which have to have a value before the report is shown.
    Now to the problem, when I input a value into these Application Items the Report takes ages (3-5 min). But when I replace the Bind variables (:P1_LANG and :P1_LANG) with the actual values it takes mere seconds.
    Anyone got an idea why this might be?
    I'm at my wits end -.-
    Edited by: DocD on Oct 27, 2009 3:01 AM

    Hi
    This could be for a number of reasons and unfortunately there is no quick answer...
    When you run a query for the first time, the execution plan is worked out by the Cost Based Optimiser (I'm assuming you're using 10g or above here). This is referred to as a hard parse. Next time the same SQL text is used then the execution plan may still be in the shared pool - in this case the same execution plan is used rather than being calculated again.
    The great thing about using bind variables is that even with different inputs, the SQL text is the same so the execution plan can be shared for different inputs. One downside is that if the first time the query is executed using bind variables, out of the ordinary values are input, bind variable peeking can lead to a sub optimal execution plan being calculated for the query and then shared in other situations (where more 'normal' values are input).
    However, it could be down to a host of other things too. So your first check is to make sure that you have executed both queries a number of times. If you are still getting the same performance issues then plan post the full query, table creation scripts and execution plan for both querys.
    Cheers
    Ben

  • Query Bind Variables problem

    I have a ViewObject with bindvariable GroupnameItemname.
    In JHeadstart AppDef this item is not bound to model, but included in Quick Search and Advanced Serach, as in "7.2.5. Using Query Bind Variables in Quick or Advanced Search"
    First I get an error saying GroupnameItemname*Var* is not found on ViewObject, so I changed the bindvariables to GroupnameItemnameVar
    Is something changed here? We are using JHeadstart 10.1.3.3.75 / JDeveloper 10.1.3.4.0
    After changing the bindvariablename I have another problem:
    I get an error in JhsApplicationModuleImpl.advancedSearch on these lines:
    boolean isBindParam = !viewCriterium.isAttributeBased();
    AttributeDef ad = isBindParam ? null : vo.findAttributeDef(attribute);
    The first line returns false for my bindvariable, so the second line raises an error like "JBO-25058: Definition <attr> of type Attribute not found in <VO>".
    In QueryCondition:
    public boolean isAttributeBased()
    return def!=null; //but def is not null here, it is an instance of DCVariableImpl
    This used to work in previous versions of JHeadstart...
    Please help,
    Greetings HJH

    In my MyApplicationModuleImpl (which extends JhsApplicationModuleImpl) I did override advancedSearch.
    Copied the code from JhsApplicationModuleImpl and changed a few lines:
    After
    sLog.debug("executing advancedSearch for " + viewObjectUsage);
    ViewObject vo = getViewObject(viewObjectUsage);
    I added:
    //clear bindParams:
    String[] attrNames =
    vo.getNamedWhereClauseParams().getAttributeNames();
    for (int i = 0; i < attrNames.length; i++) {
    vo.setNamedWhereClauseParam(attrNames\[i\], null);
    sLog.debug("bindParam leeggemaakt: " + attrNames\[i\]);
    And a bit later in the method I made a changed as follows:
    // boolean isBindParam = !viewCriterium.isAttributeBased();
    boolean isBindParam = viewCriterium.getName().endsWith("Var");
    A bit crude, but worked for me...
    Cheerio,
    HJH
    Edited by: HJHorst on Mar 19, 2009 1:56 PM (had to escape square brackets...)

  • Report painter problem very urgent

    Hi to ALL,
    I have prepared two reports of cost centre through report painter. The format is proper is both the reports. The set is also correct and values in set(i.e cost centres) are also properly
    but when we execute the report one report is being executed properly while other shows zero values. only when i doubleclick on zero amt and go to plan line items then it shows me values for that particular row in report.
    Why is it so? what is solution to it? can it be possible that my tables are not correct. Ia m using CCSS table.
    Pls this is very urgent
    Thanks in advance
    Tanuja

    Hi
    Can you check one thing...after selecting the zero you are getting the line item...chekc the total of that items...if it is coming zero..then no problem.
    If not you can check in the no.format of that report. If you select the lacs format and your amount is below ten thousand...you will get the zero value only
    VVR

  • Bind variable problem in cascading LOVs

    Hi,
    after upgrade from APEX 3.0 to 3.1 all my cascading LOVs stopped working correctly. First level LOV is OK, but the second level LOV, which contains a bind variable in its SQL code, fails. Debugging shows that the bind variable referrencing to the value of the first level LOV is empty. It has worked without problems in 3.0. The bind variable format is traditional :ITEM
    This is an example of the LOV SQL:
    SELECT PSKUP_CZ display_value, ID return_value
    FROM PSKUP
    WHERE sk_id = :P1_SKUP
    ORDER BY 1
    Where :P1_SKUP refers to the vaule of the top level LOV.
    In Oracle® Database Application Express Release Notes Release 3.1 in chapter "3 Open Bugs and Known Issues", I've only found a short remark called "Problems with Queries Containing a Bind Variable and a String with Two Dashes". The recommended solution here was to use v('P18_X') instead of :P18_X
    I tried that but with no effect on my problem.
    Anybody has similar experience? Any workarounds?
    Thanks in advance,
    Zdenek

    Hi Zdenek,
    DV, NV, V are an optional component of the ApexLib framework. Actually they don't have anything to do with the framework itself.
    Because of the nature of this functions they have to have a hard coded reference to the FLOWS_XXX schema, but which causes problems if APEX is upgraded to a new version and the functions are not altered.
    I will probably removed them from the installation instructions or add a big remark that they have to be altered after an upgrade, because this kind of threads are re-occurring after each new released APEX version.
    Thanks
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com/
    The APEX Builder Plugin: http://builderplugin.oracleapex.info/ New
    The ApexLib Framework: http://apexlib.sourceforge.net/

  • Bind variable problem when renaming page items?

    APEX 2.1 on IE6.
    I'm having trouble with bind variables. I cannot reproduce this regularly, but I notice it from time to time. Basically, certain page items will simply refuse to hold their contents, even though the debug output says :
    0.03: Saving g_arg_names=P9_XYLOPHONE_XYLOPHONE and g_arg_values=hello
    0.03: ...Session State: Save "P9_XYLOPHONE_XYLOPHONE" - saving same value: "hello"
    Whenever I reference the variable (using :, V(), NV(), or &.) I get NULL. None of the output indicates that it was changed elsewhere. I've noticed that changing the name of page item influences this. Shorted names tend to cause fewer problems.
    I can't be more specific, as I can't figure out the pattern. Has anyone else noticed this?
    Cheers.

    hi dccase
    couldnt get what the documentation says with APP_SESSION to work.
    http://aae18331:8089/apex/f?p=102:3:$APP_SESSION.::3:MY_ITEM:315
    However the following which i guess assumes the default session worked
    =====================================================
    http://aae18331:8089/apex/f?p=102:3::::3:MY_ITEM:315
    cheers
    shaunak

  • Plz help me TEXTPOOL PROBLEM(VERY URGENT)

    hi experts,
    plz help in resolving this issue this is very urgent.
    error is
    The line type of "RPOOL" must be compatible with one of the types
    "TEXTPOOL".
    and its coming in :
    FORM GET_SELSCREEN_TITLE TABLES P_SCREENS STRUCTURE DYNNR.
    DATA: BEGIN OF RPOOL OCCURS 20,
    ID(1),
    NAME(8),
    TEXT(80),
    END OF RPOOL.
    READ TEXTPOOL RSVAR-REPORT LANGUAGE SY-LANGU INTO RPOOL.
    plz help me.

    Hi !
    Try this :
    DATA RPOOL LIKE TEXTPOOL OCCURS 0 WITH HEADER LINE.
    Reward if usefull,
    Regards,
    Stéphane.

  • Bind variable problem in a procedure

    Hi,
    Is there any way I can pass a parameter in a procedure as we do in sql plus (for example where date = &date).
    I have a procedure that is somewhat similar to this...
    select (field 1, field2...
    from table1, table 2....
    where ....
    and ..
    and v_fiscal_year (here I want the bind variable)
    UNION
    select (field 1, field2...
    from table1, table 2....
    where .....
    and ..
    and ..
    and v_fiscal_year (here I want the bind variable)
    I need to register this procedure in oracle apps as a concurrent program where a user should be able to provide value for fiscal_year and then write the file out in a text file.
    Thanks
    A/A

    What you've shown isn't a procedure, but is a query.
    I assume your "field1", "field2" within the query means that you are expecting to be able to create a dynamic SQL from parameters passed into a procedure.
    For that you will need to use DBMS_SQL package to create and execute a dynamic query or use the EXECUTE IMMEDIATE statemetn to execute a query built up in a string. Note however, that dynamic SQL is inherently bad practice and should only ever be used as a last resort. What exactly are you trying to achieve as there are likely to be better ways of doing it?

  • User Report data bind variable problems

    Hello,
    I am trying to build a simple report in SQLDeveloper, using a DATE bind variable. But it fails with the error message:
    Inconsistent datatype, expected DATE got NUMBER
    SELECT * FROM FLOW_COMP_REC_SUMMARY_RU
    where create_date = trunc(:TARGET_DATE)
    and type = 'D'
    ORDER BY MESSAGE_FLOW_ID
    Running this query in SQLDeveloper worksheet executes properly after a dialog box pops up and I enter: current_date - 1
    SELECT * FROM FLOW_COMP_REC_SUMMARY_RU
    where create_date = trunc(&TARGET_DATE)
    and type = 'D'
    ORDER BY MESSAGE_FLOW_ID
    I've searched but no clear solutions present themselves. If you have one it would be most appreciated.
    Thanks

    You'll have to convert the input to date yourself:
    SELECT * FROM FLOW_COMP_REC_SUMMARY_RU
    where create_date = TO_DATE(:TARGET_DATE, 'DD/MM/YYYY')
    and type = 'D'
    ORDER BY MESSAGE_FLOW_ID
    Have fun,
    K.

  • Bind Variable Problem

    Hi Guys
    PLease i am really stuck
    i have a LOV which has a complex query...
    in that query there are multiple bind variables that are assigned... ie :1 , :2 and so forth
    here is the query for the LOV
    SELECT a.kri_description, a.kri_id
    FROM xx_key_result_indicators a, xx_kri_positions b
    WHERE TO_DATE (:1, 'DD-MON-YYYY') BETWEEN a.effective_from_date
    AND a.effective_to_date
    AND TO_DATE (:2, 'DD-MON-YYYY') BETWEEN b.effective_from_date
    AND b.effective_to_date
    AND a.kra_id = :3
    AND a.kri_id IN (
    SELECT c.kri_id
    FROM xx_kri_positions c
    WHERE TO_DATE (:4, 'DD-MON-YYYY')
    BETWEEN c.effective_from_date
    AND c.effective_to_date
    AND c.position_id = :5
    AND c.enable_flag = 'Y')
    AND b.position_id = :6
    AND a.enable_flag = 'Y'
    AND b.enable_flag = 'Y'
    AND a.kri_id NOT IN (SELECT NVL (g.kri_id, 1)
    FROM xx_perf_kri g
    WHERE g.perf_kra_id = :7)
    UNION
    SELECT f.kri_description, f.kri_id
    FROM xx_key_result_indicators f
    WHERE TO_DATE (:8, 'DD-MON-YYYY') BETWEEN f.effective_from_date
    AND f.effective_to_date
    AND f.kra_id = :9
    AND f.kri_id NOT IN (SELECT e.kri_id
    FROM xx_kri_positions e)
    AND f.enable_flag = 'Y'
    AND f.kri_id NOT IN (SELECT NVL (d.kri_id, 1)
    FROM xx_perf_kri d
    WHERE d.perf_kra_id = :10)
    so in theroy when i push the tourch icon next to my text field i set these bind variables...
    so in theroy that should work,,, but becuase i have a lov the framework will automatically assign extra where clause params for the filter.... and the query will look as follows
    SELECT *
    FROM (SELECT a.kri_description, a.kri_id
    FROM xx_key_result_indicators a, xx_kri_positions b
    WHERE TO_DATE (:1, 'DD-MON-YYYY') BETWEEN a.effective_from_date
    AND a.effective_to_date
    AND TO_DATE (:2, 'DD-MON-YYYY') BETWEEN b.effective_from_date
    AND b.effective_to_date
    AND a.kra_id = :3
    AND a.kri_id IN (
    SELECT c.kri_id
    FROM xx_kri_positions c
    WHERE TO_DATE (:4, 'DD-MON-YYYY')
    BETWEEN c.effective_from_date
    AND c.effective_to_date
    AND c.position_id = :5
    AND c.enable_flag = 'Y')
    AND b.position_id = :6
    AND a.enable_flag = 'Y'
    AND b.enable_flag = 'Y'
    AND a.kri_id NOT IN (SELECT NVL (g.kri_id, 1)
    FROM xx_perf_kri g
    WHERE g.perf_kra_id = :7)
    UNION
    SELECT f.kri_description, f.kri_id
    FROM xx_key_result_indicators f
    WHERE TO_DATE (:8, 'DD-MON-YYYY') BETWEEN f.effective_from_date
    AND f.effective_to_date
    AND f.kra_id = :9
    AND f.kri_id NOT IN (SELECT e.kri_id
    FROM xx_kri_positions e)
    AND f.enable_flag = 'Y'
    AND f.kri_id NOT IN (SELECT NVL (d.kri_id, 1)
    FROM xx_perf_kri d
    WHERE d.perf_kra_id = :10)) qrslt
    WHERE (( UPPER (kri_description) LIKE :1
    AND ( kri_description LIKE :2
    OR kri_description LIKE :3
    OR kri_description LIKE :4
    OR kri_description LIKE :5
    not that now there are bind variable 1 through to 10 and then 1 through to 5...
    the error i am getting is not all variables bound exception..
    please if anyone could help....
    Thanks

    I am new to OA Fwk, but I am Expert of java, J2EE.
    My solution will work fine in pure java.
    I am sure same should work in OA also.
    But I never experimented it. Give it a try
    Lets take a select query:
    select my_col from my_table where clo1 = :1 and col2 = :1
    In this query there is only one bind varible ":1" in the world of PL/SQL.
    But for there are two bind varibales you need to set them two times.
    in java you will do
    stmt.setString(1, myval);
    stmt.setString(2, myval);
    Now coming to your query.
    It has 10 +5 total 15 bind variables and you need to set 15 but not 10.
    For all practicle purposes assume that :1 or :2 or :3 is equivalent to ?
    Thus your select query is equivalent to
    SELECT *
    FROM (SELECT a.kri_description, a.kri_id
    FROM xx_key_result_indicators a, xx_kri_positions b
    WHERE TO_DATE (?, 'DD-MON-YYYY') BETWEEN a.effective_from_date
    AND a.effective_to_date
    AND TO_DATE (?, 'DD-MON-YYYY') BETWEEN b.effective_from_date
    AND b.effective_to_date
    AND a.kra_id = ?
    AND a.kri_id IN (
    SELECT c.kri_id
    FROM xx_kri_positions c
    WHERE TO_DATE (?, 'DD-MON-YYYY')
    BETWEEN c.effective_from_date
    AND c.effective_to_date
    AND c.position_id = ?
    AND c.enable_flag = 'Y')
    AND b.position_id = ?
    AND a.enable_flag = 'Y'
    AND b.enable_flag = 'Y'
    AND a.kri_id NOT IN (SELECT NVL (g.kri_id, 1)
    FROM xx_perf_kri g
    WHERE g.perf_kra_id = ?)
    UNION
    SELECT f.kri_description, f.kri_id
    FROM xx_key_result_indicators f
    WHERE TO_DATE (?, 'DD-MON-YYYY') BETWEEN f.effective_from_date
    AND f.effective_to_date
    AND f.kra_id = ?
    AND f.kri_id NOT IN (SELECT e.kri_id
    FROM xx_kri_positions e)
    AND f.enable_flag = 'Y'
    AND f.kri_id NOT IN (SELECT NVL (d.kri_id, 1)
    FROM xx_perf_kri d
    WHERE d.perf_kra_id = ?)) qrslt
    WHERE (( UPPER (kri_description) LIKE ?
    AND ( kri_description LIKE ?
    OR kri_description LIKE ?
    OR kri_description LIKE ?
    OR kri_description LIKE ?)))
    you need to set the values in the order in which bind varibale appear in select query

  • Bind Variables...Urgent

    Thanks!
    I build a SQL statement, PARSE and Execute...
    Begin :l_result := Test(pa01=>':pa01',pa02=>':pa02'); End;
    I am binding ':pa01', ':pa02'
    When I try to Bind variables, it throws error "ORA-01036 illegal variable name/number".
    Do I need to install any patch - current version Forms [32 Bit] Version 6.0.8.17.1 (Production)

    Placeholders (:name) are bound by position in EXECUTE IMMEDIATE SQL statement. Hence Oracle does not consider multiple :p_comp_id in your statement to be the same thing. You would need to repeatedly bind them for each occurrence, or use an approach (DBMS_SQL.BIND_VARIABLE or EXECUTE IMMEDIATE PL/SQL block) which binds by name or position / name.
    In the case of the above example you would have a USING clause similar to the below (Note that I am unable to test this).
    EXECUTE IMMEDIATE sql_statement
       USING p_comp_id, p_comp_id, p_site_id,
          p_site_id, p_task_type, p_comp_id,
          p_po_no, p_ebiz_sku_no, p_sku_status,
          p_lp, p_batch_no, p_comp_id;

  • 2LIS_I0_NOTIF problem - Very Urgent

    Hi All,
    I am trying to extract the records using RSA3 from datasource 2LIS_18_I0NOTIF. I am getting the error as
    Runtime errors         CONNE_IMPORT_WRONG_COMP_TYPE
    Exception              CX_SY_IMPORT_MISMATCH_ERROR
    Error when attempting to IMPORT object "MC18I00NTF_TAB".
    What happened?
    Error in ABAP application program.
    The current ABAP program "SAPLMCEX" had to be terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    When attempting to import data, it was discovered that the data
    type of the stored data was not the same as that specified in the
    program.
    Error analysis
    An exception occurred. This exception is dealt with in more detail below
    . The exception, which is assigned to the class 'CX_SY_IMPORT_MISMATCH_ERROR',
    was neither
    caught nor passed along using a RAISING clause, in the procedure
    "MCEX_BW_LO_API" "(FUNCTION)"
    Since the caller of the procedure could not have expected this exception
    to occur, the running program was terminated.
    The reason for the exception is:
    When importing the object "MC18I00NTF_TAB", the component no. 32 in the
    dataset has a different type from the corresponding component
    of the target object in the program "SAPLMCEX".
    The data type is "C" in the dataset, but "D" in the program.
    *-- Application '18' (customer service)
    >           sel 'MC18I00NTF' mc18i00ntf_tab  mc18i00ntfsetup.
    Pls. help me out for the above problem as this is of very high priority for me.
    Regards,
    P B

    HI PB,
    how did you solve this problem ?
    I got the same...
    Regards,
    Fernando

Maybe you are looking for

  • How can I get an app from my Itunes library onto my Ipad?  I have it synced and turned on home sharing

    Which icon on the ipad should i click on to see the app contents from my Itunes library? When I click on the music and video icons on the ipad, i can see shared items from my itunes.  is there an icon i can click on in the ipad to find apps from my i

  • IPhoto 6 not importing iPhoto 5 library

    Everything has gone so well with my new MacBook Pro transition, except one thing. I copied my "iPhoto library" (iPhoto 5 on a Powerbook G4) from the Users/Pictures folder on my old laptop to the Users/Pictures folder on my new MacBook Pro. When I ope

  • 2LIS_11_VAHDR not extract the latest sales

    Hi gurus. I need to make one query with the sales dates. For this, I use 2LIS_11_VAHDR and 2LIS_11_VAITM data sources. The problem is that the sources extract the date between 2003-2005. I need also the sales dates between 2005-2009. I don't haw to m

  • Default Info update Indicator

    Dear Experts I dont want Info Update Indicater (default) in Purchase Order,please guide me where i have to set to come as a unticked at the time of create a Purchase order. I am waiting for ur reply Thanks

  • Email authentication problem

    We are installing OCS v 9.0.4.1.0 on Red Hat Linux 3.0. During setup we entered the outgoing email server as mail.companyname.com, which is how our email accounts are set up. Our SMTP server (outside provider) requires authentication, so in order to