Insert/update in JSP

i an developing a bc4j JSP application.
in my form i have html drop down,poplutaed with values by using show value data tag.
The drop down box contains "decription" field.
now while inserting/updating,i want to find the corresponding desc_id and insert /update this desc _id in another table.
how do i do this?
Please help
Monali

To update/insert data, you can use ExecuteSQL data tag.
Like example:
<%
String desc = request.getParameter("desc");
String desc_id = request.getParameter("desc_id");
%>
<jbo:ExecuteSQL appid="id" > update table set desc=<%= desc %> where desc_id=<%= desc_id %>
</jbo:ExecuteSQL>
Hope this help.

Similar Messages

  • Can not insert/update data from table which is created from view

    Hi all
    I'm using Oracle database 11g
    I've created table from view as the following command:
    Create table table_new as select * from View_Old
    I can insert/update data into table_new by command line.
    But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)
    Anybody tell me, what's happend? cause?
    Thankyou
    thiensu
    Edited by: user8248216 on May 5, 2011 8:54 PM
    Edited by: user8248216 on May 5, 2011 8:55 PM

    I can insert/update data into table_new by command line.
    But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)so what is wrong with the GUI tools & why posting to DATABASE forum when that works OK?

  • Insert / update data to a table through DBLINK (oracle)

    I try to insert / update a table from one instance of oracle database to another one through oracle dblink, get following error:
    java.sql.SQLException: ORA-01008: not all variables bound
    ORA-02063: preceding line from MYLINK
    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:582)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2035)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2876)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
    The same code to insert / update the exact same table in local instance works fine.No any binding problem. So i am pretty sure all ? mark in SQL are set with some value before sending to Oracle.
    Someone please advise what is possible problem. Db link is not set correctly? or we can not update remote table by dblink.
    By the way i can do insert / update from TOAD to the remote table through DBLINK. Problem happens only in Java code.
    thanks!
    Gary

    dblink links from one database instance to another.
    So it is certainly a source of possible problems when it works on one database and not another.
    You should start by looking at the dblink and it possible testing it in the database not via java.
    Note as well that that error suggests that it is coming from the Oracle database. I believe if you had a bind parameter problem in your java code that the error would come from the driver. But that is a guess on my part.

  • Insert/update japanese langunage data in a column of datatype varchar2(..)

    Hello,
    I am using ORACLE DATABASE 11g (EE) and RHEL 5.
    I want to insert/update japanese language data in a column which has the datatype as varchar2(256).
    I tried to change the NLS_LANGUAGE and NLS_TERRITORY parameters with 'ALTER SESSION set ...' command but no effect.
    I tried to bounce back ( shutdown and startup ) the DB but still no effect.
    I tried to inset the NLS_LANGUAGE and NLS_TERRITORY in init.ora file but still no use.
    If anybody knows the detail steps which i have mentioned above .... let me know. Might be that i am wrong in my method.
    Can you please guide me how to change the language of DB for a perticular session to japanese ???
    Thanks in advance...
    Edited by: VJ4 on May 9, 2011 6:21 PM

    VJ4 wrote:
    Thanks for the info.
    Yes i tried with UNISTR function and was able to insert the data successfully.
    but the point is that we can't remember unicode for each of the letter. It's their any method that we can directly insert japanese character using an insert.
    As you said :-
    Note that changing database character set is something complicated that requires many steps.
    Can you please provide me some links or some stuffs to study about the detail steps of chaining database character set.
    I have gone through the Oracle online documentation.. if you can pin point any good link in it you can else provide me some other stuff.
    Thanks .You will need to convert your database characterset to AL32UTF8. This is not a trivial exercise if your database already has data in it. See these MOS Docs
    Changing the NLS_CHARACTERSET to AL32UTF8 / UTF8 (Unicode)          (Doc ID 260192.1)
    AL32UTF8 / UTF8 (Unicode) Database Character Set Implications          (Doc ID 788156.1)
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10729/ch11charsetmig.htm#g1011430
    HTH
    Srini

  • Can you create nested condition in merge(e.g. insert/update) using owb

    Hi,
    Does OWB9iR2 allow you to build in nested condition in merge. such as
    If no match on col1 and col2 then
    if col3 match then no new sequence insert <---
    else insert new sequence;
    else (there is match on col1 and col2)
    update col3 and sequence.
    I have an incremental load for a lookup table, where insert/update is used. There are two match columns and surrogate key is used. When there is no match, it shall not insert a sequence when there is a match on third column. I can not use the 3rd column in the original match because it shall be updated where there is a match for the two match column.
    I am trying to avoid using transformant for performance impact. Thanks

    HIi I think the misleading thing is that in PL/SQL you can use booleans, which is not possible in SQL. So in a PL/SQL tranformation, this is OK:
    a:= case when not orgid_lkup( INGRP1.ORG_ID )
    then get_supid(..)
    else ...
    but, the following SQL does not work:
    select case when not orgid_lkup( INGRP1.ORG_ID )
    then get_supid(..)
    else ...
    into a
    from dual;
    I ended up using only 0/1 as boolean return values for these reasons;
    so I can have:
    select
    case when orgid_lkup( INGRP1.ORG_ID ) = 0 then ...
    though true booleans are better if you don't have to embed them in SQL.
    Antonio

  • Pre Database Insert / Update Validation

    Hi,
    I have a maintenance view that allow user to insert / update.
    Let's say, z_my_table is my table
    key1
    key2
    field1
    field2
    field3
    I want to validate whether field1, field2, field3 whether exist in my table before insert / update.
    However, due to some restriction, I cannot make it as part of the key.
    My question is, how can I capture OR validate it before the data get inserted into the table ?
    I checked some online help, and found that suggestion is to write a function module OR enhancement point.
    Just wonder what is the common practice and how should I do it ? Thanks.

    I don't agree with the design but if you want to do it anyway it can be done using Events in the Maintenance View.
    After you've generated the Maintenance View of your Z table, within SE11 pull out menubar Utilities->Table Maintenance Generator, then menubar Environment->Modifcation->Events. Create New Entries and I think for your requirement you would need 2 entries - one at event 05 and another at event 18. Input the name of your routine and write the code by clicking its corresponding button.
    The following is an example of a scenario where text of an object is retrieved and filled into the view display-only column according to user input of its related object id - for your requirement you would validate the user input after checking the input values in your existing table:
    form fill_text_05.
      data begin of w_total.
              include structure zfv_fbt_acct_rel.
      data: action,
            mark,
      end of w_total.
      data: w_extract type zfv_fbt_acct_rel.
      clear: zfv_fbt_acct_rel-fbt_rel_acc_txt,
             zfv_fbt_acct_rel-fbt_cost_grp_txt.
    * populate GL a/c text
      select txt50 up to 1 rows
             from skat
             into zfv_fbt_acct_rel-fbt_rel_acc_txt
             where spras = sy-langu
             and   saknr = zfv_fbt_acct_rel-fbt_rel_acc.
      endselect.
    * populate Cost Group text
      select single fbt_cost_grp_txt
             from  zft_fbt_cost_grp
             into  zfv_fbt_acct_rel-fbt_cost_grp_txt
             where company_code = zfv_fbt_acct_rel-company_code
             and   fbt_cost_grp = zfv_fbt_acct_rel-fbt_cost_grp.
      if sy-subrc <> 0.
        message e074(zf_enhancements) with zfv_fbt_acct_rel-company_code.
      endif.
    endform.                    "fill_text_05
    Hope this helps.
    Cheers,
    Sougata.

  • Inserting/updating data in control block based on view

    Hi!
    I`ve created a block based on a view to display data.
    I want this block to be insertable and updateable, that is I will use a on-insert/update trigger to call an insert/update procedure located in the database.
    When trying to change/insert a value in the block, the error message "Error: Can not insert into or update data in a view" pops up. I`ve tried to get rid of this error, without success.
    How can I make a data block based on a view insertable and updateable?
    My guess is that this have something to do with locking the records(there is no rowid in the view)... but I'm not sure.
    Pls advise!!

    Morten
    As well as on-update, on-insert, on-delete triggers you also need an on-lock,
    (even though it might just contain null;) otherwise the form will try to lock the view and fail.
    Actually your terminology is wrong, the block being based on a table or view is not a control block. A control block is not based on anything and has no default functionality for communicating with the database. If it was a control block, the on- triggers would not fire.

  • Insert/Update/Delete Non-PO Invoice Line Item via FM/BAPI?

    Does anyone know of a way to insert/update/delete an Invoice Line item (Non-PO Accounting Invoice - Transaction FB60 or FV60) using a BAPI or Function Module (or set of function modules) using ABAP? I have been trying to find some code to accomplish this and am stuck on a couple of issues.
    I have found PRELIMINARY_POSTING_FB01 and PP_CHANGE_DOCUMENT_ENJ but both seem to submit the details to background processes. This is an issue because it gives the user a success message after execution but later delivers the error to Workflow. This is for an interfacing program so the results should be as real time as possible.
    Has anyone accomplished this via FM or BAPI and if so would you mind sharing your experiences?
    Thank you very much,
    Andy

    SG- Thank you for the reply.
    I have been playing with BAPI_INCOMINGINVOICE_PARK and I'm not sure if it is doing exactly what we want, but it is something that I have considered in the past. I plan on looking into BAPI_ACC_INVOICE_RECEIPT_POST this morning, hopefully that will provide some more for us.
    If possible I'd like to avoid BDC sessions because this program could hypothetically interface with multiple SAP systems with different configurations.
    I will check into those FM's and thank you very much.

  • How to find out who made inserts/updates/deletes made to a SQL Table

    I want to know WHO MAKES INSERTS/UPDATES/DELETES TO a particular SQL Table. Bascially I want to AUDIT ANY Edites made to a SQL 2008 TABLE. I need info such as WHO AMDE THE Updates i.e. the user first/lastname, When update was made, what row was updated etc...How
    can I do that with SQL 2008?

    One way to achieve that would be to use triggers to detect when a change is made to the table, and then insert a record into another table/database detailing what changed and who by.
    You'd need three triggers, one for insert, update and delete respectively, and for each of those you use the "inserted" and "deleted" tables (system tables maintained by SQL) to retrieve what has been done. To retrieve who made the change you can query IDENT_CURRENT
    which returns the last identity value for a specific table.
    See :
    Triggers -
    http://msdn.microsoft.com/en-gb/library/ms189799(v=sql.100).aspx
    Inserted & deleted tables -
    http://technet.microsoft.com/en-us/library/ms191300(v=sql.100).aspx
    INDENT_CURRENT -
    http://technet.microsoft.com/en-us/library/ms175098(v=sql.100).aspx
    There may be better / more up to date ways to do this, but I've used this method successfully in the past, albeit a long time ago (on a SQL 2000 box I think!).

  • Search criteria for insert/update bdoc

    Hi All,
    In our set up we have ecc to crm replication of BP. If one goes and checks the extension data of a stuck bdoc it has an Object Task- Insert or Update.
    Can someone help me with search criteria so that i can pull out bdocs which have an Insert as the Object task ??
    We have search criteria for errored/intermediate state bdocs; for inbound vs outbound; bdoc type etc etc..
    Need one based on Insert/Update Task so that any new data replication if stuck with its very first bdoc( Insert type) can be immediately queried.
    Regards
    Abhinav

    Hello Abhinav,
    I do not think that we have such a search criteria to search for BDocs based on the Task Type, which comes under the
    data part of the BDoc.
    One alternative way is to find out in which table these data gets stored and write a program to fetch the revelent Bdocs.
    Hope thisl helps!
    Best Regards,
    Shanthala Kudva

  • Insert,update and delete data in a table using webdynpro for abap

    Dear All,
    I have a requirement to create a table allowing the user to add rows in it and update a row as well as delete a row from that table.To do this I guess I have to make use of ALV.But using ALV I am not able to enter data to a table where as I can make a column editable delete a row etc. please guide me to perform these operations(insert,update and delete) on table.
    Thanks,
    Reddy.

    Hi Sridhar,
    By using ALV you can do all insert delete etc things. if you want to edit i mean you can yenter data in ALV.
    Check this...
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1
    Editing alv in web dynpro
    editing rows in alv reports
    Re: editing rows and columns in alv reports in webdynpro abap
    Cheers,
    Kris.

  • Insert, update and delete trigger over multiple Database Links

    Hello guys,
    first of all I'll explain my environment.
    I've got a Master DB and n Slave Databases. Insert, update and delete is only possible on the master DB (in my opinion this was the best way to avoid Data-inconsistencies due to locking problems) and should be passed to slave databases with a trigger. All Slave Databases are attached with DBLinks. And, additional to this things, I'd like to create a job that merges the Master DB into all Slave DB's every x minutes to restore consistency if any Error (eg Network crash) occurs.
    What I want to do now, is to iterate over all DB-Links in my trigger, and issue the insert/update/delete for all attached databases.
    This is possible with the command "execute immediate", but requires me to create textual strings with textually coded field values for the above mentioned commands.
    What I would like to know now, is, if there are any better ways to provide these functions. Important to me is, that all DB-Links are read dynamically from a table and that I don't have to do unnecessary string generations, and maybe affect the performance.
    I'm thankful for every Idea.
    Thank you in advance,
    best regards
    Christoph

    Well, I've been using mysql for a long time, yes, but I thought that this approach would be the best for my requirements.
    Materialized View's don't work for me, because I need real-time updates of the Slaves.
    So, sorry for asking that general, but what would be the best technology for the following problem:
    I've got n globally spread Systems. Each of it can update records in the Database. The easies way would be to provide one central DB, but that doesn't work for me, because when the WAN Connection fails, the System isn't available any longer. So I need to provide core information locally at every System (connected via LAN).
    Very important to me is, that Data remain consistent. That means, that it must not be that 2 systems update the same record on 2 different databases at the same time.
    I hope you understand what I'd need.
    Thank you very much for all your replies.
    best regards
    Christoph
    PS: I forgot to mention that the Databases won't be very large, just about 20k records, and about 10 queriees per second during peak times and there's just the need to sync 1 Table.
    Edited by: 907142 on 10.01.2012 23:14

  • Insert,update and delete commands

    hi everybody,
    how can i make a button that runs a specific insert update and delete commands
    i am using adf faces jdeveloper 11.1.1.2.0
    than you for all

    thank you guys for your interest what i need in my button click is to take some values from outputtext controls and execute an insert command according to these values what i have done is make a stored procedure and make a client interface function to my amImpl class and i have called getDBTransaction().executeCommand(command); it runs well when i didn't enter values in outputtext controls and it throws an exception when i put the values
    the exception is javax.servlet.ServletException: Unable to resolve a Validator instance using either validatorId '' or binding '#{bindings.FileName.validator}'.
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.portlet.client.adapter.adf.ADFPortletFilter.doFilter(ADFPortletFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.bea.content.manager.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:178)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.lifecycle.filter.LifecycleLockFilter.doFilter(LifecycleLockFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: javax.faces.convert.ConverterException: Unable to resolve a Validator instance using either validatorId '' or binding '#{bindings.FileName.validator}'.
         at com.sun.faces.taglib.jsf_core.ValidatorTag$BindingValidator.validate(ValidatorTag.java:168)
         at org.apache.myfaces.trinidad.component.UIXEditableValue.validateValue(UIXEditableValue.java:345)
         at org.apache.myfaces.trinidad.component.UIXEditableValue.validate(UIXEditableValue.java:172)
         at org.apache.myfaces.trinidad.component.UIXEditableValue._executeValidate(UIXEditableValue.java:503)
         at org.apache.myfaces.trinidad.component.UIXEditableValue.processValidators(UIXEditableValue.java:270)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.access$101(ContextSwitchingComponent.java:39)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$3.run(ContextSwitchingComponent.java:122)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.processValidators(ContextSwitchingComponent.java:125)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.access$101(ContextSwitchingComponent.java:39)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$3.run(ContextSwitchingComponent.java:122)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.processValidators(ContextSwitchingComponent.java:125)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
         at org.apache.myfaces.trinidad.component.UIXForm.processValidators(UIXForm.java:82)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildrenImpl(UIXComponentBase.java:1024)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.validateChildren(UIXComponentBase.java:1009)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processValidators(UIXComponentBase.java:816)
         at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
         at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:700)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$ProcessValidationsCallback.invokeContextCallback(LifecycleImpl.java:1203)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:303)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         ... 42 more
    thank you for help

  • Insert, update and delete on updatable join views

    Hi I need to insert, update and delete data in a views. I tried the foloing example
    http://download-uk.oracle.com/docs/cd/B14117_01/server.101/b10739/views.htm#i1006232
    We have two tables:
    CREATE TABLE dept (
    deptno NUMBER(4) PRIMARY KEY,
    dname VARCHAR2(14),
    loc VARCHAR2(13));
    CREATE TABLE emp (
    empno NUMBER(4) PRIMARY KEY,
    ename VARCHAR2(10),
    job VARCHAR2(9),
    mgr NUMBER(4),
    sal NUMBER(7,2),
    comm NUMBER(7,2),
    deptno NUMBER(2),
    FOREIGN KEY (DEPTNO) REFERENCES DEPT(DEPTNO));
    and one view:
    CREATE VIEW emp_dept AS
    SELECT emp.empno, emp.ename, emp.deptno, emp.sal, dept.dname, dept.loc
    FROM emp, dept
    WHERE emp.deptno = dept.deptno
    AND dept.loc IN ('DALLAS', 'NEW YORK', 'BOSTON');
    this update command works successfully
    UPDATE emp_dept
    SET sal = sal * 1.10
    WHERE deptno = 10;
    but this one fails because it attempts to modify the base dept table, and the dept table is not key preserved in the emp_dept view.:
    UPDATE emp_dept
    SET loc = 'BOSTON'
    WHERE ename = 'SMITH';
    I tried to create the view with "WITH CHECK OPTION" clause but whith no success :(
    My question is: how can I do this with a simple across this view. I rather not use Instead Of Trigger because it take a lot of PL/SQL code :(
    thanks in advance
    Operator

    UPDATE emp_dept
    SET loc = 'BOSTON'
    WHERE ename = 'SMITH';But that doesn't make sense. You cannot just LOC for SMITH, because LOC is not an attribute of EMP. If you change the LOC in the view then you must change it for all employees in DEPT 30 (or whatever).
    The key preserved thing is merely about maintaining your data integrity.
    I rather not use Instead Of Trigger because it take a lot of PL/SQL code :(The problem is, your business rule is not clear. Are you wanting to change the LOC for the DEPT record which is the DEPTNO to which SMITH belongs? Or are you wanting to change SMITH's DEPTNO to be the one for the BOSTON office?
    Cheers, APC

  • How to insert/update Date field in Oracle with java code

    Dear All
    I have to insert/update a date column while creating a new item, but the problem is i am able to insert/update only date but i need both date and time along with AM/PM.
    By using these 3 lines i am able to insert/update only date.
    java.util.Date date = new java.util.Date();
    long dateLong = date.getTime();
    stmtPrep.setDate(33, new java.sql.Date(dateLong));
    Below code retrives the date exactly what i need but unable to pass in the statement:
    DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss a");
    java.util.Date d = (Date) new java.util.Date();
    String stringdate = formatter.format(d);
    String tmpdate = dateFormat();
    stmtPrep.setString(33, tmpdate); -- I tried with setObject as well but same error coming.
    Error is:
    ORA-01830: date format picture ends before converting entire input string
    Can u guide me how to get full date time with AM/PM?

    sasikrishna wrote:
    Dear All
    I have to insert/update a date column while creating a new item, but the problem is i am able to insert/update only date but i need both date and time along with AM/PM.
    By using these 3 lines i am able to insert/update only date.
    java.util.Date date = new java.util.Date();
    long dateLong = date.getTime();
    stmtPrep.setDate(33, new java.sql.Date(dateLong));That's by design. A java.sql.Date object matches an SQL DATE column (which doesn't include a time component). If you want something which matches an SQL TIMESTAMP colum (which includes both date and time components) then you should use a java.sql.Timestamp object.

Maybe you are looking for