Simple insert query....

Excuse me guys,
i've a banal question but i've not a response...I'm developing a jsf
application.
i've a table in my mysql db,
with an autoincremented id and some others attributes.
My question is:
I want to insert a row of values in this table,but i can't do it using
a form page,but i have to use 3 page of forms.
How can i reference the same id and insert the same row using 3 pages?
For example,my table has:
id, name,lastname,city,address,profession.
I want inserting in a first page name and lastname,
in the second one city and address
and in the third one profession.
How can i reference the same line?
I want to use transaction support,so i need to store partial query on
each page into an object, to load all in one moment in the last page.
Can you help me with code?
Thanks.

thanks very much for your helps...
but i've created a bean with session scope,i've collect data into this bean but when i submit botton in the last page navigation performs correctly but the values aren't inserted in my table.
Using the query of my bean with mysql runs correctly,performing correct inserting of data.
When i run my jsf application it'doesn't go correctly?
Can you help me?
I post you my bean's method that performs insert....please help me�
public String AddNewExp() throws SQLException {
          // esperimento(username,piattaforma,links_url,tipoesperimento,controlliqualita,brevedescrizione,numeroibridazioni,autore,laboratorio,contatti,tabellaannotazioni,datigrezzi,protocolloscansione,softwareanalisi,datinormalizzati,tiponormalizzazione,scalalogaritmica,geniregolati,test,parametri)
          try {
               k = 3;
               DataSource dataSource = Singleton.getInstance().getDataSource();
               k = 4;
               Connection conn = dataSource.getConnection();
               k = 5;
               if (conn != null) {
                    k = 6;
                    PreparedStatement pst = null;
                    k=7;
                    pst = conn.prepareStatement("INSERT INTO esperimento(username,nometeam,piattaforma,links_url,tipoesperimento,controlliqualita,brevedescrizione,numeroibridazioni,autore,laboratorio,contatti,protocolloscansione,softwareanalisi,tiponormalizzazione,scalalogaritmica,test,parametri,foldchange,p_value,fattoredicorrezione,fattore1,fattore2,fattore3,fattore4) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
                    pst.setString(1, name);
                    pst.setString(2, team);
                    pst.setString(3, platform);
                    pst.setString(4, links);
                    pst.setString(5, toe);
                    pst.setString(6, qcst);
                    pst.setString(7, description);
                    pst.setInt(8, hybridationNumbers);
                    pst.setString(9, author);
                    pst.setString(10, laboratory);
                    pst.setString(11, contact);
                    pst.setString(12, scanning);
                    pst.setString(13, software);
                    pst.setString(14, normalization);
                    pst.setString(15, logarithmic);
                    pst.setString(16, test);
                    pst.setString(17, parameters);
                    pst.setDouble(18, fold);
                    pst.setInt(19, p_value);
                    pst.setString(20, correction);
                    pst.setString(21, factor1);
                    pst.setString(22, factor2);
                    pst.setString(23, factor3);
                    pst.setString(24, factor4);
                    k=8;
                    pst.executeUpdate();
                    k=9;
                    pst.close();
                    k=10;
                    conn.close();
                    k=11;
               k=30;
          catch (Exception e) {k=100;
          return "go";
     }[/code
I've used k for debugging, my page show k=100...DataSource dataSource = Singleton.getInstance().getDataSource();
               k = 4;
               Connection conn = dataSource.getConnection();
are surely corrected because they work in others beans....
please help me....

Similar Messages

  • How can I enter the data from the recordset into your insert query

    Hi
    i would like to know how I can enter the data from the recordset into your insert query without using a  hidden field.
    thanks
    ------------------------------------------------------------------------------------Below is the code------------------------------------------------------------------------------------- -----
    <?php require_once('../../Connections/ezzyConn.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
       $theValue = function_exists("mysql_real_escape_string") ?  mysql_real_escape_string($theValue) : mysql_escape_string($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"] == "frmpostComment")) {
       $insertSQL = sprintf("INSERT INTO comments (com_topic, com_user, title,  com_content, com_date, online_id) VALUES (%s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['com_topic'], "int"),
                           GetSQLValueString($_POST['commentby'], "int"),
                           GetSQLValueString($_POST['title'], "text"),
                           GetSQLValueString($_POST['com_content'], "text"),
                           GetSQLValueString($_POST['com_date'], "text"),
                           GetSQLValueString($_POST['online_id'], "int"));
      mysql_select_db($database_ezzyConn, $ezzyConn);
      $Result1 = mysql_query($insertSQL, $ezzyConn) or die(mysql_error());
      $insertGoTo = "index.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    $colname_rsCommentby = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_rsCommentby = $_SESSION['MM_Username'];
    mysql_select_db($database_ezzyConn, $ezzyConn);
    $query_rsTopics = "SELECT topic_id, topic FROM topics ORDER BY topic_date DESC";
    $rsTopics = mysql_query($query_rsTopics, $ezzyConn) or die(mysql_error());
    $row_rsTopics = mysql_fetch_assoc($rsTopics);
    $totalRows_rsTopics = mysql_num_rows($rsTopics);
    mysql_select_db($database_ezzyConn, $ezzyConn);
    $query_rsOnline = "SELECT online_id, `online` FROM `online` ORDER BY online_id DESC";
    $rsOnline = mysql_query($query_rsOnline, $ezzyConn) or die(mysql_error());
    $row_rsOnline = mysql_fetch_assoc($rsOnline);
    $totalRows_rsOnline = mysql_num_rows($rsOnline);
    $colname_rsCommentby = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_rsCommentby = $_SESSION['MM_Username'];
    mysql_select_db($database_ezzyConn, $ezzyConn);
    $query_rsCommentby  = sprintf("SELECT user_id, username FROM users WHERE username = %s",  GetSQLValueString($colname_rsCommentby, "text"));
    $rsCommentby = mysql_query($query_rsCommentby, $ezzyConn) or die(mysql_error());
    $row_rsCommentby = mysql_fetch_assoc($rsCommentby);
    $totalRows_rsCommentby = mysql_num_rows($rsCommentby);
    ?>
    <?php include("../includes/access.php"); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>ezzybay - easy click, ezzy shopping</title>
    <link href="../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../css/navigation.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <?php include("../includes/top.php"); ?>
      <div id="content">
      <div id="pageTitle">
        <h2>CMS Section:</h2>
        <p>Comment Topics Page</p>
      </div>
      <?php include("../includes/leftnav.php"); ?>
        <div id="mainContent">
          <form action="<?php echo $editFormAction; ?>" method="post" name="frmpostComment" id="frmpostComment">
            <table align="center">
            <caption>Post Comment</caption>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Topic:</td>
                <td><select name="com_topic" class="listbox" id="com_topic">
                  <?php
    do { 
    ?>
                   <option value="<?php echo  $row_rsTopics['topic_id']?>"><?php echo  $row_rsTopics['topic']?></option>
                  <?php
    } while ($row_rsTopics = mysql_fetch_assoc($rsTopics));
      $rows = mysql_num_rows($rsTopics);
      if($rows > 0) {
          mysql_data_seek($rsTopics, 0);
          $row_rsTopics = mysql_fetch_assoc($rsTopics);
    ?>
                </select></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Title:</td>
                <td><input name="title" type="text" class="textfield" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right" valign="top">Comment:</td>
                <td><textarea name="com_content" cols="50" rows="5" class="textarea"></textarea></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Status:</td>
                <td><select name="online_id" class="smalllistbox">
                  <?php
    do { 
    ?>
                   <option value="<?php echo $row_rsOnline['online_id']?>"  <?php if (!(strcmp($row_rsOnline['online_id'], 2))) {echo  "SELECTED";} ?>><?php echo  $row_rsOnline['online']?></option>
                  <?php
    } while ($row_rsOnline = mysql_fetch_assoc($rsOnline));
    ?>
                </select></td>
              </tr>
              <tr> </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right"> </td>
                <td><input type="submit" class="button" value="Insert record" /></td>
              </tr>
            </table>
            <input name="commentby" type="hidden" id="commentby" value="<?php echo $row_rsCommentby['user_id']; ?>" />
            <input type="hidden" name="com_date" value="<?php echo date("d/m/y : H:i:s", time()) ?>" />
            <input type="hidden" name="MM_insert" value="frmpostComment" />
          </form>
        </div>
      </div>
    <?php include("../includes/footer.php"); ?>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($rsTopics);
    mysql_free_result($rsOnline);
    mysql_free_result($rsCommentby);
    ?>

    I'll keep it simple and only use the date as an example. Hopefully you get the concept from the example. Basically you create a recordset and insert the recordset value instead of the POST value into your insert query. In the example below I declared a variable for $the_date and entered the variable into the INSERT query instead of the hidden POST field.
    <?php require_once('../../Connections/ezzyConn.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
       $theValue = function_exists("mysql_real_escape_string") ?  mysql_real_escape_string($theValue) : mysql_escape_string($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;
    $the_date = date("d/m/y : H:i:s", time());
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frmpostComment")) {
       $insertSQL = sprintf("INSERT INTO comments (com_topic, com_user, title,  com_content, com_date, online_id) VALUES (%s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['com_topic'], "int"),
                           GetSQLValueString($_POST['commentby'], "int"),
                           GetSQLValueString($_POST['title'], "text"),
                           GetSQLValueString($_POST['com_content'], "text"),
                           GetSQLValueString($the_date, "text"),
                           GetSQLValueString($_POST['online_id'], "int"));
      mysql_select_db($database_ezzyConn, $ezzyConn);
      $Result1 = mysql_query($insertSQL, $ezzyConn) or die(mysql_error());
      $insertGoTo = "index.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    ?>

  • Insert query to editbox

    Dear All,
                 how to insert query to editbox
    Regards,
    Rajkumar

    Hi RaJkumar
    Make Simple SQL Query using Query Generator under Menu Tools>Quries>Query Generator.
    Save Under Spcific Category using Query Manager
    Apply FMS to edit Text box using AltShiftF2 and select that developed query.
    Check Result using Shift+F2
    Regards,
    Bhavank

  • Insert query in a workbook -BEx 7.0

    I have a workbook with one query in it, and I would like to insert one more query in a seperate worksheet. In BEx 3.x I did it simple with the command "Insert Query", but here I cannot find a command that insert the query with the data area and filters and Information etc.
    Thanks

    Hi shmuel cooper,
    The only way I know is to use the new toolbar from BI 7 analyser called the design toolbar.
    With that you have to insert a table, a filter area, information, and assign it all to a DP_X (DataProvider - meaning query) one by one.
    Diogo.

  • Syntax error in insert query

    I have a flash form that is used to inserts a record into an
    Access database table. In the for there are 4 datefields, several
    text input fields, and several select fields. When I submit the
    form, I get a syntax error that reads:
    Executing Database Query. [Macromedia][SequeLink JDBC
    Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver]
    Syntax error in INSERT INTO statement.
    The error occurred on line 184. Complex object types cannot
    be converted to simple values.
    Line 184 is the last line of the Values in the insert query.
    The query looks like this:
    <CFQUERY DATASOURCE="#REQUEST.DataSource#">
    INSERT INTO EstimateNumber(
    BidNumber,
    Project,
    JobSite,
    EstimatedBy,
    Region,
    Company,
    Division,
    InquiryNumber,
    SafetyChecklist,
    SafetyChecklistDate,
    QCChecklist,
    QCChecklistDate,
    EstimatedValue,
    UserUsername,
    UserPassword,
    Updated,
    ReviewDate,
    ReviewedBy,
    Discipline,
    BidDate,
    JobNumber,
    UpdatedBy
    VALUES(
    #FORM.BidNumber#,
    '#FORM.Project#',
    '#FORM.JobSite#',
    '#FORM.EstimatedBy#',
    #FORM.Region#,
    #FORM.Company#,
    #FORM.Division#,
    '#FORM.InquiryNumber#',
    #FORM.SafetyChecklist#,
    #FORM.SafetyChecklistDate#,
    #FORM.QCChecklist#,
    '#FORM.QCChecklistDate#',
    #FORM.EstimatedValue#,
    '#FORM.UserUsername#',
    '#FORM.UserPassword#',
    #FORM.Updated#,
    #FORM.ReviewDate#,
    #FORM.ReviewedBy#,
    #FORM.Discipline#,
    #FORM.BidDate#,
    #FORM.JobNumber#,
    '#FORM.UpdatedBy#'
    </CFQUERY>
    Any recomendations?

    Date/Time in Access provide some pretty strage hurdles. In
    many occassions I have simply changed the field to a Text field and
    ran with that and never seemed to have problems with the result. I
    didn't like doing it but I never received errors. I have been
    receiving some parameter errors with <cfqueryparam> like the
    database doesn't recognized the preceding declared field in the
    update or insert query. Here is an example of a wierd error with
    Access. I have 2 tables. One is for estimate numbers and the other
    is for sub estimate numbers that can be assigned to specific
    estimate numbers. If is actually a complicated explanation about
    what is taking place behind the doors on this. The concept is
    simple on the surface. Both tables have the same fields except the
    subestimate table has 1 extra for a user defined subestimate
    number. The only relation between the two will be the estimate
    number. This insert works fine.
    INSERT INTO EstimateNumber(
    BidNumber,
    Project,
    JobSite,
    EstimatedBy,
    Region,
    Company,
    Division,
    InquiryNumber,
    SafetyChecklist,
    SafetyChecklistDate,
    QCChecklist,
    QCChecklistDate,
    EstimatedValue,
    UserUsername,
    UserPassword,
    ReviewDate,
    Discipline,
    BidDate,
    JobNumber,
    UpdatedBy
    VALUES(
    #FORM.BidNumber#,
    '#FORM.Project#',
    '#FORM.JobSite#',
    '#FORM.EstimatedBy#',
    #FORM.Region#,
    #FORM.Company#,
    #FORM.Division#,
    '#FORM.InquiryNumber#',
    #FORM.SafetyChecklist#,
    <cfqueryparam
    value="#FORM.SafetyChecklistDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.QCChecklist#,
    <cfqueryparam
    value="#FORM.QCChecklistDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.EstimatedValue#,
    '#FORM.UserUsername#',
    '#FORM.UserPassword#',
    <cfqueryparam
    value="#FORM.ReviewDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.Discipline#,
    <cfqueryparam
    value="#FORM.BidDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.JobNumber#,
    '#FORM.UpdatedBy#'
    This next one is the same exact query with the same table
    setup with one added field but kicks back a parmeter error
    expecting 4. I can't explain it.
    INSERT INTO SubEstimate(SubBidNumber,
    BidNumber,
    Project,
    JobSite,
    EstimatedBy,
    Region,
    Company,
    Division,
    InquiryNumber,
    SafetyChecklist,
    SafetyChecklistDate,
    QCChecklist,
    QCChecklistDate,
    EstimatedValue,
    UserUsername,
    UserPassword,
    ReviewDate,
    Discipline,
    BidDate,
    JobNumber,
    UpdatedBy
    VALUES(#FORM.SubBidNumber#,
    #FORM.BidNumber#,
    '#FORM.Project#',
    '#FORM.JobSite#',
    '#FORM.EstimatedBy#',
    #FORM.Region#,
    #FORM.Company#,
    #FORM.Division#,
    '#FORM.InquiryNumber#',
    #FORM.SafetyChecklist#,
    <cfqueryparam
    value="#FORM.SafetyChecklistDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.QCChecklist#,
    <cfqueryparam
    value="#FORM.QCChecklistDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.EstimatedValue#,
    '#FORM.UserUsername#',
    '#FORM.UserPassword#',
    <cfqueryparam
    value="#FORM.ReviewDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.Discipline#,
    <cfqueryparam
    value="#FORM.BidDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.JobNumber#,
    '#FORM.UpdatedBy#'
    IF I get rid of the cfqueryparam fields it works. If I simply
    remove the param, I get a Syntax error. Needless to say I commented
    this query for the sake of sanity for the time being.

  • Oracle 10g Insert query performs inconsistent as a query vs procedure and p

    Database Version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    No error messages....
    I am facing a very weird issue that I have a insert statement in a procedure... pretty much
    inert
    into oracle_Table
    SELECT cr.a AS a,
    cr.b AS b,
    cr.c AS c,
    max(d.column_name) as d
    FROM "table 1"@Pmo.World Cr,
    [email protected] d
    WHERE d."a" = cr."column name"
    GROUP BY cr.a,
    cr.b,
    cr.c
    @Pmo.World is a database link to a MSSQL...
    The problem I am having right now is, every time I run this insert as a query. Everything works as what it should be... However, when I put this insert into a procedure, it inserts nothing...
    Simple test Proceudre:
    declare
    -- Local variables here
    i integer;
    begin
    inert
    into oracle_Table
    SELECT cr.a AS a,
    cr.b AS b,
    cr.c AS c,
    max(d.column_name) as d
    FROM "table 1"@Pmo.World Cr,
    [email protected] d
    WHERE d."a" = cr."column name"
    GROUP BY cr.a,
    cr.b,
    cr.c
    end;
    Thinking about character conversion issue I changed the procedure to
    inert
    into oracle_Table
    SELECT to_char(cr.a) AS a,
    to_char(cr.b) AS b,
    to_char(cr.c) AS c,
    max(d.column_name) as d
    FROM "table 1"@Pmo.World Cr,
    [email protected] d
    WHERE d."a" = cr."column name"
    GROUP BY cr.a,
    cr.b,
    cr.c
    Then this Inser works in the procedure... however when I revert it back with the original version that doesnt have to_char... it is working still... then I kept it running for few days... since it runs once per day, it was working for the first 2 days and then stopped working the third day... I verified the source table and every time this procedure runs, source tables were not empty...
    It is so confusing because if I manually run the insert as a query, it worked every time I ran it... however if I put that into a procedure, it works from time to time..
    Any help is highly apprecaited
    Edited by: 986006 on Feb 4, 2013 8:51 AM

    986006 wrote:
    Thanks for the hints up... I have updated my post... As I post the test procedure...it is about the exact the same as the insert query... Every time, the insert would actually insert data into the table but every time I run the test procedure, nothing gets inserted in... It sounds unbelievable but it happens... ThanksYou obviously haven't read the FAQ, or at least you haven't bothered doing what it asks. Help us to help you.
    Can you recreate the problem with simpler data on your local machine? If so provide create table and insert statements for test data.
    Format your code and place between tags.
    At the very least post the *exact* SQL or PL/SQL you are trying to run: what you've posted isn't even valid SQL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Simple Insert Statement Not Working

    This problem is just driving me crazy. I dont know what I m
    doing wrong here. The code works fine on my localhost but giving
    problem on the live site. It is a simple insert statement like
    this:
    insert into tblSubImages(productid, title, subdescription,
    image, place)
    values(#form.productid#,'#form.title#','#form.subdescription#','#uploadedimage#',
    #form.place#)
    The error I m getting looks like this:
    Syntax error in INSERT INTO statement.
    The error occurred in
    D:\Hosting\davedhillon\superprinters\admin\addaditional.cfm: line
    11
    9 : <cfset uploadedImage = cffile.serverfile>
    10 : <cfquery name="insertadditional"
    datasource="#super.dsn#">
    11 : insert into tblSubImages(productid, title,
    subdescription, image)
    values(#form.productid#,'#form.title#','#form.subdescription#','#uploadedimage#')
    12 : </cfquery>
    13 :
    SQL insert into tblSubImages(productid, title,
    subdescription, image)
    values(1,'ewr','werw','FamilyRoomBedroom.jpg')
    DATASOURCE davedhillon_accesscf_super
    VENDORERRORCODE 3092
    You can see it is the simple insert statement which I have
    worked with so many times. Why has it started giving problem all of
    a sudden?
    Thank you

    Try copying and pasting the SQL statement produced in the
    error into your DB's query analyzer and try running it, as it might
    produce a more useful error message so you can see where the
    problem exists in the SQL statement. Also, I think I've seen that
    3092 code before and it means there is a reserved word violation so
    cf_dev2 solution will probably solve it.
    CoolJJ

  • Can not execute a simple update query with ms access

    Hi
    I am trying to execute a simple update query , this is the code I am running : I get no exeptions but the db is not being updated .
    When I copy my query into access it works !
    The table / columns are spelled correctly and I am able to execute select queries.
    can anyone figure out what is going on
    Thanks shahar
    public static void main(String[] args) {
    MainManager mainManager = MainManager.getInstance();
    Log log = Log.getInstance();
    try {
    log.writeDebugMessage("befor executing query");
    //stmt.executeUpdate("update trainee set Trainee_Name = 'shahar&Rafi' where Trainee_Id = 1 ");
    //stmt = null ;
    PreparedStatement stmt1 = con.prepareStatement("UPDATE Trainee SET Trainee_Name =? WHERE Trainee_Id =?");
    String name = new String("Shahar&Rafi");
    int Id = 1 ;
    stmt1.setString(1,name);
    stmt1.setInt(2,Id);
    System.out.println(stmt1.toString());
    stmt1.execute();
    log.writeDebugMessage("After executing query");
    catch (SQLException e ){
    System.err.println("SQLException: " + e.getMessage());
    }

    Hi All,
    got the problem solved at last.
    first, in the SQL string all the values must be within " ' "
    for example:
    INSERT INTO Trainee(Trainee_Id , Trainee_password , Trainee_Address, Trainee_Name , Trainee_Phone , Trainee_Gender , Trainee_SessionTime , Trainee_Purpose , Trainee_HealthStatus , Trainee_StartDate , Trainee_Birthday) VALUES (6,'333','hhhh','rafi',048231821,true,63,4,true, ('Feb 22, 2002'), ('Feb 22, 2002'))
    second and more important,
    a 'dummy' sql select query must be performed after an update query
    example for code:
    try{
    DB.MainManager.getInstance().ExecuteUpdateQuery(A);
    DB.MainManager.getInstance().getStatement().executeQuery("SELECT * FROM Trainee");
    where A is the update query.

  • Making an insert query generic in ODI procedure

    Hi,
    i am writing a procedure in ODI to insert in a table my sql is simple:
    Insert into ci_txn_header_k
    select t.txn_header_id,f.env_id
    from ci_txn_header t,f1_installation f
    where t.bo_status_cd='PEND' and t.txn_header_id not in (select txn_header_id from ci_txn_header_k)
    I wish to make this query generic and use the ODI ref functions in it.can i get the schema and table name using the Odiref functions. If so then plz guide me how

    Hi,
    Import all tables referenced in your query into a logical model / models.
    ci_txn_header_k
    ci_txn_header,
    f1_installation f
    Lets assume you import the tables into one Logical model / schema called 'GENERIC'
    Then simply reference them using <%=odiRef.getObjectName("L""CI_TXT_HEADER","GENERIC","GLOBAL","D")%>
    Im using context 'GLOBAL' in my example above, replace with your context.
    So something like :
    Insert into <%=odiRef.getObjectName("L","CI_TXT_HEADER_K","GENERIC","GLOBAL","D")%> k
    select t.txn_header_id,f.env_id
    from
    <%=odiRef.getObjectName("L","CI_TXN_HEADER","GENERIC","GLOBAL","D")%> t,
    <%=odiRef.getObjectName("L","F1_INSTALLATION","GENERIC","GLOBAL","D")%> f
    where t.bo_status_cd='PEND' and t.txn_header_id not in (select txn_header_id from <%=odiRef.getObjectName("L","CI_TXN_HEADER","GENERIC","GLOBAL","D")%>)
    Hope this helps, check out the API Substitution ref for a guide, also worth looking at Knowledge Modules and how they build up From clauses in LKM and IKM steps - you can learn a lot by referencing the existing code that ships with the product.
    Regards
    Alastair

  • Performance issues with respect scheme registration,select & insert query

    I am facing performance issues with respect to schema registration,Select & insert query towards 10.2.0.3 version.It is taking around 45 minutes to register schema and it is taking around 5 min to insert a single document into xml db where as it was taking less than min to insert a single document into xml db of 9.2.0.6 version.Would like to know the issue and solution to resolve this issue.Please help me out on this as it is very urgent for me

    Since it appears that this is an XML DB specific question, you're probably better off posting in the XML DB. The folks over there have much more experience with the ins and outs of that particular product.
    Justin

  • How can I insert Query in a Workbook

    Hi,
    I am new in BI 7.0. I am trying to insert a query in a workbook. but the tools button is not giving me the option to insert query like 3.X
    How can i insert query in 7.0
    Can anybody please give me the step by step instruction.
    Thanks in Advance

    1. Open BEx ANalyzer.
    2. Create new excel workbook by hitting the "New" icon in Excel.
    3. Logon to a backend BI system.
    4. Click the design mode icon.
    5. Put your mouse on a cell and insert a table.
    6. Assign a dataprovider to this table.
    7. Switch off design mode.
    Hope it Helps
    Chetan
    @CP..

  • Checking the status of the insert query in JSP

    frendz,
    i am working with JSP .i have some content to be inserted in the database.i have used the insert query in SQL for that.i am able to check whether it has been inserted properly in the SQL but i want to check the status of the insert query with its return value(so that i can confirm it does not return a error).so please help.

    The Statement#executeUpdate() returns an int with the row count. Get hold of it.
    Also see the Statement API: http://java.sun.com/javase/6/docs/api/java/sql/Statement.html
    Apart from this, I recommend you to use PreparedStatement instead. It will not only ease setting Java objects in a query (no hassle anymore with quotes), but it will also prevent you from SQL injections.
    Prepare here: http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html
    SQL injections: http://en.wikipedia.org/wiki/SQL_injection

  • How can you create a simple insert or update trigger

    I am trying to create a simple insert or update trigger to timestamp an xml document when I load it into my XML DB repository but I always get an error trying to compile the trigger.
    "ORA-25003: cannot change NEW values for this column type in trigger"
    Here is my PL/SQL:
    CREATE OR REPLACE TRIGGER "PLCSYSADM"."PLCSYSLOG_TIMESTAMP"
    BEFORE
    INSERT
    OR UPDATE ON "PLCSYSADM"."PLCSYSLOG"
    FOR EACH ROW BEGIN
    :new.sys_nc_rowinfo$ := xmltype('<datestamp>' || SYSDATE || '</datestamp>');
    END;
    Does anyone have an example that works ?
    Thanks in advance
    Niels Montanana

    http://developer.apple.com/referencelibrary/HardwareDrivers/idxUSB-date.html

  • Tools | Insert Query no longer supported with SAPBEX 7.0 ?

    Hi
    With SAPBEX for BW 3.5 we could use Tools | Insert Query ... in individual worksheets and then save this as a workbook. 
    Now for BW 7.0, the SAPBEX does not seem to be able to do this and the end-user must "paint" the query by inserting a navigation area, filter block and results area into the sheet and then bind these objects to an infoprovider.
    My users will struggle with this new method - has the Insert function been removed or is it hiding somewhere ?
    regards
    Ian MacLaren

    Hi,
    it's very borring to re-design a query for each sheet...
    So there is an helpful option :
    1) Open Bex Analyser
    2) Open your query
    3) DIsplay the Navigation pane (thanks to the button filter)
    4) In the navigation pane, right click on a caracteristic that is not display in your analysis grid yet
    5) choose the last option "Drill <name of the caracteristic> Across Sheets"
    6) It will duplicate the query for each value of the caracteristic, in a individual sheet for each value.
    (so... choose a caracteristic with less than 10 values)
    7) now you've got several sheets but no data.
    8) Refresh the workbook
    Now, you've got a workbook with several sheet with the same design.
    You just have to go in conception mode and change the dataprovider of the different object into each sheet.
    N.B : The button chart, filter, information doesn't work for news sheet...
    you will have to develop VBA macro or just use Excel function : Data > Group and Outline > Group... in order to hide and unhide lines and column quickly.
    Hope it's help
    Don't forget point.

  • Performance issue with insert query !

    Hi ,
    I am using dbxml-2.4.16, my node-storage container is loaded with a large document ( 54MB xml ).
    My document basically contains around 65k records in the same table ( 65k child nodes for one parent node ). I need to insert more records in to my DB, my insert XQuery is consuming a lot of time ( ~23 sec ) to insert one entry through command-line and around 50sec through code.
    My container is indexed with "node-attribute-equality-string". The insert query I used:
    insert nodes <NS:sampleEntry mySSIAddress='70011' modifier = 'create'><NS:sampleIPZone1Address>AABBCCDD</NS:sampleIPZone1Address><NS:myICMPFlag>1</NS:myICMPFlag><NS:myIngressFilter>1</NS:myIngressFilter><NS:myReadyTimer>4</NS:myReadyTimer><NS:myAPNNetworkID>ggsntest</NS:myAPNNetworkID><NS:myVPLMNFlag>2</NS:myVPLMNFlag><NS:myDAC>100</NS:myDAC><NS:myBcastLLIFlag>2</NS:myBcastLLIFlag><NS:sampleIPZone2Address>00000000</NS:sampleIPZone2Address><NS:sampleIPZone3Address>00000000</NS:sampleIPZone3Address><NS:sampleIPZone4Address>00000000</NS:sampleIPZone4Address><NS:sampleIPZone5Address>00000000</NS:sampleIPZone5Address><NS:sampleIPZone6Address>00000000</NS:sampleIPZone6Address><NS:sampleIPZone7Address>00000000</NS:sampleIPZone7Address></NS:sampleEntry> into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable)
    If I modify my query with
    into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:sampleTable/NS:sampleEntry[@mySSIAddress='1']
    insted of
    into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable)
    Time taken reduces only by 8 secs.
    I have also tried to use insert "after", "before", "as first", "as last" , but there is no difference in performance.
    Is anything wrong with my query, what should be the expected time to insert one record in a DB of 65k records.
    Has anybody got any idea regarding this performance issue.
    Kindly help me out.
    Thanks,
    Kapil.

    Hi George,
    Thanks for your reply.
    Here is the info you requested,
    dbxml> listIndexes
    Index: unique-node-metadata-equality-string for node {http://www.sleepycat.com/2002/dbxml}:name
    Index: node-attribute-equality-string for node {}:mySSIAddress
    2 indexes found.
    dbxml> info
    Version: Oracle: Berkeley DB XML 2.4.16: (October 21, 2008)
    Berkeley DB 4.6.21: (September 27, 2007)
    Default container name: n_b_i_f_c_a_z.dbxml
    Type of default container: NodeContainer
    Index Nodes: on
    Shell and XmlManager state:
    Not transactional
    Verbose: on
    Query context state: LiveValues,Eager
    The insery query with update takes ~32 sec ( shown below )
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS';insert nodes <NS:sampleEntry mySSIAddress='70000' modifier = 'create' ><NS:sampleIPZone1Address>AABBCCDD</NS:sampleIPZone1Address><NS:myICMPFlag>1</NS:myICMPFlag><NS:myIngressFilter>1</NS:myIngressFilter><NS:myReadyTimer>4</NS:myReadyTimer><NS:myAPNNetworkID>ggsntest</NS:myAPNNetworkID><NS:myVPLMNFlag>2</NS:myVPLMNFlag><NS:myDAC>100</NS:myDAC><NS:myBcastLLIFlag>2</NS:myBcastLLIFlag><NS:sampleIPZone2Address>00000000</NS:sampleIPZone2Address><NS:sampleIPZone3Address>00000000</NS:sampleIPZone3Address><NS:sampleIPZone4Address>00000000</NS:sampleIPZone4Address><NS:sampleIPZone5Address>00000000</NS:sampleIPZone5Address><NS:sampleIPZone6Address>00000000</NS:sampleIPZone6Address><NS:sampleIPZone7Address>00000000</NS:sampleIPZone7Address></NS:sampleEntry> into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable"
    Time in seconds for command 'query': 32.5002
    and the query without the updation part takes ~14 sec ( shown below )
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS'; doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable"
    Time in seconds for command 'query': 13.7289
    The query :
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS'; doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//PMB:sampleTable/PMB:sampleEntry[@mySSIAddress='1000']"
    Time in seconds for command 'query': 0.005375
    is very fast.
    The Updation of the document seems to consume much of the time.
    Regards,
    Kapil.

Maybe you are looking for

  • My dvd is coming out in black and white why?

    my dvd is coming out in black and white from imovie 8 and idvd

  • My Function F7 is not working

    I am trying to connect to a beam projector. It has worked for several months, the only thing I did this weekend was install an upgrade to Microsoft Office 2007. How can I check my settings for Function F7 button?

  • Rental Movies on Mac & Apple TV

    I rented a movie on my computer and then wanted to see it on my apple TV but the movie does not appear there. I checked the apple store / rentals but nothing appears. For sure i am using the same Apple ID on Itunes in the computer and on the Apple TV

  • Can't disable Web Address Auto-complete in Safari nor Firefox

    Hi there, I am trying to disable the web address auto-complete in order to access my Intranet Server. I tried configuration inside Web Browser (firefox) but doesn't work. Seems to be system configuration since is the same with Safari. If I enter the

  • Horizontal Menu Not Displaying Right in IE (Shocker!)

    Can someone look and see why my menu wont display correctly in IE. I've used the same feature on other sights with no problems. I may have jacked up the code when tweaking the design. Any help would be appreciated. Cheers. www.brand32.com/Evoke I'll