How do I check if ociexecute("insert into.."); went ok or not?

Hi,
I'm using ociexecute() to run an Insert Into statement to put a new record into a given table.
I'd like to know how can I test if the insert into was successfully done, or something went wrong, like constraints violation, table not found... (I'm building a xmlrpc server api for the user to send me table_name, table_fields and table_values).
An example would be appreciated.
Thanks in advance.
Fernando Libio.

Execute the SQL statement using the oci_execute() method.
$r = oci_execute($stmt);
If an error occurs, retrieve the error using the oci_error() function and output an error message.
if (!$r) {
$e = oci_error($stmt);
echo htmlentities($e['message']);
}

Similar Messages

  • How could I check whether Oracle Enterprise Manager is installed or not ?

    Customer uses Oracle DB 11g.
    How could I check whether Oracle Enterprise Manager is installed or not ?

    If you are using EM DB Control then you run this command,
    $ORACLE_HOME/bin/emctl status dbconsole
    HTH
    Mani

  • How to a composition from project insert into the current composition?

    How to a composition(specific name) from current project insert into the current composition?

    Good point about checking the name of the current comp, but then you don't need to enter the loop if the name ofthe object you find is the name of the current comp:
    function insertComp(name)
         var proj = app.project;
         var comp = proj.activeItem;
         if ( comp != null && comp instanceof CompItem)
              var foundIt = null;
              var curItem;
              if(comp.name != name)
                   for(var a=1; a<=proj.numItems && foundIt == null; a++)
                        curItem = proj.item(a);
                        if(curItem instanceof CompItem && curItem.name == name)
                               foundIt = curItem;
                   if (foundIt != null)
                        app.beginUndoGroup("Insert Comp");
                        try
                             comp.layers.add(foundIt);
                             alert("All done!");
                        catch (err)
                             alert(err);
                        app.endUndoGroup();
                   else
                        alert("Not found");
              else
                   alert("Can't add item to itself.");
         else
              alert("Open a comp first.");

  • How to write the code to insert into attendance table

    Hi,
    I have a report
    class lov (through which all the classes will be selected).
    once any class seleted from the list it will display all the students in the class
    my query in the report was
    SELECT FIRST_NAME || ' ' || SURNAME "Pupil_Name",
    er.pupil_number,
    APEX_ITEM.CHECKBOX(1,er.pupil_number) "tickthebox"
    FROM PEAS_PUPIL pu, PEAS_ENROLMENT_REGISTER er
    WHERE pu.pupil_number = er.pupil_number
    AND er.class_id = :P53_CLASS
    pupil number column hidden becuase its a pk.
    as pupil_name and checkbox (called tickthebox)
    now I HAVE written on submit process to insert records into attendance table see below
    for i in 1..apex_application.g_f01.count loop --- check is the selector checbox, pupil_number is the hidden column with the table's PK
    INSERT INTO PEAS_ATTENDANCE (ATTENDANCE_ID,PUPIL_NUMBER) VALUES
    attendance_seq.NEXTVAL,
    APEX_APPLICATION.G_F01(i)
    end loop;
    but this is only inserting checked records ...not inserting unchecked records.
    is there anyway i can insert both checked and unchecked records into tABLE.
    THANKS
    PRASAD

    What I mean is that if you want to use checkbox item you must compare its value to current row ID.
    You have two items containing pupil_number:
    - APEX_ITEM.CHECKBOX(1,er.pupil_number)
    - APEX_ITEM.HIDDEN(2,er.pupil_number)
    When you call first one like "FOR i in 1 .. apex_application.g_f01.COUNT", you will get only pupil_numbers of checked checkboxes.
    When you call second one like "FOR i in 1 .. apex_application.g_f02.COUNT", you will get pupil_numbers of all rows.
    You get "no data error" because you reffer in your process to variable apex_application.g_f01(i) for row i, that is not checked.
    That's why you should check in your process if current row is checked every time when you want to reffer to this checkbox. You can do it using this code:
    FOR i in 1 .. apex_application.g_f02.COUNT
    LOOP
    FOR j in 1 .. apex_application.g_f01.COUNT
    LOOP
    IF apex_application.g_f01(j) = apex_application.g_f02(i) THEN
          /Your process for checked records/
    END IF;
    END LOOP;
          /Your process for unchecked records/
    END LOOP;And I think you should modify your report query for:
    SELECT FIRST_NAME || ' ' || SURNAME "Pupil_Name",
    APEX_ITEM.HIDDEN(2,er.pupil_number)||APEX_ITEM.CHECKBOX(1,er.pupil_number) "tickthebox"
    FROM PEAS_PUPIL pu, PEAS_ENROLMENT_REGISTER er
    WHERE pu.pupil_number = er.pupil_number
    AND er.class_id = :P55_CLASSYou can find some interesting information about using checkbox in APEX help.
    Regards,
    Przemek

  • How to read ecel sheet and insert into oracle table

    hi all,
    am working on forms builder 6i. and i want , from a trigger to read from a a sheet excel file the data and insert into a table that i had aleady created.
    i whrite a code that can till now open the excel file but i cant read the data to insert it into the table.
    am using TEXT_IO.IS_OPEN to open the file
    TEXT_IO.GET_LINE to take each line
    and subst(x as variable) to read the first line , but the subsrt return nohing
    any solution??

    There's already a topic made on this: how to copy data from excel to oracle forms

  • How to pass the chinese input insert into DB

    hi guys,
    i am the new one in developing the multilingual software.
    let me explain :
    the tools used are :
    Jboss 4.0.4 , MySQL, Eclipse.
    user key in the chinese or other languages[like greek] in the jsp page. then will uses <form .......... method="post" action="create_user_confirm.jsp"> to redirect the page to create_user_confirm.jsp . In this page request.getParameter is used to get those input and send them to java code to insert into DB.
    my difficulty now is from input jsp page to create_user_confirm.jsp page, i couldnt send the chinese word (greek or spanish) to the 2nd page by using request.getParameter("").it shows me the funny symbols below are some of code of my jsp pages.
    nput.jsp
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    <%@ page import="java.util.Locale"%>
    <%@ page import="org.apache.commons.codec.binary.Base64"%>
    <%
         Locale.setDefault(Locale.SIMPLIFIED_CHINESE);
         try {
              %>
              <jsp:include page="/top.jsp" />
              <p class="headline"><%=mpmservice.getLang(user.getLang(), "create_user_title")%></p>
              <form name="operatordetails" id="operatordetails" method="post" action="create_user_confirm.jsp">
                   <input type=hidden name=s value="<%=request.getParameter("s")%>">
                   <table class="infotable" id="report">
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_name")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="name" type="text" id="name" size="35" value="<%=name%>" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_description")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="description" type="text" id="description" size="35" value="<%=description%>" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_phone_number")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="phonenumber" type="text" id="phonenumber" size="35" value="<%=phonenumber %>" /></td>
                        </tr>     
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_password")%></td>
                             <td class="middle" colspan="2"><input class="middle"name="password1" type="password" id="password1" size="35" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_passwordrepeat")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="password2" type="password" id="password2" size="35" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_privilege")%></td>
                             <td class="middle" colspan="2"><select class="middle" name="privilege" id="privilege">
                        <tr>
                             <td class="left"> </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Create" type="submit" id="Create" value="<%=mpmservice.getLang(user.getLang(), "create_user")%>" />
                             </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Cancel" type="button" id="Cancel" value="<%=mpmservice.getLang(user.getLang(), "cancel")%>" onClick="location='create_user.jsp?s=<%=request.getParameter("s")%>&msg=&name=&description=&phonenumber='" />
                             </td>
                             <td class="right"> </td>
                        </tr>
                   </table>
              </form>
              <jsp:include page="/bottom.jsp" />
         <% } %>
    create_user_confirm.jsp
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    <%@ page import="javax.naming.Context"%>
    <%@ page import="javax.naming.InitialContext"%>
    <%@ page import="java.util.Locale"%>
    <%@ page import="org.apache.commons.codec.binary.Base64"%>
    <%
         Locale.setDefault(Locale.SIMPLIFIED_CHINESE);
         try {
         if (ok) {
             String name = request.getParameter("name");
             String description = request.getParameter("description");
             String phonenumber = request.getParameter("phonenumber");
             String password1 = request.getParameter("password1");
             String password2 = request.getParameter("password2");
             String[] privilege = request.getParameterValues("privilege");
             if (name == null)
                  name = "";
             if (description == null)
                  description = "";
             if (phonenumber == null)
                  phonenumber = "";
             if (password1 == null)
                  password1 = "";
             if (password2 == null)
                  password2 = "";
              LSUser user1 = null;
              %>          
              <jsp:include page="/top.jsp" />
              <p class="headline"><%=mpmservice.getLang(user.getLang(), "create_user_title")%></p>
              <form name="operatordetails" id="operatordetails" method="post" action="create_user_do.jsp">
                   <input type=hidden name=s value="<%=request.getParameter("s")%>">
                   <input type=hidden name=name value="<%=name%>">
                   <input type=hidden name=description value="<%=description%>">
                   <input type=hidden name=password1 value="<%=password1%>">
                   <input type=hidden name=phonenumber value="<%=phonenumber%>">
                   <input type=hidden name=msg value="<%=message%>">
                   <table class="infotable" id="report">
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_name")%></td>
                             <td class="middle" colspan="2"><%=name%></td>
                             <td class="right"> </td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_description")%></td>
                             <td class="middle" colspan="2"><%=description%></td>
                             <td class="right"> </td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>
                        <% if(!phonenumber.equals("")) { %>
                             <tr>
                                  <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_phone_number")%></td>
                                  <td class="middle" colspan="2"><%=request.getParameter("phonenumber")%></td>
                                  <td class="right"> </td>
                             </tr>
                             <tr>
                                  <td colspan="4" style="height: 23px">
                                       <p style="border-bottom: gray 1px solid;"> </p>
                                  </td>
                             </tr>
                        <% } %>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>
                        <tr>
                             <td class="left"> </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Create" type="submit" id="Create" value="<%=mpmservice.getLang(user.getLang(), "create_user")%>" />
                             </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Cancel" type="button" id="Cancel" value="<%=mpmservice.getLang(user.getLang(), "cancel")%>" onClick="location='create_user.jsp?s=<%=request.getParameter("s")%>&msg=<%=message%>&name=<%=name%>&description=<%=description%>&phonenumber=<%=request.getParameter("phonenumber")%><%=privStr%>'" />
                             </td>
                             <td class="right"> </td>
                        </tr>
                   </table>
              </form>
              <jsp:include page="/bottom.jsp" />
         <% } %>
         i really appreciate whoever reply this post. thanks a lot.

    hi skalster,
    thanks for your reply. currently i use Jboss to make the connection and the configuration to mySQL. the code as such :
    <datasources>
      <local-tx-datasource>
        <jndi-name>RTA_DS</jndi-name>
        <connection-url>jdbc:mysql://localhost:3306/jbossdb</connection-url>
        <driver-class>com.mysql.jdbc.Driver</driver-class>
        <user-name>root</user-name>
        <password></password>   
        <min-pool-size>5</min-pool-size>
        <max-pool-size>20</max-pool-size>   
          <metadata>
             <type-mapping>mySQL</type-mapping>
          </metadata>
        </local-tx-datasource>
    </datasources>so whatever there is a insertion or retrieval, the system will call entity bean and there is no DB configuration on my code side. all done by Jboss. but now i am more concern on chinese word or other languages which are able to pass the chinese parameter within jsp pages. now i am facing the problem which user key in the chinese or other language's input,it is fail to pass to another jsp (create_user_confirm.jsp) to do the validation. it appears as those funny character from input.jsp to create_user_confirm.jsp by using request.getparameter(). any idea to solve this matter?the source code of the 2 jsp files are at the previous message. i really thanks for your reply.
    have a nice day

  • How do I convert an XML insert into ordinary text?

    I have a fm9 file, about half of it is in elements that can be directly edited through the structured view, but the other half seems to be ax xml insert which is awkward to edit. Is there any way to import this xml insert into the document so it consists of  'ordinary' elements alongside the elements already in there, and is also manageable in the same way as the elements already in the structured view. Thanks.

    A little background....
    If you have a structured fm file, you can insert by reference (a text inset) another file that contains structure. I am assuming that the inserted file uses the same set of elements (same element catalog) as the containing file, or the result would not be valid. Now click on the text inset to select it, and select Edit > Text Inset Properties. In the dialog, click Convert. This converts the text inset into editable ELEMENTS, not text; it is the same as if you had imported the inserted file by copy. You can now edit those inserted elements as part of the containing file; in fact, they ARE part of the file, no longer connected to the original inserted file.
    I have never used text inset XML. But I am guessing that the elements in the XML file are compatible (i.e., the same set) with the elements in the containing file; otherwise, the resulting file would not be valid. So, I am guessing that all you need to do is the same as with a standard structured text inset, that is, follow the same instructions as above.
    If this is not what you are trying to do, please clarify.
    Van

  • Select Insert into staging table does not load varchar2

    I have a select insert query that loads a prebuilt table. I am running this query through Heterogenous services which points to a MySql database.
    If I run just a select query in SQL PLUS then it returns all rows just fine.
    However, when I put the select insert into a stored procedure, compile it, then run it. It does not load any VARCHAR2 datatypes but it does load DATE and NUMBER datatypes.
    I also have another table with VARCHAR2 and it loads fine.
    How can the database only load some of the items in a row and not others (VARCHAR2)
    For instance, the query will load TRANSACTION_ID, ORER_NUMBER but will not load any data into BILLFIRST_NAME, and their is data to load.
    CREATE TABLE "TRAN_STG"
    (     "TRANSACTION_ID" NUMBER(11,0),
         "ORDER_NUMBER" NUMBER(20,0),
         "BILL_FIRST_NAME" VARCHAR2(100 BYTE),
    Any suggestions would be appreciated.

    can it be that there are differences in characterset? Can it be that there are differences in datatypes? Can it be that there are differences in field length?

  • HT4972 how i can check that my phone is factory unlock or not

    how i can check that my phone is factory unlock or not

    Look at the other thread you started.  Running two active threads is confusing, not only to you but to those who are trying to help.

  • How to fix The SIM card inserted in this iPhone does not appear to be supported. The SIM card that you currently have installed in this iPhone is from a carrier that is not supported under the activation policy that is currently assigned by the activation

    The SIM card inserted in this iPhone does not appear to be supported.
    The SIM card that you currently have installed in this iPhone is from a carrier that is not supported under the activation policy that is currently assigned by the activation server. This is not a hardware issue with the iPhone. Please insert another SIM card from a supported carrier or request that this iPhone be unlocked by your carrier. Please contact Apple for more information.

    Or if you've recently got the phone unlocked then you'll need to connect it to  itunes and then do a fresh restore to unlock it ,although for most users simply connecting to itunes for few seconds did the trick.

  • How can I check if my insert of BLOB is successful

    Hi, there,
    after I insert the BLOB data into oracle 9i database table, how can I know if it's successful or not through OEM. because if I view the table content through OEM, I only can see the other fields except BLOB. do I must write a java program to retrieve it or there is some other easy way?
    thank you very much for the great help.

    Open Activity Monitor which is in your Applications > Utilities folder.  Click on the "System Memory" tab toward the bottom left.

  • How to Query from table and insert into another table.

    Hi
    I am using the following query in VO and all the columns are attached to EO ( table name emp_temp)
    select a.npw_number, a.person_id,b.assignment_id,a.title,a.last_name,a.first_name,a.date_of_birth,a.sex,
    b.organization_name,b.organization_id,b.job_id,b.job_name,b.position_id,b.position_name,b.supervisor_id,
    b.supervisor_name,b.location_id,b.effective_start_date,b.effective_end_date
    from per_all_people_f a,per_assignments_v b
    where a.person_id=b.person_id
    and a.npw_number=:1
    I can query the data in screen. I need into insert the data into the emp_temp.
    I don't know how to do this . Please help me.
    Thanks
    Subra

    You can create a VO based on EO on emp_temp table.....
    And u have attached a Different VO on the page... Right...
    Now what u can do is....once u click on apply....
    u can set the each attributes of EO based VO explicitly via code, from the values of second VO.... and then commit.....
    Perhaps this might help...

  • How to insert into dln3 automaticaly (delivery notes - expenses)

    Hellow experts!!!
    I have a problem, i'm progamming an add-on that i want to insert automaticly a row into dln3. I have declare a SAPbobscom.Documents and after like a SAPbobsCOM.BoObjectTypes.oDeliveryNotes and i access to dln3 like this:
       If oDln3.GetByKey(oRST.Fields.Item("DocEntry").Value) Then
          oDln3.Expenses.SetCurrentLine(0)
          oDln3.Expenses.BaseDocEntry = oRST.Fields.Item("DocEntry").Value
          oDln3.Expenses.ExpenseCode = "8"
          oDln3.Expenses.LineTotal = (oMinKGB - oKGB) * oDiferencia
          oKGB = oDln3.Expenses.add
          If oKGB <> 0 Then
             oApplication.MessageBox("ERROR")
          End If
       End If
    I don't have an error, but the add-on don't insert any row into dln3 and i don't know where is inserting the fields...
    I hope someone can help me!!!
    THANK'S!!!!!!

    Very helpfull answer, THANK'S A LOT!!!

  • Data not getting inserted into oracle with theAutoCommitEnabled not checked

    Hello Experts
    I have a proxy to JDBC scenario.I have 3 SQL statements and the Format is
    <DeleteStatement>
    <InsertStatement>
    <CallStoredProcStatement>.
    While excecuting with the AutoCommitEnabled box checked, the insert statement is excecuting and the data is getting updated in the oracle database..But the CallStoredProcStatement is not excecuting.
    If the AutoCommitEnabled box not checked,the data is not getting updated in the database .but in RWB log all the SQL statements are getting executed successfully.
    Are there any other configurations still to be made in the JDBC adapter.

    Hi,
    Why you not using single SP to handle all the queries?
    BTW, have you used the parameter "logSQLStatement = true" in JDBC receiver channel? It will show in audit log what query is being executed.
    Regards,
    Neetesh

  • How can I place a photo (*.jpg) into an email directly, not as an attachment?

    I want to sent a photo by placing it directly into the "text" box of an email, rather than attaching it to the email. Can I do that? How?

    Firefox does not do email, that would be another application and you didn't mention what that email application is.

Maybe you are looking for

  • Crystal Report 2008 SP3 and BO XI 3.1 conflict

    Hi every body, We have a BOE system: BO XI 3.1 Oracle db 10g All running successful and can create some types of WebI report. But we also want reports with Crystal Report. 1> So we install Crystal Report 2008 SP3 (without knowing the conflict error b

  • How to give BSP Iview look and feel of portal??

    Hi All, I've created a BSP application that I use to create an Iview for portal. I thought that if i used htmlb tags that the look and feel of portal would be automatic to my app but its not. I've tried assigning portal css classes to a html table bu

  • No stock posting for this material

    I have create a material  with item category LEIH for returnable packaging,while doing stock posting in MB1C error comes as "No Cmaterial posting for this material".plz help how to post the  material.

  • Socket connections / smtp

    I have a form that sends mail (smtp) through a socket connection (actionscript), which I picked up here, http://www.bytearray.org/?p=27 Tested and works fine locally, but when posted online and tested, it quietly fails. I am trying to send mail from

  • Cannot connect to wireless on Satellite L300D-13S

    Bought this new laptop Satellite L300D-13S The wireless doesn't seem to work, the switch and light are on and the divice manger shows theres nothing wrong with the driver my hub seems to be working fine with my older laptop etc so i think my hubs ok.