Unable to insert into mysql from flash burrito

I'm having issues inserting a record to mysql, if I use the test "test operation and use these values the it works fine, but now in the android app.
values in my test operation
    id:0,
    type:"cool",
    navn:"vegar 16"
the getall method works fine, and shows up on the network monitor, but the button dont work at all, nothing happends in the network monito, if I debug it I can see that the button works, any suggestions on what Im doing wrong?
code in my view:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:kunderservice="services.kunderservice.*"
        title="Home">
    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;
            import valueObjects.Kunder;
            protected function list_creationCompleteHandler(event:FlexEvent):void
                getAllKunderResult.token = kunderService.getAllKunder();
            protected function button_clickHandler(event:MouseEvent):void
                var item:Kunder = new Kunder();
                item.id=0
                item.navn="vegar"
                item.type ="test"
                createKunderResult2.token = kunderService.createKunder(item);
        ]]>
    </fx:Script>
    <fx:Declarations>
        <s:CallResponder id="getAllKunderResult"/>
        <kunderservice:KunderService id="kunderService"/>
        <s:CallResponder id="createKunderResult2"/>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:List id="list" x="35" y="45" width="409" height="193"
            creationComplete="list_creationCompleteHandler(event)" labelField="navn">
        <s:AsyncListView list="{getAllKunderResult.lastResult}"/>
    </s:List>
    <s:Button id="button" x="20" y="406" label="Button" click="button_clickHandler(event)"/>
    </s:View>

I really appreciate your help. Yes indeed, debugging and seeing what is going on in general is most difficult with flash!
Once I get this cracked I should be able to complete a lot of what I am trying to achieve.
After inserting some echo's into my php as such:
<?php
$player = $_POST['player'];
$tournament = $_POST['tournament'];
$position = $_POST['position'];
$prize = $_POST['prize'];
mysql_connect("localhost", "root","poker");
echo "onnected to database"
mysql_select_db("poker");
echo "database connected";
mysql_query("INSERT INTO results(player,tournament,position,prize) VALUES
('$player','$tournamnet','$position','$prize')");
echo "result added";
?>
The returned info is a load of nonsense to me:
response from server:  %3C%3Fphp%0A%24player%20=%20%24%5FPOST%5B%27player%27%5D%3B%0A%24tournament%20%3D%20%24%5 FPOST%5B%27tournament%27%5D%3B%0A%24position%20%3D%20%24%5FPOST%5B%27position%27%5D%3B%0A% 24prize%20%3D%20%24%5FPOST%5B%27prize%27%5D%3B%0A%0Amysql%5Fconnect%28%22localhost%22%2C%2 0%22root%22%2C%22poker%22%29%3B%0Aecho%20%22onnected%20to%20database%22%0Amysql%5Fselect%5 Fdb%28%22poker%22%29%3B%0Aecho%20%22database%20connected%22%3B%0Amysql%5Fquery%28%22INSERT %20INTO%20results%28player%2Ctournament%2Cposition%2Cprize%29%20VALUES%20%0A%28%27%24playe r%27%2C%27%24tournamnet%27%2C%27%24position%27%2C%27%24prize%27%29%22%29%3B%0Aecho%20%22re sult%20added%22%3B%0A%3F%3E

Similar Messages

  • How to insert into mysql the creation time and modification time from java?

    first how?
    Second what is better from create the date from java or do it from mysql?
    thanks in advace
    Pedro

    One way is to use the GetDate function in mysql. This will set the date as you insert data. insert into table(date) values(getdate())
    Anytime you modifiy the table just call the function again and update its fields.
    Dont know which is beter to do. In java or on the database side.

  • How to insert a parameter into MySql from JSP using bean

    Hai.........
    The files i hav used are: DbConnection.java, LogBean.java, login.jsp, checkUser.jsp, existingUser.jsp, newUser.jsp...................
    I hav problem in newUser.jsp................................................
    ie: plz giv an appropriate code for this code:.........................................
    resultSet = connectionBean.execUpdate("insert into userLogin values('"+uName+"','"+pWord+"') ");
    Message was edited by:
    jaseemkhan

    Here is the code fragment.
    File file = new File ("c:\\t.gif");
    FileInputStream in = new FileInputStream (file);
    int len = (int)file.length();
    PreparedStatement pst = null;
    pst = conn.prepareStatement ("insert into blob_table values (1, ?)");
    pst.setBinaryStream (1, in, len);
    pst.executeUpdate();
    pst.close();
    conn.commit();

  • JSP cannot Insert into MYSQL

    hi, i have a jsp code which can successfully return results from MySQL database. But once i change the SQL statement from a select statement to a insert statement, it does not add in a new row in the database. It has no error while compiling but it also appear nothing on the screen when being run. Has the problem got to do with the user privilages of MySQL? thanks.
    //jsp file which parameter posted from another html file. Parameter has been successfully passed.
    <%@ page import="java.sql.*"%>
    <body>
    <%
         String file = request.getParameter("file");
         String pic = request.getParameter("pic");
         ResultSet rs = null;
         ResultSet rs2 = null;
         String timestamp = "CURRENT_TIMESTAMP()";
         String q2 = "Select * from fileReqAce";
         String q1 = "INSERT INTO fileReqAce(PIC,FileName,DateReq) VALUES('"+pic+"','"+file+"',CURRENT_Timestamp())";
    try{
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/wendy?user=user;password=password");
    Statement state = con.createStatement();
         %><br><%
         rs = state.executeQuery(q1);
         //Statement state2 = con.createStatement();
         /**rs2 = state2.executeQuery(q2);
         %><br>
         <table border="1"><%
         while(rs2.next()){
         %>
         <tr>
         <td>Request by : <%=rs2.getString("PIC")%></td><td>File Reference : <%=rs2.getString("FileName")%></td><td>Time Requested : <%=rs2.getTimestamp("DateReq")%></td>
         </tr>
         <%
         %></table>
    <%**/
         rs.close();
    //     rs2.close();
         con.close();
         catch(Exception e)
         System.err.println("Unable to load driver");
         e.printStackTrace();
    %>
    </body>

    That all might be good and well but I think the very important thing to note here is what the first reply stated.
    If you are going to run an Insert sql statement you need to use the executeUpdate() method. You also use this function for Updates and Delete SQL statements.
    Only Select statements that return a recordset use the executeQuery() method. The executeUpdate() method returns an interger that reflects the number of rows affected by the SQL statement.
    Like when you insert 1 row the return value of the executeUpdate method will be one. You can accordingly check this returned value to see if the operation ran successfully. A return value of 0 means that now rows where inserted.
    That is my 2c worth. I hope it helped some.

  • Noob help to format date to insert into mysql

    Sorry, if this question has been asked before, I did di a search but could not find an answer that I could understand.  I am pretty new to DW and my coding skills are not good so please go easy on me.
    I have a simple form to insert records to a mysql database.  I have created a form validarion behaviour to require the fields that are set as not-NULL in the database.  How do I modify the code to allow the date format to be entered in the dob field in the form as DD/MM/YYYY but inserted correctly in the database as YYYY/MM/DD?
    Finally, how would I then modify it further to default to todays date?
    Here's my code:
    <?php require_once('Connections/mypms.php'); ?>
    <?php
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO demographics (title, firstname, surname, dob, address1, address2, town, county, postcode) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['title'], "text"),
                           GetSQLValueString($_POST['firstname'], "text"),
                           GetSQLValueString($_POST['surname'], "text"),
                           GetSQLValueString($_POST['dob'], "date"),
                           GetSQLValueString($_POST['address1'], "text"),
                           GetSQLValueString($_POST['address2'], "text"),
                           GetSQLValueString($_POST['town'], "text"),
                           GetSQLValueString($_POST['county'], "text"),
                           GetSQLValueString($_POST['postcode'], "text"));
      mysql_select_db($database_mypms, $mypms);
      $Result1 = mysql_query($insertSQL, $mypms) or die(mysql_error());
    $recordID = mysql_insert_id();
      $insertGoTo = "detail_tab.php?recordID=$recordID";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
      exit();
    $colname_insert = "1";
    if (isset($_GET['recordID'])) {
      $colname_insert = (get_magic_quotes_gpc()) ? $_GET['recordID'] : addslashes($_GET['recordID']);
    mysql_select_db($database_mypms, $mypms);
    $query_insert = sprintf("SELECT px_id, title, firstname, surname, dob, address1, address2, town, county, postcode FROM demographics WHERE px_id = %s", $colname_insert);
    $insert = mysql_query($query_insert, $mypms) or die(mysql_error());
    $row_insert = mysql_fetch_assoc($insert);
    $totalRows_insert = mysql_num_rows($insert);
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>address</title>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_validateForm() { //v4.0
      var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
      for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
        if (val) { nm=val.name; if ((val=val.value)!="") {
          if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
            if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
          } else if (test!='R') { num = parseFloat(val);
            if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
            if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
              min=test.substring(8,p); max=test.substring(p+1);
              if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
        } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
      } if (errors) alert('The following error(s) occurred:\n'+errors);
      document.MM_returnValue = (errors == '');
    //-->
    </script>
    </head>
    <body>
    <p> </p>
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" onSubmit="MM_validateForm('firstname','','R','surname','','R','dob','','R');return document.MM_returnValue">
      <table align="center">
        <tr valign="baseline">
          <td nowrap align="right">Title:</td>
          <td><input type="text" name="title" value="" size="32"></td>
          <td> </td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">Firstname:</td>
          <td><input type="text" name="firstname" value="" size="32"></td>
          <td> </td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">Surname:</td>
          <td><input type="text" name="surname" value="" size="32"></td>
          <td> </td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">Dob:</td>
          <td><input type="text" name="dob" value="" size="32"></td>
          <td> </td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">Address1:</td>
          <td><input type="text" name="address1" value="" size="32"></td>
          <td> </td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">Address2:</td>
          <td><input type="text" name="address2" value="" size="32"></td>
          <td> </td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">Town:</td>
          <td><input type="text" name="town" value="" size="32"></td>
          <td> </td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">County:</td>
          <td><input type="text" name="county" value="" size="32"></td>
          <td> </td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">Postcode:</td>
          <td><input type="text" name="postcode" value="" size="32"></td>
          <td><input name="Search" type="button" id="Search" value="Search"></td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right"> </td>
          <td><input type="submit" value="Insert record"></td>
          <td> </td>
        </tr>
      </table>
      <input type="hidden" name="MM_insert" value="form1">
    </form>
    <p> </p>
    </body>
    </html>
    <?php
    mysql_free_result($insert);
    ?>
    Thank you for your help :-)

    barrydocks wrote:
    thanks for the reply osgood;
    I was hoping for a more simple solution than a JQuery date picker, I have read this threat where the SQL queries is aletered:
    http://forums.adobe.com/thread/450108
    Which I tried but could not make work.
    I haven't tried DATE_FORMAT but the example implies that it would work when SELECTING the date from the database to output to a page in a more conventional FORMAT. However you want to INSERT the date using the correct format.
    barrydocks wrote:
    http://forums.adobe.com/thread/1097555
    but I don't know how to use this in my code that already has form validation?
    That thread is implying that you would need to convert the date inserted into the form field before it is inserted into the database in the correct format.......so you may as well use a datepicker.
    Problem with letting anyone insert a date manually is that a date can be written in many formats which are NOT acceptable by the database. A datepicker overcomes all of these issues. Getting the date back out of the database is a case of simply converting via php into a format which is applicable to your country or your usage OR using the method in the first thread you provided.
    Lets see if anyone else can offer a more simple solution for you.

  • Unable to insert into table Showing error FRM-40508

    I want to insert data in text items of form into a table by using procedure in program unit. i declared all the parameters and calling this procedure in When-button-pressed trigger of push-button.it is not showing any compilation error, but run time error FRm-40508 ORACLE Error: Unable to insert the record.

    The Table Structure:-
    PROB_ID VARCHAR2(50)
    PERSON_NAME NOT NULL VARCHAR2(50)
    MODULE NOT NULL VARCHAR2(100)
    START_DATE DATE
    VERSION NOT NULL VARCHAR2(50)
    ASSIGNED_BY VARCHAR2(100)
    FUNCTIONALITY VARCHAR2(4000)
    ERR_TYPE VARCHAR2(150)
    ERR_COMPONENT VARCHAR2(100)
    ERR_LOCATION VARCHAR2(250)
    PROB_DESC VARCHAR2(4000)
    PROB_SOLTN VARCHAR2(4000)
    STATUS VARCHAR2(100)
    END_DATE DATE
    and the code is in When-button-pressed
    Declare
         v_pname char(5);
         v_mod char(6);
    v_datetime VARCHAR2(9);
    v_pid varchar2(50);
    v_version varchar2(50);
    v_assign varchar2(50);
    v_func varchar2(50);
    v_etype varchar2(50);
    v_ecomp varchar2(50);
    v_eloc varchar2(50);
    v_pdesc varchar2(50);
    v_psoltn varchar2(50);
    v_status varchar2(50);
    v_edatetime varchar2(50);
    uname varchar2(50) := 'fcclog';
    pwd varchar2(50) := 'fcclog';
    con varchar2(50) := 'orcl';
    cursor c1 is select prob_id from log_table;
    BEGIN
         -- Creating the unique Problem ID by adding all the item value
         v_pname := :log_table.pname_lst;
         v_mod := :mod_table.mod_name;
         v_datetime:= to_char(:log_table.start_date);
         --:log_table.prob_id := v_pname||v_mod||v_datetime ;
         v_pid := v_pname||v_mod||v_datetime ;
         for r in c1 loop
         if v_pid = r.prob_id then
              v_pid := v_pid + 1;
         end if ;
         end loop;
         :log_table.prob_id := v_pname||v_mod||v_datetime ;
         v_pid := :log_table.prob_id;
         -- Inserting into database--
         v_version := :log_table.version;
         v_assign := :log_table.assigned_lst;
         v_func := :log_table.funct_txt;
         v_etype := :log_table.err_type;
         v_ecomp := :log_table.err_component;
         v_eloc := :log_table.err_location;
         v_pdesc := :log_table.prob_desc;
         v_psoltn := :log_table.prob_soltn;
         v_status := :log_table.status;
         v_edatetime := :log_table.end_date;
         log_insert(v_pid,v_pname,v_mod,v_datetime,v_version,v_assign,v_func,v_etype,v_ecomp,v_eloc,v_pdesc,v_psoltn,v_status,v_edatetime);
         commit;
         exception
              when others
              then
              DBMS_OUTPUT.PUT_LINE(SQLERRM);
              rollback;
         end;
    And the Code in Procedure (log_insert) of Program Unit.
    PROCEDURE log_insert(
    p_pname varchar2,
         p_mod varchar2,
    p_datetime VARCHAR2,
    p_pid varchar2,
    p_version varchar2,
    p_assign varchar2,
    p_func varchar2,
    p_etype varchar2,
    p_ecomp varchar2,
    p_eloc varchar2,
    p_pdesc varchar2,
    p_psoltn varchar2,
    p_status varchar2,
    p_edatetime varchar2)
    IS
    BEGIN
    insert into fcclog.log_table(PROB_ID,PERSON_NAME,MODULE,START_DATE,VERSION,ASSIGNED_BY,FUNCTIONALITY,ERR_TYPE,ERR_COMPONENT,ERR_LOCATION,PROB_DESC,PROB_SOLTN,STATUS,END_DATE)
    values(p_pid,p_pname,p_mod ,p_datetime,p_version,p_assign,p_func,p_etype,p_ecomp,p_eloc,p_pdesc,p_psoltn,p_status,p_edatetime);
    END;

  • Help on Chinese insert into mysql (urgent)

    Dear Friends,
    we are running an coldfusion mx application on window,
    perfect, the database is mysql, utf-8 encoding.
    But when we moved to redhat linux +mysql, the chinese in the
    database displayed as ?????. when we insert into database, the
    chinese inserted like ????? as well...
    Any thing that we missed to config...please help.
    thanks,

    [This page|http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/] has a good explanation of where the issues might be.
    The thing with character encodings is that you have to get it right at every step. If you miss one of them, then the whole thing blows apart.
    From the minimal info you have here, I would take a look at the request.setCharacterEncoding() methd.
    cheers,
    evnafets

  • How to insert into table from a xml with XDE for java?

    want to insert into the oracle tables from the xml with XDE for java, some sample better. thank you.

    XML Document may be stored in a SQL database with XML SQL Utility.
    http://download-west.oracle.com/docs/cd/B13789_01/appdev.101/b10794/adx08xsu.htm#i1008168
    XML Document may be stored in a SQL database with Oracle XML DB.
    http://download-west.oracle.com/docs/cd/B13789_01/appdev.101/b10790/xdb03usg.htm#CEGFECFH

  • Unable to insert into oracle db using times ten

    I have a times ten 6.0 installation on my m/c connected to an oracle 10.2.0.2 database. The database is a remote database. My application is deployed to oracle application server (10.1.3.1 SOA). I am getting the following SQLException when I try to insert.the first row.
    java.sql.SQLException: [TimesTen][TimesTen 6.0.4 ODBC Driver][TimesTen]TT5105: OCI initialization failed. -- file "bdbEnv.c", lineno 275, procedure "ttBDbEnvAlloc"
    My env is as follows
    OS = Windows 2000
    DataSource = User DSN
    First Connection
    Permanent Data Store = 100
    Temporary Data Store = 50
    Connections = 20
    Synchronous write through cache
    I tried a select on the table before insert and it worked. Using ttisql I can insert into this table without any problem. Using a standalone java program I am able to insert data into this table. But from within an appserver I am facing this issue.
    Thanks in advance for any help.
    Regards,
    Mahesh.

    Jimmyb,
    Are you logged in as the user that owns that table?
    Yes.
    If yes, then there are no triggers on this table.
    That is true.
    You will need to populate the ID column with your insert statement.
    Just did that.
    Usually, the sequence is very similar to the table name.
    Yes I tried few of them in my sql query and it said "sequence cannot be found"
    Isn't there some way that it will list the name of the sequence currently being used in a table?

  • Unable to insert into remote table

    I have created a dblink (public), and a synonym(synonym1) pointing to a table in the remote database.
    When I try to create a form based on the synonym the form creation fails with many errors saying "Synonym Trnslation no longer supported". I have tested the synonym via a dynamic page an it is valid and working.
    I then try to refer to the object directly by using owner.table@dblink. This works fine until I try and insert into the remote table. Then I get the error "An unexpected error occurred: ORA-22816: unsupported feature with RETURNING clause (WWV-16016) ". Has anyone solved this. I can only assume that portal can somehow insert data into a remote table via a form. What use is it if it cant???

    I am not clear on that Synonym ... but the following note solved the problem:
    Subject: How to create a form on a view (and avoid WWV-16016)
    Doc ID: Note:155654.1 Type: PROBLEM
    Last Revision Date: 19-MAR-2003 Status: PUBLISHED
    Problem Description
    Portal 3.0.9.X
    If you create an updateable view on two tables, with the needed
    associated "INSTEAD_OF" trigger to perform the insert or update.
    A Form on this view created in Portal returns the following error on
    insert or update:
    An unexpected error occurred: ORA-22816: unsupported feature with
    RETURNING clause (WWV-16016).
    Let's take a sample:
    CREATE OR REPLACE VIEW V_EMP_DEPT ( EMPNO,
    ENAME, JOB, DEPTNO, DNAME,
    LOC ) AS select
    e.empno
    ,e.ename
    ,e.job
    ,d.deptno
    ,d.dname
    ,d.loc
    from emp e, dept d
    where e.deptno = d.deptno
    grant select,insert,update,delete on v_emp_dept to public;
    create or replace TRIGGER VEMPDEPT_INSTEAD_OF_TRG
    INSTEAD OF UPDATE or INSERT
    ON v_emp_dept
    REFERENCING OLD AS OLD NEW AS NEW
    declare
    begin
    if updating then
    if :new.empno != :old.empno then
    raise_application_error(20001,'EMPNO could not be modified');
    end if;
    if :new.loc != :old.loc then
    raise_application_error(20001,'LOC could not be modified');
    end if;
    if :new.dname != :old.dname then
    raise_application_error(20001,'dname could not be modified');
    end if;
    if :new.ename != :old.ename then
    update emp set ename=:new.ename where empno = :old.empno;
    end if;
    if :new.job != :old.job then
    update emp set job=:new.job where empno = :old.empno;
    end if;
    if :new.deptno != :old.deptno then
    update emp set deptno=:new.deptno where empno = :old.empno;
    end if;
    end if;
    if inserting then
    -- specify only valid deptumbers
    insert into emp(empno,ename,job,deptno) values
    (:new.empno,:new.ename,:new.job,:new.deptno);
    end if;
    end;
    - Create a "Forms Based on a Table or View" on this view : 'V_EMP_DEPT'
    - In the step 4, choose 'order by dname' in place of 'rowid'
    The rest is default
    - Run the form
    - Push on the button query
    - change one of the field and push the update button
    You will see the error
    Error: An unexpected error occurred: ORA-22816: unsupported feature
    with RETURNING clause (WWV-16016)
    Explanation
    You are running in Bug 1589656. The code generated by Portal is using
    RETURN clause for the UPDATE or INSERT SQL call to get the ROWID.
    This is not possible on a VIEW created on two (or more) tables.
    Solution Description
    A possible workaround is to replace the insert button code and update button
    code with calls to procedures doing exactly what is done in the trigger.
    Assumption is made that the empno column could not be updated.
    This implies that the validation options updatable checkbox for the empno column
    is unchecked.
    In the above example, this gives:
    -- procedure to insert data as done in the trigger
    create or replace procedure V_EMP_DEPT_INSERT(
    p_session in out PORTAL30.wwa_api_module_session
    IS
    "_block" varchar2(30) := 'DEFAULT';
    rec SCOTT.V_EMP_DEPT%ROWTYPE;
    begin
    rec.EMPNO:=p_session.get_value_as_NUMBER(
    p_block_name => "_block",
    p_attribute_name => 'A_EMPNO',
    p_index => 1
    rec.ENAME:=p_session.get_value_as_VARCHAR2(
    p_block_name => "_block",
    p_attribute_name => 'A_ENAME',
    p_index => 1
    rec.JOB:=p_session.get_value_as_VARCHAR2(
    p_block_name => "_block",
    p_attribute_name => 'A_JOB',
    p_index => 1
    rec.DEPTNO:=p_session.get_value_as_NUMBER(
    p_block_name => "_block",
    p_attribute_name => 'A_DEPTNO',
    p_index => 1
    insert into scott.emp(empno,ename,job,deptno)
    values (rec.empno,rec.ename,upper(rec.job),rec.deptno);
    exception
    when others then
    rollback;
    raise;
    end;
    -- procedure that update data as done in the trigger
    create or replace procedure V_EMP_DEPT_UPDATE(
    p_session in out PORTAL30.wwa_api_module_session
    IS
    "_block" varchar2(30) := 'DEFAULT';
    old_rec SCOTT.V_EMP_DEPT%ROWTYPE;
    new_rec SCOTT.V_EMP_DEPT%ROWTYPE;
    begin
    new_rec.EMPNO:=p_session.get_value_as_NUMBER(
    p_block_name => "_block",
    p_attribute_name => 'A_EMPNO',
    p_index => 1
    new_rec.ENAME:=p_session.get_value_as_VARCHAR2(
    p_block_name => "_block",
    p_attribute_name => 'A_ENAME',
    p_index => 1
    new_rec.JOB:=p_session.get_value_as_VARCHAR2(
    p_block_name => "_block",
    p_attribute_name => 'A_JOB',
    p_index => 1
    new_rec.DEPTNO:=p_session.get_value_as_NUMBER(
    p_block_name => "_block",
    p_attribute_name => 'A_DEPTNO',
    p_index => 1
    new_rec.LOC:=p_session.get_value_as_NUMBER(
    p_block_name => "_block",
    p_attribute_name => 'A_LOC',
    p_index => 1
    select empno, ename, job, deptno, loc
    into old_rec.empno, old_rec.ename, old_rec.job,
    old_rec.deptno, old_rec.loc from scott.V_EMP_DEPT
    where empno = new_rec.empno;
    if new_rec.empno != old_rec.empno then
    raise_application_error(20001,'EMPNO could not be modified');
    end if;
    if new_rec.loc != old_rec.loc then
    raise_application_error(20001,'LOC could not be modified');
    end if;
    if new_rec.dname != old_rec.dname then
    raise_application_error(20001,'dname could not be modified');
    end if;
    if new_rec.ename != old_rec.ename then
    update scott.emp set ename=new_rec.ename where empno =
    old_rec.empno;
    end if;
    if new_rec.job != old_rec.job then
    update scott.emp set job=new_rec.job where empno = old_rec.empno;
    end if;
    exception
    when NO_DATA_FOUND then
    raise_application_error(20001,'EMPNO could not be modified');
    end;
    After creating this two procedures you have to edit the form and replace the
    Insert and Update button PLSQL event handling code.
    For the insert button: Select Insert in the PL/SQL Button Event Handler window
    and replace the original code with the following one::
    --- Type your PL/SQL code here...
    -- doInsert;--- This is the default handler
    --- ...and here, thanks...
    V_EMP_DEPT_INSERT( p_session => p_session);
    For the update button: Select Update in the PL/SQL Button Event Handler window
    and replace the original code with the following one:
    --- Type your PL/SQL code here...
    -- doUpdate;--- This is the default handler
    --- ...and here, thanks...
    V_EMP_DEPT_UPDATE( p_session => p_session );
    Remarks
    1) Don't forget to uncheck the updatable validation option for the empno column or
    you may see some errors raised by the update procedure or update the wrong record.
    2) If you don't want to write the "instead of trigger", you can simplify
    the code above by:
    - writing no instead of trigger at all
    - write the logic to the underlying tables in PL/SQL trigger of Portal
    ( here V_EMP_DEPT_UPDATE, V_EMP_DEPT_INSERT)
    - Manohar

  • Insert into MSSQL from Oracle

    Hello together,
    I'm a little bit frustrated. The follwoing is my problem:
    I want to insert some values from an Oracle 10gR2 database into a MSSQL database (SQL Server 2008 R2).
    Therefor I'm using DG4ODBC 11.2.0.3. The connection is working absolutly fine.
    I want to insert five values from five columns from oracle.table-a into a msssql table-b.
    But I'm hitting the error:
    Invalid character value for cast specification.
    Two columns from the oracle table are chars size 12 and 40, and three are number size 5.1, 5.1 and 4.
    The MSSQL column definitions are varchar40, varchar50, 2x float8 and int.
    The column assignments are:
    Oralce -> MSSQL
    a. char 12 -> varchar40
    b. char 40 -> varchar50
    c. number 5.1 -> float8
    d. number 5.1 -> float8
    e. number 4 -> int4
    The insert works greate for a,b and e but nor for c and d.
    I tried so many solutions (cast, to_binary_float, nls_character_format, nls_theritpory etc..) but nothing helps.
    I always hitting this error.
    Can anyone help me with this problem?
    cheers
    Joe

    Hi together,
    I fixed the problem. I multiply the origin number with 10. The result is a number without any comma. During the insert into MSSql I divide by 10.
    I now, this is a very strange solution but it works.
    Yes I know this helps only, because the column can only save number with one decimal place. For higher decimal places you have to multiple it with 100 or 1000 or......
    Hope this helps also other peoples.
    kind regards
    Joe

  • SSIS - Script Task creates a DTS var and using Foreach loop, Execute SQL needs to INSERT into table from this DTS var.

    I have a script task written in C# that creates an array of strings "arrayFields" after parsing a text file. It saves the array of strings in a DTS variable.
    Each row in array represents a row is comma separated and is a row that must be inserted into a table. For example,
    X and Z are fields in the table
    X1, X2,....Xn
    Z1,Z2,...Zn
    I am using a Foreach Loop  to grab each row and then  Execute SQL Task to take each row from the array and insert each field per row in a table,
    The SQL is something like,
    INSERT dbo.table values(field1, field2,...fieldn) arrayFields?
    What should this this INSERT look like?

    I guess you implemented
    Shredding a Recordset
    Based on what I understood (correct me if I am wrong) you have difficulties mapping the input parameters, if so here is the guide
    http://www.sqlis.com/sqlis/post/The-Execute-SQL-Task.aspx
    In short it might look like
    INSERT dbo.table  (ColumnA, ColumnB,...) VALUES (?,?...)
    The syntax for the T-SQL INSERT is http://technet.microsoft.com/en-us/library/dd776381%28v=sql.105%29.aspx
    Arthur
    MyBlog
    Twitter

  • Storing a Blob into MySql  from a JTextArea

    I'm using Java 1.4.1, MySql 4.0.12, and MyConnector/J 3.06
    I have an application with a JTextArea and I want to put the contents of the JTextArea into the database stored as a Blob Object. The only reason I'm using Blob is because varchar is limited in lenght by 255 characters.
    The problem I am having is actually creating the Blob Object. I get a null pointer exception no matter what I do.(Even when there is text in the JTextArea) Please take a look at my code and please help me out if you can.
    I'm not sure if I'm using the java Blob correctly as it cannot be instantiated and it's an interface not a class.
    Please give me any suggestions including if there is a better way to doing this without using a Blob object. Thanks in advance.
    // create a new Blob Object, must initialize to something
    Blob tempBlob = null;
    // viewOrdData.notes is the JTextArea
    if (viewOrdData.notes.getText().length() > 0) {
    // THIS IS THE LINE WHERE I GET THE NULL POINTER EXCEPTION
    // I tried initial position both 0 and 1
    tempBlob.setBytes(0,viewOrdData.notes.getText().getBytes())
    stmt.executeUpdate(
    "UPDATE WORKORDER "+
    "SET NOTES = "+tempBlob+" "+ // NOTES is of type Blob
    "WHERE WRKID = "+viewOrdData.workOrderID); // primary key

    Now, Storing a Blob into Database from a JTextArea or any text components becomes easy with the SerialBlob class( javax.sql.rowset.serial.SerialBlob - JDK 1.5).
    For eg..
    For Storing a Blob to Database
    pstmt.setBlob(1,new  SerialBlob(jtextArea.getText().getBytes()));For Retrieving a Blob to JTextArea
    SerialBlob sblob = new SerialBlob(rs.getBlob("FieldName"));
    jTextArea.setText(new String(sblob.getBytes(1, (int)sblob.length())));Hope this serves this problem well.
    Regards,
    R.Amirdha Gopal.

  • Drop down menu for birthday, inserting into Mysql

    I have a registration form that inserts a new record into
    mysql.
    For the birthday, I have two spryselect dropdowns (month and
    day), and one spry textfield (year).
    Once the user submits the form, how can the selected values
    (month and day) be combined with the inputted year so mysql can
    accept it: YYYY-MM-DD.
    Here is my insert code. I tried concat but I don't think I
    did it right.
    if ((isset($_POST["MM_insert"])) &&
    ($_POST["MM_insert"] == "form1")) {
    $insertSQL = sprintf("INSERT INTO members (Username,
    Password, `First`, `Last`, Birthday, Address1, Address2, City,
    `State`, Zip, Phone, Email, Newsletter) VALUES (%s, %s, %s, %s, %s,
    %s, %s, %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($_POST['Username'], "text"),
    GetSQLValueString($_POST['Password'], "text"),
    GetSQLValueString($_POST['First_Name'], "text"),
    GetSQLValueString($_POST['Last_Name'], "text"),
    GetSQLValueString($_POST['Birthday'], $year.$month.$day),
    GetSQLValueString($_POST['Address1'], "text"),
    GetSQLValueString($_POST['Address2'], "text"),
    GetSQLValueString($_POST['City'], "text"),
    GetSQLValueString($_POST['State'], "text"),
    GetSQLValueString($_POST['Zip'], "int"),
    GetSQLValueString($_POST['Phone_Number'], "int"),
    GetSQLValueString($_POST['EMail_Address'], "text"),
    GetSQLValueString($_POST['Newsletter'], "text"));

    chris.cavage wrote:
    > Here is my insert code. I tried concat but I don't think
    I did it right.
    Assuming you have named the select elements and text field
    "month",
    "day", and "year", you need to add this somewhere near the
    top of the page:
    if (isset($_POST['month']) && isset($_POST['day'])
    isset($_POST['year'])) {
    $_POST['birthday'] =
    "{$_POST['year']}-{$_POST['month']}-{$_POST['day']}";
    } else {
    $_POST['birthday'] = 0;
    Then change this:
    > GetSQLValueString($_POST['Birthday'],
    > $year.$month.$day),
    to this:
    GetSQLValueString($_POST['Birthday'], "text"),
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS4",
    "PHP Solutions" & "PHP Object-Oriented Solutions"
    http://foundationphp.com/

  • How to insert into table from an Datatable ?

    Hi Friend,
    I have a datatable that is created at some point in my SSIS as an object.
    I need to insert the data into a sql table, how should I do that ?
    I have this:
            Dim oleDA As New OleDbDataAdapter
            Dim dt As New DataTable
            Dim col As DataColumn
            Dim row As DataRow
            Dim sMsg As String
            oleDA.Fill(dt, Dts.Variables("history").Value
    and want to insert into a table in a SQL DB
            Dim sqlCon As New SqlClient.SqlConnection("server=Myserver\SQL2008R2;database=MyDB;Integrated Security=SSPI")
            Dim sqlreader As SqlClient.SqlDataReader
            sqlCon.Open()
    Thanks in advance,
    Pat
    Patrick Alexander

    Convert it to a ADO .Net recordset and store it in a object variable in SSIS.
    Then you can use it to populate the table using foreach loop with ado enumerator
    http://www.codeproject.com/Articles/10503/Simplest-code-to-convert-an-ADO-NET-DataTable-to-a
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for

  • Problem with Variable!!! Please Help

    Hello People! I have a big problem!! I have a procedure executed by a program in Pro * C/C++ In this program there is a variable: char CBATCH[8]; MEMSET (CBATCH, NULL, 8); This variable is a parameter for my procedure! create or replace procedure COM

  • GG Replicaation Issues

    Hi All, In GG I have source side 10 columns and target 3 columns when i try to update source side EXCEPT theses 3 columns like other columns target side no changes but timestamp will get change i don't want this changes on target side. I need when th

  • Can I create x1 CR layout for all databases

    Hi Is it possible to have x1 Crystal Report Layout for x17 Databases with different Logos (Logos are based off the databases), a little detail: We have x17 databases on the same SQL Server, I have created a Crystal Report which can be used for all co

  • Missing com.crystaldecisions.sdk.framework directory and classes

    Hello, I installed crystal report server 2008 and Iu2019m missing the directory and classes in "com.crystaldecisions.sdk.framework" on the webreporting.jar package. Does anyone know why? Or does anyone know where I can get the complete webreporting.j

  • Sending pics from phone to picasa

    When I send photos to Picasa from my Incredible, I can never find them. What is the secret? lol