Stuck with showDetails, View Bind Variable and I18N

Hi all,
I have a very weird situation.
I am creating a view object with a bind variable.
I then create a JSF page, and drag a table based on the view to the screen.
I now drag the "ExecuteWithParam" action to the screen, and create it as a parameterized form.
This works fine - english or hebrew (in my case).
I know surround the parameter form with a showDetails component.
I enter values to the parameter, and click on the hide link. I click on the show link - all I get is a list of ? marks for hebrew characters, but the correct characters for english characters.
Everything works fine if the showDetails component contains regular input texts, or input texts that show/edit values from the view objects (but not bind variables).
If I put the bind variable on the screen (outside the showDetails), in addition to putting the form inside the showDetails component, then the following occurs:
1. Changes in the param form are ignored if I click on the show/hide link.
2. Hebrew works when I edit the input text that is outside the showDetails. This updates the value in the show details, and it displays hebrew correctly.
Very odd. Any tips?

First of all i would like to thank you for replying to my thread.
Secondly, i would like to inform you that the example that i have provided is just for REPRODUCTION purposes.
The real scenario has to do with setting the where clause with the authenticated user so that the view will query for data only associated with the authenticated user.
The only way to overcome this behaviour is to include a view action (namedWhereClause in the page definition)
However, this is not how i want to implement this. This was working properly in 10g

Similar Messages

  • ORA-01722: invalid number caused with SQL using bind variable

    Hi,
    Im am hoping that someone can help me resolve a problem thats only just services and is being experienced on quite a few clients.
    our application uses C++ exes and makes OCI calls to the database.
    what has happened in the last week or so, there has been quite a few invalid number errors being received on a prod server but strangly enough we cannot reproduct the error on our UAT system.
    The sql is using bind variables and the information in the trace file shows that a number is being used for the bind variable, here is an extract from one trace file:
    for some schemas, the bind variable value is some currupted value, i think:
    oacdty=01 mxl=32(21) mxlc=00 mal=00 scl=00 pre=00
    oacflg=03 fl2=1206001 frm=01 csi=178 siz=32 off=0
    kxsbbbfp=9a8d62b8 bln=32 avl=03 flg=05
    value="Â*d"
    but on another schema, the value used is:
    Bind#0
    oacdty=01 mxl=32(32) mxlc=00 mal=00 scl=00 pre=00
    oacflg=03 fl2=1206001 frm=01 csi=178 siz=32 off=0
    kxsbbbfp=c5f92718 bln=32 avl=04 flg=05
    value="2101"
    however both produce invalid number errors.
    I am relatively inexperienced as a DBA so would appreciate as much help as i can get.

    Could you post your sql statement that is being run.
    Also post the query plan from your uat system and the one from your production system (They are likely to be different)
    You can export the stats from your production system and run them in your uat system. If you do this, then the execution plans should be the same on both systems(dbms_stats) and if you have the same data you should run into the same problem on uat as in production.
    The root cause of this type of problem is having a column in a table which holds values which are of different datatypes. Typically there is a condition in the where clause which indicates that for example only numeric columns should be retrieved from the column which holds multiple data types. However since the optimizer is free to rewrite the query any way it sees fit, (It does not necessarily execute in the order the sql statement is written) it does not filter this data first, and therefore you hit non-numeric data and run into the invalid number error.
    You can use little techniques like using an inline view with rownum in the column list, to perform the first filter. This ensures that the inline view is executed on its own, rather than being merged (materialized) with the rest of the query.
    A quick temporary solution is to use a comparison like to_char(column_name) = variable
    Make sure your comparisons are correct and it doesn't negatively impact on performance of the query

  • Bind Variables and Shared Component Report Query

    I have a query in a region report which I have replicated to a shared component report query.
    Both queries reference page items as bind variables in the where clause.
    The report region on screen shows the correct results but the report query shows "no data". This is the case when running "Test Query" and "Download XML data" from the shared component report query definition. If I hardcode the variable names I get rows returned, If I use bind variables - and specify the values for these variables I get no data. THe XML file contains the tags for each bind variable I have specified but has no data between the tags. I have Ticked the box to include application and session state but it appears that the bind variables are not being used.
    When I use my report query in the application (URL tied to a button) I get the same problem, the binds are not being passed to the report query.
    Can someone please clarify if this is a bug or not? And if not, how can I get it to work.
    I am using Apex 4.0.2
    Thanks
    Kathryn

    Hi
    To confirm, yes I selected the bind variables. I used these in the report layout, but the xml file has them as empty i.e.
    <P0_START_DATE><P0_START_DATE/> with nothing in between.
    IN the Test Query section, if I put real values in the boxes for the bind variables, I get no data found. If I hardcode the values into the query, I get the data.
    I've repeated the create report query many times and have created a report layout in RTF. I can use the layout with my region - in the print attributes and the layout works with the query but I need to create a PDF using 2 queries - ROWSET1 and ROWSET2. I can generate the XML but the values in the rows are all empty. When I use the layout with a report query instead of the region, I get no data even though I have used the same sql and have selected the bind variables. I was using variables from page items on page zero but have also tried using page items on the current page, the result is the same.
    I need to use a report query and a report layout as I need data from 2 queries in the PDF.
    I looked at your demo - what happens if you add a second sql query to the report query - is there any chance I can look at the back end (developer access?)
    Thanks for your input
    Kathryn

  • Can I put a SQL query into a bind variable and then use it to output report

    Hi,
    Can I put a SQL query into a bind variable and then use it to output report?
    I want to create a report and an item "text area" (say P1_TEXT) which can let user to input a SQL query(they are all technical users and knows SQL very well). Then, I use a bind variable (that text area) to store the SQL statement. Then, I add a submit button and I want to use the following to output the report:
    select * from (:P1_TEXT);
    Do you think it is possible to do that? Any known limitations for APEX in this area?
    Thanks a lot,
    Angela

    You can, but make sure it's what you really want to do. Make sure you are VERY familiar with SQL Injection. Most people who know what it is, go out of their way to prevent SQL Injection. You're going out of your way to allow it.
    You can try using &P1_TEXT. instead of bind variable syntax. Bind variables are one of the best ways to prevent SQL Injection, which is why it's not working for you.
    Once again, I strongly urge you to consider the implications of your app, but this suggestion should get it working.
    Tyler

  • View with Bind Variable and ADF table

    Hi all,
    Please note what i have noticed. I created a view with a bind parameter, overriden the prepareSession of my Application Module to set the bind parameter and execute the query. I then created a simple jsf page and included the view as an adf read-only table. When i run the page, the prepareSession is called, sets the bind parameter, however the selected record of the table is always the second record (Not the first record).
    This behaviour can be reproduced with the HR schema. Please follow the below instructions for reproducing the problem.
    1. Create a Fusion Web Application (ADF).
    2. Create business components from tables.
    3. Create a new connection with the HR schema.
    4. Import the Departments table as an entity and then click finish.
    5. Create a view based on the Departments entity.
    6. Modify the Query to include a where clause (where DDepartmentsEO.DEPARTMENT_NAME LIKE :BindParam)
    7. Provide an order by clause (DepartmentsEO.DEPARTMENT_ID DESC)
    8. Creata a bind variable named "BindParam" of type string.
    9. Create an Application Module and include the view object.
    10. Open the Application Module Class and override the prepareSession method
    11. include the following code after super.prepareSession(session):
    ViewObject myView = this.getDepartments1();
    myView.setNamedWhereClauseParam("BindParam", "%");
    myView.executeQuery();
    12. Create a jsf page
    13. Drag the view object on the page as an adf read-only table, selecting the Row Selection, Sorting and Filtering
    14. Run the page.
    You will see that instead of the first record being selected, the second record in the table is selected.
    Can anyone please help me?
    Thank you

    First of all i would like to thank you for replying to my thread.
    Secondly, i would like to inform you that the example that i have provided is just for REPRODUCTION purposes.
    The real scenario has to do with setting the where clause with the authenticated user so that the view will query for data only associated with the authenticated user.
    The only way to overcome this behaviour is to include a view action (namedWhereClause in the page definition)
    However, this is not how i want to implement this. This was working properly in 10g

  • Af:query with bind variables and Saved Search

    I have a VO and view criteria(VC).
    VC has a criteria item ObsoleteDate with range specified as bindVariables "dateFrm" and "dateTo" I dragged & dropped the named criteria as af:Query with table. Table toolbar has 2 buttons in which I set & clear the bind variables. Data is fetched as per as expected based on the VC & bind variables.
    The problem is,
    If I save my search with bind variables set and swap between the saved searches , all works fine. But the moment I clear bind variables & swap between searches.. "dateFrm" is populated and "dateTo" is null and I get an Exception oracle.jbo.AttrValException: JBO-27035: Attribute Obsolete Date: is required.
    Why is this happening?? Saved search is supposed to save the VC with all the bind values set while saving and clearing bind variables shouldn't affect the saved search, right?? Or I have understood it wrong?
    I am using JDeveloper 11.1.2.3.0
    Thanks

    Try
    like ? || '%'

  • BC4J: Question on bind variables and DML in view objects

    Hello,
    I have a view object with a bind variable in the WHERE clause of the underlying query. I'm curious about how the state of this bind variable affects the use of the view object for inserting, updating, etc., at various stages of the commit cycle (before posting changes, after posting changes, after commit).
    Specifically, what happens in the following scenarios?
    1. The bind variable is not bound (and the query has not been executed) and a row is inserted into the VO
    2. The bind variable is set to some value and an inserted or updated row in the VO does not meet the criteria specified by the bind variable; the transaction is then committed
    If there is a weblog entry, help file, or HOWTO somewhere, I'd welcome a link to it.
    Thanks,
    Alan

    The variable would only come into play when the VO's query is executed. It can be executed implicitly -- for example, accessing the first() row if the query hasn't been executed yet -- or explicitly by a call to executeQuery().
    By setting setMaxFetchSize(0) on your VO, no rows will be fetched and you can use the VO for insert only.

  • Query With Bind Variables and %

    Hi,
    Quick question. I am using ADF BC on Jdev 11 with a MySQL Database.
    I've used Bind Variables in the past (I have to use a Question Mark [?]) and have had no problem.
    Now I want to do something like this in my where clause:
    SELECT TempTable.ABC FROM TempTable
    WHERE ABC LIKE ?%
    When I try and create the View Object with that query it is complaining about the %.
    Am I required to append the % in my bind variable? Any examples I have seen of this, people are doing something like :p_id = 'Jo%'

    Try
    like ? || '%'

  • ADF Groovy Expression with bind variable and ResourceBundle

    Now I have ViewObject which have WHERE clause with bind variable.
    This bind variable is for language. Within bind variable I can change Value Type to Expression and into Value: I put +(ResourceBundle.getBundle("model.ModelBundle")).getString("language")+.
    Now if I run Oracle Business Component Browser (on AppModule) this works. In my ModelBundle.properties there is language=1 name-value pair. And with different locale I have different language number.
    Now if I put that ViewObject on one JSF, this bind variable expression does not work any more. Error:
    *oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.util.MissingResourceException, msg=Can't find bundle for base name model.ModelBundle, locale my_locale*
    Any ideas?
    10x
    Zmeda

    The most wierd thing is that, if I make ViewObjectImpl and insert this method
    public String getLanguage() {
    return (ResourceBundle.getBundle("model.ModelBundle")).getString("language");
    and call it in Bind Variable Expression Value: viewObject.getLanguage()
    IT WORKS!
    But why with groovy expression it does not work?
    Zmeda

  • Af:query stuck on previous search bind variables if set manually

    I'm not sure if this is a bug or we're just doing something we're not supposed to do. It totally threw me off.
    We didn't like any of the built-in ways of making a list type search, but we liked different aspects of different things available. So we created out own search component using a declarative component. The way it works is that we have an auto complete field which is a text field that pops up a table styled how we want it. When clicking or navigating onto the popup and pressing enter, it would select the value. We also wanted a more advanced search type thing which is pretty much the ADF LOV which pops up a dialog with essentially an af:query with a table. So we just put an image next to the search field that would pop up such a dialog.
    One thing we wanted as well was to use the same collection for both the table in the auto complete popup and in the dialog. The dialog is allowed to have more columns or even different columns for that matter, but same collection model.
    The problem is that I noticed that when I use the auto complete and then go to the dialog, the af:query would stop working. If the first thing I do is to go to the dialog, it would work fine. For the auto complete part, I'm calling ExecuteWithParams from the view criteria of our ADF BC View's Data Control. It seems like once we set the bind variable on the view manually, the af:query is stuck on the value that was set and the search button no longer responds to the search filters there. Can someone confirm if this is expected? It seems like Oracle did not expect that the same view would be used on an af:query's table and another table.

    Thinking about this some more, I guess what I need is to somehow when I popup the dialog reset the view's bind variable to their initial state. Setting them to NULL or empty string doesn't do it. Then it's stuck on those values. I need to set it to whatever af:query expects.

  • How to update bind variable and restrict values in a Model Driven LOV?

    Hi Guys,
    Using JDev 11.1.1.2.0
    I've recreated an excellent Frank Nimphius article about restricting values derived from a model driven LOV (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/44-restrict-lov-169186.pdf)
    But my bind variable isn't updating. Deleting the bind variable gets me the entire LOV. Activate the code below and insert a bind variable into the where clause like Frank says and I get nothing back. Bind variable is blank. Any ideas? Code wasn't supplied with the article. It seems simple enough but the bind variable isn't updating in the SQL, even though the updated value shows up here...
      public void onLovLaunch(LaunchPopupEvent launchPopupEvent)
        BindingContext bctx = BindingContext.getCurrent();
        BindingContainer bindings = bctx.getCurrentBindingsEntry();
        FacesCtrlLOVBinding lov = (FacesCtrlLOVBinding)bindings.get("DepartmentId");
        lov.getListIterBinding().getViewObject().setNamedWhereClauseParam("deptId","60");
        System.out.println("lov name: " + lov.getName().toString());
        System.out.println("lov Param Attrs: " + lov.getListIterBinding().getViewObject().getNamedWhereClauseParams().getAttribute("deptId").toString());
        System.out.println("lov View Object: " + lov.getListIterBinding().getViewObject().getName().toString());
        System.out.println("lov IterBinding: " + lov.getListIterBinding().getName().toString());
       }Gets me ...
    lov name: DepartmentId
    lov Param Attrs: 60
    lov View Object: _LOCAL_VIEW_USAGE_lov_model_queries_EmployeesView_DepartmentsView
    lov IterBinding: DepartmentIdList_2

    That's a good idea, but it's still not working. Here is how I implemented it. It might be different from your suggestion as I'm still pretty new to this.
    I have a recursive tree table. You select a node. You then click a button which calls the listener below. "findParents" is a method call to the AppModuleImpl class and it finds all parent nodes of your selection. "restrictPartBomLOV", also of the AppModuleImpl class, then modifies the model driven lists' View Object (partBomLOV) to exclude those parent node values.
    The resulting model driven LOV on the popup should be updated, yeah? But it still isn't udpating. If I manually type in the updated Where clause in PartBomLOV.xml query tab, it works, but it doesn't programmatically.
      public void insertPopupFetchListener(PopupFetchEvent popupFetchEvent)
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("findParents");
        parents = (List)operationBinding.execute();
        operationBinding = bindings.getOperationBinding("restrictPartBomLOV");
        operationBinding.execute();
       public void restrictPartBomLOV(List parents)
          ViewObjectImpl vo = getPartBomLOV();
          String wcl = "";
          Object[]   p = parents.toArray();
          for(int i = 0; i < p.length; i++)
             if (i == 0)
                wcl = wcl + "PNUM <> '" + p.toString() + "'";
    else
    wcl = wcl + "AND PNUM <> '" + p[i].toString() + "'";
    vo.setWhereClause(wcl);
    System.out.println(vo.getWhereClause().toString());
    vo.executeQuery();
    Edited by: LovettWB on Nov 11, 2010 11:23 PM

  • Inconsistent datatypes: expected - got CHAR, Detail view bind variables

    Hi.
    Here is my problem:
    I have master detail views connected with a view link. Both of views have bind variables that hold some session info:
    It's a menu on database and I am trying to hide some values based on user permissions.
    When running application module, everything works fine. The problem occurs when I try to show menu as a tree table, or any other table, on a page.
    The root view executes fine, but then I get an
    "java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got CHAR"
    error in executeQueryForCollection method of detail view. (this method is overridden)
    Bind Variables are:
    - :menuRoot -> which holds value of Root node. (In detail view it's just a dummy variable. It is explaned later on why i used it.)
    - :listOfUserPermmission -> array of user permissions.
    My query looks like this:
    1.Master View:
    SELECT MetVMenu.CHILD_ID,
           MetVMenu.CHILD_IME_MODULA,
           MetVMenu.PARENT_ID,
           MetVMenu.PARENT_IME_MODULA,
           MetVMenu.ZST,
           MetVMenu.NIVO,
           MetVMenu.CHILD_NAZIV_V_MENIJU,
           MetVMenu.CHILD_TIP_MODULA,
           MetVMenu.CHILD_OPIS_MODULA
    FROM MET_V_MENU MetVMenu
    WHERE MetVMenu.PARENT_IME_MODULA like :menuRoot
    and MetVMenu.CHILD_IME_MODULA in (SELECT * FROM TABLE(CAST(:listOfUserPermission AS STRARRAY)))CHILD_IME_MODULA and PARENT_IME_MODULA are also names of permissions.
    2.View Link that connects master.CHILD_ID and detail PARENT_ID
    3.Detail view, that then links to itself... to get the tree menu.
    SELECT MetVMenu.CHILD_ID,
           MetVMenu.CHILD_IME_MODULA,
           MetVMenu.PARENT_ID,
           MetVMenu.PARENT_IME_MODULA,
           MetVMenu.ZST,
           MetVMenu.NIVO,
           MetVMenu.CHILD_NAZIV_V_MENIJU,
           MetVMenu.CHILD_TIP_MODULA,
           MetVMenu.CHILD_OPIS_MODULA
    FROM MET_V_MENU MetVMenu
    WHERE :menuRoot like 'a'
    and
    MetVMenu.CHILD_IME_MODULA in (SELECT * FROM TABLE(CAST(:listOfUserPermission AS STRARRAY)))4. ViewLink that connects CHILD_ID and PARENT_ID of this "detail" view.
    Both views executeQuery methods are overridden to set Bind variables before execution.
    I get an arrayList of strings (permissions) from session and then convert it to Array.
         ArrayList permmissionsArray = (ArrayList)MyUserSession.getSessionValue("permissions");
         Array permissions = new Array(permissionsArray.toArray());
            HashMap context = new HashMap();
            context.put(DomainContext.ELEMENT_SQL_NAME, "STRARRAY");
            context.put(DomainContext.ELEMENT_TYPE, String.class);
            if(permissions != null){
                permissions.setContext(null, null, context);
                setlistOfUserPermission(permissions);
         //Here I set menuRoot variable.
         I also noticed that there are problems with how I define bind variables (the order matters).
    So when i didn't use menuRoot variable in detail view I got the
    “inconsistent datatypes: expected - got CHAR"
    error in application module.

    I went through those links, and I am sure the user has enough rights on STRARRAY object.
    I noticed that when running application module things work fine if I firstly execute RootView - Master view.
    and then double click on VL which shows detail view in table.
    The error occurs if I click on ViewLink first. I am not sure if I am even "allowed" to do that.
    I set the parameters with "setNamedWhereClauseParam" and print them out before i call super.executeQueryForCollection() and this the output i get:
    ExecuteQueryForCollectionRoot
    Permission: [AdfIn2Ogrodje.ROOT, AdfIn2Ogrodje.ADMINISTRACIJA, HOME]
    [87] MetVMenuRoot1 ViewRowSetImpl.setNamedWhereClauseParam(listOfUserPermission, oracle.jbo.domain.Array@e1af74d9)
    [88] MetVMenuRoot1 ViewRowSetImpl.setNamedWhereClauseParam(menuRoot, AdfIn2Ogrodje.ROOT)
    //Print before execution.
    EXECUTE_MENUROOT menuRoot: AdfIn2Ogrodje.ROOT
    EXECUTE_MENUROOT permission: oracle.jbo.domain.Array@e1af74d9
        Permission: AdfIn2Ogrodje.ROOT
        Permission: AdfIn2Ogrodje.ADMINISTRACIJA
        Permission: HOME
    [89] MetVMenuRoot1>#q computed SQLStmtBufLen: 537, actual=447, storing=477
    [90] SELECT MetVMenu.CHILD_ID,         MetVMenu.CHILD_IME_MODULA,         MetVMenu.PARENT_ID,         MetVMenu.PARENT_IME_MODULA,         MetVMenu.ZST,         MetVMenu.NIVO,         MetVMenu.CHILD_NAZIV_V_MENIJU,         MetVMenu.CHILD_TIP_MODULA,         MetVMenu.CHILD_OPIS_MODULA FROM MET_V_MENU MetVMenu WHERE MetVMenu.PARENT_IME_MODULA like :menuRoot and MetVMenu.CHILD_IME_MODULA in (SELECT * FROM TABLE(CAST(:listOfUserPermission AS STRARRAY)))
    [91] ViewObject: [adfin2.menu.model.views.MetVMenuRoot]MetMenuAppModule.MetVMenuRoot1 Created new QUERY statement
    [92] Bind params for ViewObject: [adfin2.menu.model.views.MetVMenuRoot]MetMenuAppModule.MetVMenuRoot1
    [93] Binding null of type 12 for "menuRoot"
    [94] Binding null of type 12 for "listOfUserPermission"
    protected void executeQueryForCollection(Object object, Object[] object2, int i) {
            System.out.println("ExecuteQueryForCollectionRoot");
            setParametersForSessionTest(); // method where i set the parameters.
            printExecute(); // printing
            super.executeQueryForCollection(object, object2, i);
        }After a few clicks on OK button the query executes normally.
    What I am guessing is, that executeQueryForCollection just takes whatever is in object2 and that's null at the beginning.
    I tried to use this method, which sets the bind variables in object2. And it gives me "Invalid column type" error.
    http://packtlib.packtpub.com/library/9781849684767/ch04lvl1sec07

  • Viewing Bind variable values in TKPROF output

    DB Version:10gR2
    After tracing a Stored proc , i can see the bind variable values in the raw trace file. But the TKPROF output of this trace file doesn't show Bind variable values. Is there a way i could see Bind variable values in TKPROF output?

    I guess when you think about it, TKPROF is primarily intended to aggregate and summarise repeated SQLs and related statistics from raw trace files. While waits can reasonably be aggregated over multiple exeuctions of the same SQL, bind variables are explicitly associated with individual executions of an SQL and hence cannot be aggregated in the same fashion.

  • Bind variable and parameter problem

    Hello, I'm migrating a complex report from Oracle Report to BI Publisher. Now I have some problems with the bind variables. In order to explain the question clearly, I simplified the code as below. The value of e1 and sum1 can be generated correctly. The problem is that the value of e2 can not be generated.
    <dataTemplate name="dt" defaultPackage="dt">
         <properties>
              <property name="xml_tag_case" value="upper"/>
         </properties>
         <parameters>
         </parameters>
         <dataQuery>
              <sqlStatement name="q1">
                   <![CDATA[
    select     col1 c1, col2 c2, function1(:c1) e1,
    from     table1
    ]]>
              </sqlStatement>
              <sqlStatement name="q2">
                   <![CDATA[
    select     col3 c3, col4 c4, function2(:sum1) e2,
    from     table2
    ]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="g1" dataType="varchar2" source="q1">
                   <element name="e1" dataType="number" value="e1"/>
              </group>
              <group name="g2" dataType="varchar2" source="q2">
                   <element name="sum1" function="sum" dataType="number" value="g1.e1"/>
                   <element name="e2" dataType="number" value="e2"/>
              </group>
         </dataStructure>
    </dataTemplate>I tried to replace the bind variable ":sum1" in the function2(:sum1) with a value, e.g. 5. And e2 can be generated correctly. So my guess is that ":sum1" is not correctly parsed to function2.
    Please help if you have any idea of what may cause the problem.
    Thank you in advance.

    Thank you. Now the problem is clear and it relates to the conversion of the report.
    I posted a new question in Report conversion compatibility problem (argument, formula and sum column) .

  • Getting Errors in PL/SQL - bad bind variable and encountered the symbol...

    CREATE OR REPLACE TRIGGER update_QOH
    AFTER INSERT ON ORDERLINE
    FOR EACH ROW
    DECLARE
         QOH_PRODUCT PRODUCT.QOH%TYPE;
    BEGIN
         SELECT QOH INTO QOH_PRODUCT FROM PRODUCT WHERE :old.product_no = :new.product_no;
         IF :new.QTY <= :old.QOH THEN
              QOH = :old.QOH - :new.QTY
         ELSE
              send_email(ord_no, 'Backorder');
              INSERT INTO BACKORDER (backorder_no_seq.NEXTVAL, :new.product_no, :new.qty, SYSDATE);
              INSERT INTO PRODVENDOR (po_no_seq.NEXTVAL, :new.vendor_no, :new.product_no, :new.vend_qty, :new.shipping_method, SYSDATE, NULL, NULL, NULL);
         END IF;
    END;
    Error(5,17): PLS-00049: bad bind variable 'OLD.QOH'
    Error(6,7): PLS-00103: Encountered the symbol "=" when expecting one of the following: := . ( @ % ;
    Error(6,9): PLS-00049: bad bind variable 'OLD.QOH'

    Hi,
    Welcome to the forum!
    I see 4 mistakes:
    851543 wrote:
    CREATE OR REPLACE TRIGGER update_QOH
    AFTER INSERT ON ORDERLINE
    FOR EACH ROW
    DECLARE
         QOH_PRODUCT PRODUCT.QOH%TYPE;
    BEGIN
         SELECT QOH INTO QOH_PRODUCT FROM PRODUCT WHERE :old.product_no = :new.product_no;
         IF :new.QTY <= :old.QOH THEN
              QOH = :old.QOH - :new.QTY(1) The variable qoh isn't declared.
    (2) Did you mean the assignment operator, :=, rather than the equality operator, = ?
    (3) An assignment statement must end with a semi-colon.
         ELSE
              send_email(ord_no, 'Backorder');(4) The variable ord_no isn't declared.
              INSERT INTO BACKORDER (backorder_no_seq.NEXTVAL, :new.product_no, :new.qty, SYSDATE);
              INSERT INTO PRODVENDOR (po_no_seq.NEXTVAL, :new.vendor_no, :new.product_no, :new.vend_qty, :new.shipping_method, SYSDATE, NULL, NULL, NULL);
         END IF;
    END;
    /While you can reference :NEW and :OLD values in the trigger, it doesn't make any sense to reference the :OLD values. On an INSERT (which is the only time this trigger fires), all :OLD values are NULL.
    >
    Error(5,17): PLS-00049: bad bind variable 'OLD.QOH'
    Error(6,7): PLS-00103: Encountered the symbol "=" when expecting one of the following: := . ( @ % ;
    Error(6,9): PLS-00049: bad bind variable 'OLD.QOH'I don't believe the code you posted is causing these errors. Each of the errors mentioned above would cause a different message. Post the actual code and error messages.
    Whenever you post a question, post all the code necessary for people to re-create the problem and test their ideas.
    In this case, that means CREATE statements for any tables or sequences involved, INSERT statements for any tables that need rows (such as product) as they exist before the INSERT, some INSERT statements for orderline, and the contents of all the tables after each of those INSERTs.
    Always say which version of Oracle you're using.

Maybe you are looking for

  • Número de protocolo de NF-e

    Boa tarde! Implementamos o processo de NF-e em nosso cliente e estamos com a seguinte dúvida: - uma NF-e é enviada para a Sefaz (processo SD) e autorizada; - em um segundo momento essa NF-e é cancelada e o seu cancelamento autorizado. Em paralelo é c

  • Income tax is not calculated After Total Income

    Dear All,                     I am running my payroll but my Income tax is not calculating properly because when am seeing my log then i find my total income is calculated properly but after that my STANDARD DEDUCTION is not been happening according

  • Can't disconnect from other computer on the local network

    We have several Mac's (6) running in our small office, connected via wifi and ethernet.  One of the computers we call the "warehouse" and is used as our storage unit and to run 3 filemaker databases.  This warehouse is still running OS X 7, while the

  • Exchange 2013 Domain Prep Fails: Setup /prepareschema, setup /PrepareAD, Setup /PrepareDomain

    Whenever I try to prep for a 2013 exchange install I always get: "earlier versions of the server roles that are installed were detected" whenever I try to run Setup /prepareschema OR setup /PrepareAD OR Setup /PrepareDomain I am working on a Server 2

  • HP 5520 all-in-one will not print alignment page

    Printer printed page as if there was no black ink. Replaced cartridge and tried to align but would not print a proper alignment page. Replaced all cartridges.Page it prints is not recognized in scan. I have tried everything. UnPlugging, reload paper,