Join multiple output tables of BAPI into new table

Hi,
In my model (VC 7.0), I have a BAPI which outputs two different tables. Tables have many multiple records. Each table has several fields and a common field also. I want to combine these tables into one table form. I used the following methods and result are :
1. I tried to connect output tables to one table form but no success. Because table form allows only one table input.
2. I put a combine operator for output tables. No success. Although they're common field and multiple records but table form shows only one record? Where are the other record ?
3. I put a union operator  for output tables. No success. Because union operator output only the common field. But I need the other fields from output tables in my table form.
Will you please suggest what are the options available with me for joing output of both tables. I think combine operator should solve.
Regards,
Yiğit

Hi,
use this link to get your answer:
Join two Table output to new table
Otherwise you can try with this:
1. Drag signal out from the first table. Select all the fields which you want to be pass in the final table.Make the first table as multiple selection one.
2. Create one button in toolbar for the first table and give some proper name in action property.
3. mentioned the same action name in the link between the signal out and the first table.
4. follow the same steps for the second table also.
5. then from compose choose two signal ins and drag them on the story board. Then give the same name as you have given the signal outs name.
6. Mention all the fields as you have mentioned in the siganl outs.
7. Add a combine operator with both the signal ins and combine a table with the outport of the combine operator.
Save and deploy. I hope it will help you.
Here, you have to select the rows which you want to visualize in the final output table.
Regards,
Nutan
regards,
Nutan

Similar Messages

  • How to get the data from 2 out ports (tables) of BAPI into one table

    I have a BAPI that has two out ports (header and detail). How do I display this data in one table.
    Thanks,
    Subba

    Hi,
    you have the Union operator to merge multiple datasets into one dataset
    regards Tobias

  • Hi guys n girls. How do you copy a whole table to create a new table with all cell sizes in tact? Thanks for your help. Jason.

    Hi guys n girls. How do you copy a whole table to create a new table with all cell sizes in tact? Thanks for your help. Jason.
    when you copy n paste into a new table, all the cell sizes are changed.
    is there a way to put in a new table from your templates into an existing file, different to the standard very basic ones in insert table.
    I look forward to your answers.  Your help is very much appreciated.
    Also how do you search for question answers already written in this support area please.

    Hi Jason,
    In Numbers 3, you can select a whole table by clicking once in the table to make it active, then click once on the "bull's eye" at the top left.
    Now copy and paste. All formatting (and any cell content) is pasted intact. In Numbers 2.3 (Numbers '09) it is a little different for selecting a whole table. But I won't go into that unless you are using Numbers '09. Please reply.
    I don't like the look of the tables in Insert Table. I keep custom tables in My Templates. I have set Numbers > Preferences > General > For New Documents > Use template: (name of my favourite custom template)
    That opens when I launch Numbers, or ask for a new document (command n). Note that if you follow this preference setting, then Menu > File > New From Template Chooser (for another template) requires you to hold down the option key in that menu.
    Regards,
    Ian.
    Message was edited by: Yellowbox. All formatting (and any cell content) is pasted intact.

  • Join multiple tables to create one new table with data from all the other

    CREATE TABLE NAME2012 (STOCKNAME2012 VARCHAR(255), VAL2012 FLOAT)
    INSERT INTO NAME2012 VALUES (‘Stock3’, 50)
    INSERT INTO NAME2012 VALUES (‘Stock2’, 55)
    INSERT INTO NAME2012 VALUES (‘Stock4’, 45)
    CREATE TABLE NAME2011 (STOCKNAME2011 VARCHAR(255), VAL2011 FLOAT)
    INSERT INTO NAME2011 VALUES (‘Stock1’, 56)
    INSERT INTO NAME2011 VALUES (‘Stock2’, 48)
    INSERT INTO NAME2010 VALUES (‘Stock3’, 59)
    CREATE TABLE NAME2010 (STOCKNAME2010 VARCHAR(255), VAL2010 FLOAT )
    INSERT INTO NAME2010 VALUES (‘Stock1’, 47)
    INSERT INTO NAME2010 VALUES (‘Stock2’, 46)
    I would like a new Table STOCKS populated with names of stocks from the other tables as well as values. So I get a new table STOCKS, with data as below.
    CREATE TABLE STOCKS (NAME VARCHAR(255), VALUE2012 FLOAT , VALUE2011 FLOAT, VALUE2010 FLOAT)
    End result in table STOCKS should be like:
    NAME               VALUE2010              VALUE2011             
    VALUE2012
    Stock1                 47                          
    56                            NULL
    Stock2                 46                          
    48                             50
    Stock3                NULL                         59                          
     55
    Stock4                NULL                       NULL                         
    45
    How can I write a T-SQL expression that could do this?

    Hi
    There must be StockMaster
    Try this
    CREATE TABLE NAME2012 (
    STOCKNAME2012 VARCHAR(255)
    ,VAL2012 FLOAT
    INSERT INTO NAME2012
    VALUES (
    'Stock3'
    ,50
    INSERT INTO NAME2012
    VALUES (
    'Stock2'
    ,55
    INSERT INTO NAME2012
    VALUES (
    'Stock4'
    ,45
    CREATE TABLE NAME2011 (
    STOCKNAME2011 VARCHAR(255)
    ,VAL2011 FLOAT
    INSERT INTO NAME2011
    VALUES (
    'Stock1'
    ,56
    INSERT INTO NAME2011
    VALUES (
    'Stock2'
    ,48
    CREATE TABLE NAME2010 (
    STOCKNAME2010 VARCHAR(255)
    ,VAL2010 FLOAT
    INSERT INTO NAME2010
    VALUES (
    'Stock1'
    ,47
    INSERT INTO NAME2010
    VALUES (
    'Stock2'
    ,46
    INSERT INTO NAME2010
    VALUES (
    'Stock3'
    ,59
    Create table stockMaster(STOCKNAME VARCHAR(255))
    go
    Insert into stockMaster values('Stock1')
    Insert into stockMaster values('Stock2')
    Insert into stockMaster values('Stock3')
    Insert into stockMaster values('Stock4')
    Select Distinct S.STOCKNAME , A.VAL2010 ,B.VAL2011,C.VAL2012 from  stockMaster S
    left join NAME2012  C on S.STOCKNAME = C.STOCKNAME2012
    left join NAME2011 B on s.STOCKNAME = B.STOCKNAME2011
    left join NAME2010 A on s.STOCKNAME = A.STOCKNAME2010
    go
    Drop table NAME2010
    Drop table NAME2011
    Drop table NAME2012
    Drop table stockMaster 
    Mark as Ans if you find it useful
    Shridhar J Joshi Thanks a lot

  • STARTED IT, BUT STILL NEED HELP -- INPUTTTING CHARACTERS FROM LOADED FILE INTO TABLE, SELECTING STRINGS FROM TABLE AND PLACING IN NEW TABLE, SAVING NEW TABLE TO SPREADSHEET FILE

    I AM TRYING TO IMPORT CHARACTERS FROM A TAB DELIMITED FILE INTO A TABLE ON LABVIEW.  ONCE THE DATA IS IN THE TABLE I WANT TO BE ABLE TO SELECT INDIVIDUAL STRINGS FROM THE TABLE AND PLACE IT IN A NEW TABLE.  WHEN I CLICK ON A STRING I WOULD LIKE THE SELECTED STRING TO SHOW IN A TEXT BOX LABELED 'SELECTED STEP'  AFTER ALL THE SELECTED STRINGS IS IN THE TABLE I WOULD LIKE TO SAVE THE NEW TABLE AS ANOTHER SPREADSHEET -- TAB DELIMITED -- FILE, MAKING IT ACCESSIBLE TO OPEN.  HERE IS WHAT I HAVE SO FAR.  I CAN INPUT DATA INTO THE TABLE, BUT I CAN ONLY TRANSFER ONE STRING INTO THE TABLE I WOULD LIKE TO BE TO INPUT MULTIPLE STRINGS.    ALSO WHENEVER I TRY SAVING THE FILE, IT ALWAYS SAVES A UNKNOWN FILE, HOW CAN I GET IT TO SAVE AS A SPREADSHEET FILE.  THANKING ALL OF YOU IN ADVANCE FOR YOUR HELP!!!!!!
    Attachments:
    Selector.zip ‏30 KB

    Pondered,
       The question you are asking is the same one that you asked in: http://forums.ni.com/ni/board/message?board.id=170&message.id=132508#M132508, to which I supplied a revised version of the original vi you used (which was modified from the original one I supplied to an earlier thread). A couple of questions: 1) What does my latest not do that is in your question, 2) Why are you starting yet another thread about the same problem?  We are here trying to help, it makes it a lot easier if you keep the same problem in the same thread, it reduces duplication of effort from those that might not have been following the previous thread(s).  Those of us that don't have our "names in blue" are just doing this "for fun" (the blue names are NI employees, who may still be doing it "for fun"), and it makes it more fun if it doesn't seem (correctly or not) that our attempts are ignored.  If an answer doesn't help, or seems incomplete, post a little more detail to the same thread so that the original respondent, or someone new, can provide more information, or understand your problem better.
    P.M.
    Message Edited by LV_Pro on 07-20-2005 01:20 PM
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • How to extract data from multiple flat files to load into corresponding tables in SQL Server 2008 R2 ?

    Hi,
              I have to implement the following scenario in SSIS but don't know how to do since I never worked with SSIS before. Please help me.
              I have 20 different text files in a single folder and 20 different tables corresponding to each text file in SQL Server 2008 R2 Database. I need to extract the data from each text file and
    load the data into corresponding table in Sql Server Database. Please guide me in how many ways I can do this and which is the best way to implement this job.  Actually I have to automate this job. Few files are in same format(with same column names
    and datatypes) where others are not.
    1. Do I need to create 20 different projects ?
                   or
        Can I implement this in only one project by having 20 packages?
                 or
        Can I do this in one project with only one package?
    Thanks in advance.

    As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
    Public
    Sub Main()
    ' Add your code here 
    Dim f1
    As FileStream
    Dim s1
    As StreamReader
    Dim date1
    As
    Object
    Dim rline
    As
    String
    Dim Filelist(1)
    As
    String
    Dim FileName
    As
    String
    Dim i
    As
    Integer
    i = 1
    date1 =
    Filelist(0) =
    "XYZ"
    Filelist(1) =
    "123"
    For
    Each FileName
    In Filelist
    f1 = File.OpenRead(FileName)
    s1 = File.OpenText(FileName)
    rline = s1.ReadLine
    While
    Not rline
    Is
    Nothing
    If Left(rline, 4) =
    "DATE"
    Then
    date1 (i)= Mid(rline, 7, 8)
     i = i + 1
    Exit
    While
    End
    If
    rline = s1.ReadLine
    End
    While
    Next
    Dts.Variables(
    "date").Value = date1(1)
    Dts.Variables(
    "date1").Value = date1(2)
    Dts.TaskResult = ScriptResults.Success
    End
    Sub

  • Sending different table id's into user table using a form

    hello, this is a lead up to another discussion that has not been resolved. i am getting pretty desperate now. i am sure it cant be that hard and really need help i am using MySQL php
    i have created a input form that when submitted sends the data to 3 different tables
    i have a tenant table. guarantor table and landlord table all in the database. i also have a property table that is already populated by another form on the website. on the input form though the property table is a dynamic drop down menu that when selected populates fields on the top of the input form
    i have the understanding that because the guarantorID, landlordID and propertyID are all inputting new data these will be input commands, however the property is already in the table so this will be an update command?
    what i need to do is when the form is submitted the guarantorID, landlordID and propertyID all are sent to columns in the tenant table. this is called join i believe?
    i have provided the unformatted code below that all works, but what i need to know how to do is the above. Link them all togeather and send all the id from the  guarantorID, landlordID and propertyID to the tenant table so they can all be reference when i create new pages
    can this be done?
    <?php require_once('Connections/nameprop.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"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO name_tenant (Title, `First Names`, Surname, DOB, DOBMonth, DOBYear, Nationality, Marital_Status, DayNumber, EvenNumber, MobNumber, Smoker, CurrentAdd, Status, PreviousAdd, Student, FinancialCCj, FinancialArrears, FinancialBankR, FinancialNone, BankName, AccountNum, SortCode, BankDuration, DebitCCCard, Electoral, `next of kin`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['Title'], "text"),
                           GetSQLValueString($_POST['First_Names'], "text"),
                           GetSQLValueString($_POST['Surname'], "text"),
                           GetSQLValueString($_POST['DOB'], "text"),
                           GetSQLValueString($_POST['DOBMonth'], "text"),
                           GetSQLValueString($_POST['DOBYear'], "text"),
                           GetSQLValueString($_POST['Nationality'], "text"),
                           GetSQLValueString($_POST['Marital_Status'], "text"),
                           GetSQLValueString($_POST['DayNumber'], "double"),
                           GetSQLValueString($_POST['EvenNumber'], "double"),
                           GetSQLValueString($_POST['MobNumber'], "double"),
                           GetSQLValueString($_POST['Smoker'], "text"),
                           GetSQLValueString($_POST['CurrentAdd'], "text"),
                           GetSQLValueString($_POST['Status'], "text"),
                           GetSQLValueString($_POST['PreviousAdd'], "text"),
                           GetSQLValueString($_POST['Student'], "text"),
                           GetSQLValueString($_POST['FinancialCCj'], "text"),
                           GetSQLValueString($_POST['FinancialArrears'], "text"),
                           GetSQLValueString($_POST['FinancialBankR'], "text"),
                           GetSQLValueString($_POST['FinancialNone'], "text"),
                           GetSQLValueString($_POST['BankName'], "text"),
                           GetSQLValueString($_POST['AccountNum'], "double"),
                           GetSQLValueString($_POST['SortCode'], "double"),
                           GetSQLValueString($_POST['BankDuration'], "text"),
                           GetSQLValueString($_POST['DebitCCCard'], "text"),
                           GetSQLValueString($_POST['Electoral'], "text"),
                           GetSQLValueString($_POST['next_of_kin'], "text"));
      mysql_select_db($database_nameprop, $nameprop);
      $Result1 = mysql_query($insertSQL, $nameprop) or die(mysql_error());
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO name_guarantor (FullName, Title, DOBday, DOBMonth, DOBYear, Sex, MaritalStatus, DaytimeNumber, EveningNumber, MobileNumber, Email, CurrentAddress, PreviousAddress, BankName, AccountNum, SortCode, BankDuration, CCDebitCard, ElectoralRoll, Profession, AnnualWages, PayrollNum, EmpName, EmpAddress, EmpContName, EmpContNumber, EmpEmail, EmpFinaHist, EmpDate, EmpDisclaimer) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['FullName'], "text"),
                           GetSQLValueString($_POST['Title'], "text"),
                           GetSQLValueString($_POST['DOBday'], "double"),
                           GetSQLValueString($_POST['DOBMonth'], "text"),
                           GetSQLValueString($_POST['DOBYear'], "text"),
                           GetSQLValueString($_POST['Sex'], "text"),
                           GetSQLValueString($_POST['MaritalStatus'], "text"),
                           GetSQLValueString($_POST['DaytimeNumber'], "double"),
                           GetSQLValueString($_POST['EveningNumber'], "double"),
                           GetSQLValueString($_POST['MobileNumber'], "double"),
                           GetSQLValueString($_POST['Email'], "text"),
                           GetSQLValueString($_POST['CurrentAddress'], "text"),
                           GetSQLValueString($_POST['PreviousAddress'], "text"),
                           GetSQLValueString($_POST['BankName'], "text"),
                           GetSQLValueString($_POST['AccountNum'], "double"),
                           GetSQLValueString($_POST['SortCode'], "double"),
                           GetSQLValueString($_POST['BankDuration'], "text"),
                           GetSQLValueString($_POST['CCDebitCard'], "text"),
                           GetSQLValueString($_POST['ElectoralRoll'], "text"),
                           GetSQLValueString($_POST['Profession'], "text"),
                           GetSQLValueString($_POST['AnnualWages'], "text"),
                           GetSQLValueString($_POST['PayrollNum'], "double"),
                           GetSQLValueString($_POST['EmpName'], "text"),
                           GetSQLValueString($_POST['EmpAddress'], "text"),
                           GetSQLValueString($_POST['EmpContName'], "text"),
                           GetSQLValueString($_POST['EmpContNumber'], "double"),
                           GetSQLValueString($_POST['EmpEmail'], "text"),
                           GetSQLValueString($_POST['EmpFinaHist'], "text"),
                           GetSQLValueString($_POST['EmpDate'], "double"),
                           GetSQLValueString($_POST['EmpDisclaimer'], "text"));
      mysql_select_db($database_nameprop, $nameprop);
      $Result1 = mysql_query($insertSQL, $nameprop) or die(mysql_error());
      header(sprintf("Location: %s", $insertGoTo));
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO name_landlord (name, `telephone number`, mobileNumber, email, address, dateday, datemonth, dateyear, terms) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['name'], "text"),
                           GetSQLValueString($_POST['telephone_number'], "text"),
                           GetSQLValueString($_POST['mobileNumber'], "text"),
                           GetSQLValueString($_POST['email'], "text"),
                           GetSQLValueString($_POST['address'], "text"),
                           GetSQLValueString($_POST['dateday'], "text"),
                           GetSQLValueString($_POST['datemonth'], "text"),
                           GetSQLValueString($_POST['dateyear'], "text"),
                           GetSQLValueString($_POST['terms'], "text"));
      mysql_select_db($database_nameprop, $nameprop);
      $Result1 = mysql_query($insertSQL, $nameprop) or die(mysql_error());
      $insertGoTo = "pay-online.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    mysql_select_db($database_nameprop, $nameprop);
    $query_rsApplyNow = "SELECT * FROM name_editprop";
    $rsApplyNow = mysql_query($query_rsApplyNow, $nameprop) or die(mysql_error());
    $row_rsApplyNow = mysql_fetch_assoc($rsApplyNow);
    $totalRows_rsApplyNow = mysql_num_rows($rsApplyNow);
    ?>
    <!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>Untitled Document</title>
    <script type="text/javascript">
    function loadFields(theValue) {
             var props = theValue.split("|");
              var prop_id = props[0];
              var propAdd = props[1] ;
              var propPrice = props[2];
                          var town = props[3]
                          var postcode = props[4]
              document.getElementById('prop_id').value=prop_id;
              document.getElementById('Add1').value=propAdd;
                          document.getElementById('town').value=town;
                          document.getElementById('postcode').value=postcode;
              document.getElementById('RentalPrice').value='£' + propPrice +'/ per month';
    </script>
    </head>
    <body>
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
      <input type="hidden" name="MM_insert" value="form1" />
    <!-- Place the following code where you want to show the result of the property selection --><table width="100%" border="0" cellpadding="0">
      <tr>
        <td width="23%"><!-- the following code is just copied from your code -->
          <select name="Select Property" id="Select Property" onchange="loadFields(this.value)">
            <option value="select your property">select your property</option>
            <?php
    do {
    ?>
            <option value="<?php echo $row_rsApplyNow['prop_id'] . '|' . $row_rsApplyNow['prop_add1'] . '|' . $row_rsApplyNow['rental_price'] . '|' . $row_rsApplyNow['town'] . '|' . $row_rsApplyNow['postcode'];?>"><?php echo $row_rsApplyNow['prop_id'] . " , " . $row_rsApplyNow['prop_add1']; ?></option>
            <?php
    } while ($row_rsApplyNow = mysql_fetch_assoc($rsApplyNow));
      $rows = mysql_num_rows($rsApplyNow);
      if($rows > 0) {
          mysql_data_seek($rsApplyNow, 0);
                $row_rsApplyNow = mysql_fetch_assoc($rsApplyNow);
    ?>
          </select></td>
        <td width="77%"> </td>
      </tr>
      <tr>
        <td>Property ID:</td>
        <td><input type="text" name="prop_id" id="prop_id" readonly="readonly" /></td>
      </tr>
      <tr>
        <td>Address</td>
        <td><input type="text" name="Add1" id="Add1" readonly="readonly" /></td>
      </tr>
      <tr>
        <td>Town</td>
        <td><input type="text" name="town" id="town" readonly="readonly" /></td>
      </tr>
      <tr>
        <td>Postcode</td>
        <td><label for="postcode"></label>
          <input type="text" name="postcode" id="postcode" readonly="readonly" /></td>
      </tr>
      <tr>
        <td>Rent</td>
        <td><input type="text" name="RentalPrice" id="RentalPrice" readonly="readonly" /></td>
      </tr>
      <tr>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td colspan="2"><table width="100%" border="0" cellpadding="0">
          <tr>
            <td>tenant</td>
            <td>gaurantor</td>
            <td>landlord</td>
          </tr>
          <tr>
            <td><table align="center">
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Title:</td>
                <td><input type="text" name="Title" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">First Names:</td>
                <td><input type="text" name="First_Names" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Surname:</td>
                <td><input type="text" name="Surname" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DOB:</td>
                <td><input type="text" name="DOB" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DOBMonth:</td>
                <td><input type="text" name="DOBMonth" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DOBYear:</td>
                <td><input type="text" name="DOBYear" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Nationality:</td>
                <td><input type="text" name="Nationality" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Marital_Status:</td>
                <td><input type="text" name="Marital_Status" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DayNumber:</td>
                <td><input type="text" name="DayNumber" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">EvenNumber:</td>
                <td><input type="text" name="EvenNumber" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">MobNumber:</td>
                <td><input type="text" name="MobNumber" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Smoker:</td>
                <td><input type="text" name="Smoker" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">CurrentAdd:</td>
                <td><input type="text" name="CurrentAdd" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Status:</td>
                <td><input type="text" name="Status" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">PreviousAdd:</td>
                <td><input type="text" name="PreviousAdd" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Student:</td>
                <td><input type="text" name="Student" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">FinancialCCj:</td>
                <td><input type="text" name="FinancialCCj" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">FinancialArrears:</td>
                <td><input type="text" name="FinancialArrears" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">FinancialBankR:</td>
                <td><input type="text" name="FinancialBankR" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">FinancialNone:</td>
                <td><input type="text" name="FinancialNone" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">BankName:</td>
                <td><input type="text" name="BankName" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">AccountNum:</td>
                <td><input type="text" name="AccountNum" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">SortCode:</td>
                <td><input type="text" name="SortCode" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">BankDuration:</td>
                <td><input type="text" name="BankDuration" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DebitCCCard:</td>
                <td><input type="text" name="DebitCCCard" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Electoral:</td>
                <td><input type="text" name="Electoral" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Next of kin:</td>
                <td><input type="text" name="next_of_kin" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right"> </td>
                <td> </td>
              </tr>
            </table></td>
            <td><table align="center">
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">FullName:</td>
                <td><input type="text" name="FullName" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Title:</td>
                <td><input type="text" name="Title2" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DOBday:</td>
                <td><input type="text" name="DOBday" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DOBMonth:</td>
                <td><input type="text" name="DOBMonth2" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DOBYear:</td>
                <td><input type="text" name="DOBYear2" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Sex:</td>
                <td><input type="text" name="Sex" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">MaritalStatus:</td>
                <td><input type="text" name="MaritalStatus" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DaytimeNumber:</td>
                <td><input type="text" name="DaytimeNumber" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">EveningNumber:</td>
                <td><input type="text" name="EveningNumber" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">MobileNumber:</td>
                <td><input type="text" name="MobileNumber" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Email:</td>
                <td><input type="text" name="Email" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">CurrentAddress:</td>
                <td><input type="text" name="CurrentAddress" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">PreviousAddress:</td>
                <td><input type="text" name="PreviousAddress" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">BankName:</td>
                <td><input type="text" name="BankName2" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">AccountNum:</td>
                <td><input type="text" name="AccountNum2" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">SortCode:</td>
                <td><input type="text" name="SortCode2" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">BankDuration:</td>
                <td><input type="text" name="BankDuration2" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">CCDebitCard:</td>
                <td><input type="text" name="CCDebitCard" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">ElectoralRoll:</td>
                <td><input type="text" name="ElectoralRoll" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Profession:</td>
                <td><input type="text" name="Profession" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">AnnualWages:</td>
                <td><input type="text" name="AnnualWages" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">PayrollNum:</td>
                <td><input type="text" name="PayrollNum" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">EmpName:</td>
                <td><input type="text" name="EmpName" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">EmpAddress:</td>
                <td><input type="text" name="EmpAddress" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">EmpContName:</td>
                <td><input type="text" name="EmpContName" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">EmpContNumber:</td>
                <td><input type="text" name="EmpContNumber" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">EmpEmail:</td>
                <td><input type="text" name="EmpEmail" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">EmpFinaHist:</td>
                <td><input type="text" name="EmpFinaHist" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">EmpDate:</td>
                <td><input type="text" name="EmpDate" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">EmpDisclaimer:</td>
                <td><input type="text" name="EmpDisclaimer" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right"> </td>
                <td> </td>
              </tr>
            </table></td>
            <td><table align="center">
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Name:</td>
                <td><input type="text" name="name" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Telephone number:</td>
                <td><input type="text" name="telephone_number" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">MobileNumber:</td>
                <td><input type="text" name="mobileNumber" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Email:</td>
                <td><input type="text" name="email" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Address:</td>
                <td><input type="text" name="address" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Dateday:</td>
                <td><input type="text" name="dateday" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Datemonth:</td>
                <td><input type="text" name="datemonth" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Dateyear:</td>
                <td><input type="text" name="dateyear" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Terms:</td>
                <td><input type="text" name="terms" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right"> </td>
                <td><input type="submit" value="Insert record" /></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        </tr>
    </table>
    </form>
    <p> </p>
    <p> </p>
    </form>
    <p> </p>
    </body>
    </html>
    <?php
    mysql_free_result($rsApplyNow);
    ?>

    basically it isnt coming up with an error code just not sending the information across and not redirecting to the next page
    here is the full code for the temp for i am working on.
    <?php require_once('Connections/nameprop.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"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO name_tenant (Title, `First Names`, Surname, DOB, DOBMonth, DOBYear, Nationality, Marital_Status, DayNumber, EvenNumber, MobNumber, Smoker, CurrentAdd, Status, PreviousAdd, Student, FinancialCCj, FinancialArrears, FinancialBankR, FinancialNone, BankName, AccountNum, SortCode, BankDuration, DebitCCCard, Electoral, `next of kin`, prop_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['Title'], "text"),
                           GetSQLValueString($_POST['First_Names'], "text"),
                           GetSQLValueString($_POST['Surname'], "text"),
                           GetSQLValueString($_POST['DOB'], "text"),
                           GetSQLValueString($_POST['DOBMonth'], "text"),
                           GetSQLValueString($_POST['DOBYear'], "text"),
                           GetSQLValueString($_POST['Nationality'], "text"),
                           GetSQLValueString($_POST['Marital_Status'], "text"),
                           GetSQLValueString($_POST['DayNumber'], "double"),
                           GetSQLValueString($_POST['EvenNumber'], "double"),
                           GetSQLValueString($_POST['MobNumber'], "double"),
                           GetSQLValueString($_POST['Smoker'], "text"),
                           GetSQLValueString($_POST['CurrentAdd'], "text"),
                           GetSQLValueString($_POST['Status'], "text"),
                           GetSQLValueString($_POST['PreviousAdd'], "text"),
                           GetSQLValueString($_POST['Student'], "text"),
                           GetSQLValueString($_POST['FinancialCCj'], "text"),
                           GetSQLValueString($_POST['FinancialArrears'], "text"),
                           GetSQLValueString($_POST['FinancialBankR'], "text"),
                           GetSQLValueString($_POST['FinancialNone'], "text"),
                           GetSQLValueString($_POST['BankName'], "text"),
                           GetSQLValueString($_POST['AccountNum'], "double"),
                           GetSQLValueString($_POST['SortCode'], "double"),
                           GetSQLValueString($_POST['BankDuration'], "text"),
                           GetSQLValueString($_POST['DebitCCCard'], "text"),
                           GetSQLValueString($_POST['Electoral'], "text"),
                           GetSQLValueString($_POST['next_of_kin'], "text"),
                           GetSQLValueString($_POST['prop_id'], "text"));
      mysql_select_db($database_nameprop, $nameprop);
      $Result1 = mysql_query($insertSQL, $nameprop) or die(mysql_error());
    mysql_select_db($database_nameprop, $nameprop);
    $query_rsApplyNow = "SELECT * FROM name_editprop";
    $rsApplyNow = mysql_query($query_rsApplyNow, $nameprop) or die(mysql_error());
    $row_rsApplyNow = mysql_fetch_assoc($rsApplyNow);
    $totalRows_rsApplyNow = mysql_num_rows($rsApplyNow);
    ?>
    <!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>Untitled Document</title>
    <script type="text/javascript">
    function loadFields(theValue) {
             var props = theValue.split("|");
              var prop_id = props[0];
              var propAdd = props[1] ;
              var propPrice = props[2];
                          var town = props[3]
                          var postcode = props[4]
              document.getElementById('prop_id').value=prop_id;
              document.getElementById('Add1').value=propAdd;
                          document.getElementById('town').value=town;
                          document.getElementById('postcode').value=postcode;
              document.getElementById('RentalPrice').value='£' + propPrice +'/ per month';
    </script>
    </head>
    <body>
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
    <!-- Place the following code where you want to show the result of the property selection --><table width="100%" border="0" cellpadding="0">
      <tr>
        <td width="23%"><!-- the following code is just copied from your code -->
          <select name="Select Property" id="Select Property" onchange="loadFields(this.value)">
            <option value="select your property">select your property</option>
            <?php
    do {
    ?>
            <option value="<?php echo $row_rsApplyNow['prop_id'] . '|' . $row_rsApplyNow['prop_add1'] . '|' . $row_rsApplyNow['rental_price'] . '|' . $row_rsApplyNow['town'] . '|' . $row_rsApplyNow['postcode'];?>"><?php echo $row_rsApplyNow['prop_id'] . " , " . $row_rsApplyNow['prop_add1']; ?></option>
            <?php
    } while ($row_rsApplyNow = mysql_fetch_assoc($rsApplyNow));
      $rows = mysql_num_rows($rsApplyNow);
      if($rows > 0) {
          mysql_data_seek($rsApplyNow, 0);
                $row_rsApplyNow = mysql_fetch_assoc($rsApplyNow);
    ?>
          </select></td>
        <td width="77%"> </td>
      </tr>
      <tr>
        <td>Property ID:</td>
        <td><input type="text" name="prop_id" id="prop_id" readonly="readonly" /></td>
      </tr>
      <tr>
        <td>Address</td>
        <td><input type="text" name="Add1" id="Add1" readonly="readonly" /></td>
      </tr>
      <tr>
        <td>Town</td>
        <td><input type="text" name="town" id="town" readonly="readonly" /></td>
      </tr>
      <tr>
        <td>Postcode</td>
        <td><label for="postcode"></label>
          <input type="text" name="postcode" id="postcode" readonly="readonly" /></td>
      </tr>
      <tr>
        <td>Rent</td>
        <td><input type="text" name="RentalPrice" id="RentalPrice" readonly="readonly" /></td>
      </tr>
      <tr>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td colspan="2"><table width="100%" border="0" cellpadding="0">
          <tr>
            <td width="29%"><table align="center">
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Title:</td>
                <td><input type="text" name="Title" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">First Names:</td>
                <td><input type="text" name="First_Names" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Surname:</td>
                <td><input type="text" name="Surname" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DOB:</td>
                <td><input type="text" name="DOB" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DOBMonth:</td>
                <td><input type="text" name="DOBMonth" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DOBYear:</td>
                <td><input type="text" name="DOBYear" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Nationality:</td>
                <td><input type="text" name="Nationality" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Marital_Status:</td>
                <td><input type="text" name="Marital_Status" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DayNumber:</td>
                <td><input type="text" name="DayNumber" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">EvenNumber:</td>
                <td><input type="text" name="EvenNumber" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">MobNumber:</td>
                <td><input type="text" name="MobNumber" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Smoker:</td>
                <td><input type="text" name="Smoker" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">CurrentAdd:</td>
                <td><input type="text" name="CurrentAdd" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Status:</td>
                <td><input type="text" name="Status" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">PreviousAdd:</td>
                <td><input type="text" name="PreviousAdd" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Student:</td>
                <td><input type="text" name="Student" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">FinancialCCj:</td>
                <td><input type="text" name="FinancialCCj" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">FinancialArrears:</td>
                <td><input type="text" name="FinancialArrears" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">FinancialBankR:</td>
                <td><input type="text" name="FinancialBankR" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">FinancialNone:</td>
                <td><input type="text" name="FinancialNone" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">BankName:</td>
                <td><input type="text" name="BankName" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">AccountNum:</td>
                <td><input type="text" name="AccountNum" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">SortCode:</td>
                <td><input type="text" name="SortCode" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">BankDuration:</td>
                <td><input type="text" name="BankDuration" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">DebitCCCard:</td>
                <td><input type="text" name="DebitCCCard" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Electoral:</td>
                <td><input type="text" name="Electoral" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Next of kin:</td>
                <td><input type="text" name="next_of_kin" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right"> </td>
                <td><input type="submit" value="Insert record" /></td>
              </tr>
            </table></td>
            <td width="68%"> </td>
            <td width="3%"> </td>
          </tr>
          <tr>
            <td> </td>
            <td> </td>
            <td> </td>
          </tr>
        </table></td>
        </tr>
    </table>
    </form>
    <input type="hidden" name="MM_insert" value="form1" />
    </form>
    <p> </p>
    </body>
    </html>
    <?php
    mysql_free_result($rsApplyNow);
    ?>

  • How to get the data from one table and insert into another table

    Hi,
    We have requirement to build OA page with the data needs to be populated from one table and on save data into another table.
    For the above requirement what the best way to implement in OAF.
    I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
    Thanks

    You can achieve this in many different ways, one is
    1. Create another VO based on the EO which is based on the dest table.
    2. At save, copy the contents of the source VO into the dest VO (see copy routine in dev guide).
    3. commiting the transaction will push the data into the dest table on which the dest VO is based.
    I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
    if by table you mean a DB table, then no, you can have a VO based on multiple EOs which will do DMLs accordingly.Thanks
    Tapash

  • How to read LONG RAW data from one  table and insert into another table

    Hello EVERYBODY
    I have a table called sound with the following attributes. in the music attribute i have stored some messages in the different language like hindi, english etc. i want to concatinate all hindi messages and store in the another table with only one attribute of type LONG RAW.and this attribute is attached with the sound item.
    when i click the play button of sound item the all the messages recorded in hindi will play one by one automatically. for that i'm doing the following.
    i have written the following when button pressed trigger which will concatinate all the messages of any selected language from the sound table, and store in another table called temp.
    and then sound will be played from the temp table.
    declare
         tmp sound.music%type;
         temp1 sound.music%type;
         item_id ITEM;
    cursor c1
    is select music
    from sound
    where lang=:LIST10;
    begin
         open c1;
         loop
              fetch c1 into tmp; //THIS LINE GENERATES THE ERROR
              temp1:=temp1||tmp;
              exit when c1%notfound;
         end loop;
    CLOSE C1;
    insert into temp values(temp1);
    item_id:=Find_Item('Music');
    go_item('music');
    play_sound(item_id);
    end;
    but when i'm clicking the button it generates the following error.
    WHEN-BUTTON-PRESSED TRIGGER RAISED UNHANDLED EXCEPTION ORA-06502.
    ORA-06502: PL/SQL: numeric or value error
    SQL> desc sound;
    Name Null? Type
    SL_NO NUMBER(2)
    MUSIC LONG RAW
    LANG CHAR(10)
    IF MY PROCESS TO SOLVE THE ABOVE PROBLEM IS OK THEN PLESE TELL ME THE SOLUTION FOR THE ERROR. OTHER WISE PLEASE SUGGEST ME,IF ANY OTHER WAY IS THERE TO SOLVE THE ABOVE PROBLEM.
    THANKS IN ADVANCE.
    D. Prasad

    You can achieve this in many different ways, one is
    1. Create another VO based on the EO which is based on the dest table.
    2. At save, copy the contents of the source VO into the dest VO (see copy routine in dev guide).
    3. commiting the transaction will push the data into the dest table on which the dest VO is based.
    I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
    if by table you mean a DB table, then no, you can have a VO based on multiple EOs which will do DMLs accordingly.Thanks
    Tapash

  • Fetch data from one table and insert into two tables in desired format

    I have similar to the following data in a table and it is not normalized. The groupID is being used to group two records of similar nature.
    DECLARE @OldDoc TABLE (oldDocID INT, groupID INT, deptID INT)
    INSERT INTO @OldDoc (oldDocID, groupID) VALUES (1, NULL, 111),(2,NULL,111),(3,1,111),(4,NULL,333),(5,1,222),(6,NULL,333),(7,2,222),(8,2,333),(9,NULL,111),(10,3,222),(11,NULL,333),(12,3,444)
    I need to process the data from the above table (@OldDoc) and write into two new tables (@NewDoc and @NewDocGroup) as follows.
    oldDocID should be stored as newDocID when inserting to @NewDoc table. Only records with groupID NULL and one record (first one) per group should be considered (For example, oldDocID 5 is not considered as 3 and 5 belong to the same groupID 1) for insertion. 
    DECLARE @NewDoc TABLE (newDocID INT)
    INSERT INTO @NewDoc (newDocID) VALUES (1),(2),(3),(4),(6),(7),(9),(10),(11)
    All records from @OldDoc should be considered for insertion into @NewDocGroup table. OldDocID is inserted as NewDocID and deptID is as-is. Instead of groupID, the ID of the first record in the 
    group should be considered as parentNewDocID (For example, 3 is considered as parentNewDocID for newDocID 5 as 3 and 5 belong to the same groupID in @OldDoc table) for the newDocID.
    DECLARE @NewDocGroup (newDocID INT, parentNewDocID INT, deptID INT)
    INSERT INTO @NewDocGroup (newDocID, parentNewDocID, deptID) VALUES (1,1,111),(2,2,111),(3,3,111),(4,4,333),(5,3,222),(6,6,333),(7,7,222),(8,7,333),(9,9,111),(10,10,222),(11,11,333),(12,10,444)
    How do I accomplish the above using SQL ? Thanks for the help.

    >> I have similar to the following data in a table and it is not normalized. The group_id is being used to group two records [sic] of similar nature. <<
    Rows are not records. Tables have to have a key by definition. You do not do math with identifiers, so they should not be numeric. Let's ignore that error for now. In short, you are posting garbage. If you had followed Forum Netiquette, would you have posted
    this? 
    CREATE TABLE Old_Documents
    (old_doc_id INTEGER NOT NULL PRIMARY KEY, 
     group_id INTEGER, 
     dept_nbr INTEGER NOT NULL
       REFERENCES Departments (dept_nbr));
    INSERT INTO Old_Documents(old_doc_id, group_id, dept_nbr) 
    VALUES  (1, NULL, 111), 
    (2, NULL, 111), 
    (3, 1, 111), 
    (4, NULL, 333), 
    (5, 1, 222), 
    (6, NULL, 333), 
    (7, 2, 222), 
    (8, 2, 333), 
    (9, NULL, 111), 
    (10, 3, 222), 
    (11, NULL, 333), 
    (12, 3, 444);
    >> I need to process the data from the above table (Old_Documents) and write into two new tables (New_Documents and New_Documents_Groups) as follows. <<
    Just like punch cards and mag tape data processing! Being old and being new are a status, not another kind of entity. But that is how mag tapes work. And you even use the verb "fetch" from tape files. This design flaw is called  attribute splitting.
    Do you have a Male_Personnel and Female_Personnel table? NO! It is just Personnel! 
    >> old_doc_id should be stored as new_doc_id when inserting to New_Documents table. Only records [sic] with group_id NULL and one record [sic] (first [sic; no ordering in a table] one) per group should be considered (For example, old_doc_id 5 is not considered
    as 3 and 5 belong to the same group_id =1) for insertion. <<
    Think about your punch card mindset. Why did you physically materialize that redundant New_Documents table? Let me answer that: this is how you work with punch cards! In SQL we use a VIEW:
    CREATE VIEW New_Documents (new_doc_id)
    AS 
    SELECT old_doc_id 
      FROM Old_Documents;
    >> All records [sic] from Old_Documents should be considered for insertion into New_Documents_Groups table. The old_doc_id is inserted as new_doc_id and dept_nbr is as-is. Instead of group_id, the ID [sic: which identifier??] of the first [sic: tables
    have no ordering like a deck of punch cards] record [sic] in the group should be considered as parent_new_doc_id (For example, 3 is considered as parent_new_doc_id for new_doc_id 5 as 3 and 5 belong to the same group_id in Old_Documents table) for the new_doc_id.
    <<
    Why not use 5 as the parent? My guess is that you are trying to form equivalence classes. See:
    https://www.simple-talk.com/content/print.aspx?article=2020
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Fetch data from two tables and insert into one table

    I have similar to the following data in two tables (@Plant, @PlantDirector) and need to consolidate into one table (@PlantNew) as follows.
    DECLARE @Plant TABLE (PlantID INT, PlantName VARCHAR(100))
    INSERT INTO @Plant (PlantID, PlantName) VALUES (1, 'Name One'),(2, 'Name Two'),(3, 'Name Three'),(4, 'Name Four'),(5, 'Name Five'),(6, 'Name Six')
    Director data for the Plants exist in the following table. Assistant value 1 means Assistant Director and 0 means Director. 
    Data exists only for subset of plants and a Plant may have one or both roles.
    DECLARE @PlantDirector TABLE (PlantID INT, PlantDirectorID INT, Assistant bit)
    INSERT INTO @PlantDirector (PlantID, PlantDirectorID, Assistant) VALUES (2, 111, 1),(2, 222, 0),(4, 333, 0),(6,444,1)
    The above data needs to be inserted into one table (@PlantNew) as follows: 
    PlantID in @Plant table is IDENTITY value and needs to be inserted as-is into this table.
    PlantDirExists will get a value of 1 if at least one record exists in @PlantDirector table for a PlantID. PlantAssistantDirID and PlantDirID should be set to the corresponding PlantDirID or NULL appropriately depending on the data.
    DECLARE @PlantNew TABLE (PlantID INT, PlantName VARCHAR(100), PlantDirExists bit, PlantAssistantDirID INT, PlantDirID INT)
    INSERT INTO @PlantNew (PlantID, PlantName, PlantDirExists, PlantAssistantDirID, PlantDirID)
    VALUES (1, 'Name One', 0, NULL, NULL),(2, 'Name Two', 1, 111, 222),(3, 'Name Three', 0, NULL, NULL),(4, 'Name Four', 1, NULL, 333),(5, 'Name Five', 0, NULL, NULL),(6, 'Name Six',1, 444, NULL)
    How do I achieve the above using SQL ? Thanks.

    like this
    INSERT @PlantNew  (PlantID, PlantName, PlantDirExists, PlantAssistantDirID, PlantDirID) 
    SELECT p.PlantID,
    p.PlantName,
    CASE WHEN pd.PlantID IS NULL THEN 0 ELSE 1 END,
    PlantAssistantDirID,
    PlantDirID
    FROM @Plant p
    LEFT JOIN (SELECT PlantID,
    MAX(CASE WHEN Assistant = 1 THEN PlantDirectorID END) AS PlantAssistantDirID,
    MAX(CASE WHEN Assistant = 0 THEN PlantDirectorID END) AS PlantDirID
    @PlantDirector
    GROUP BY PlantID)pd
    ON pd.PlantID = p.PlantID
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    You're missing a FROM
    insert into @PlantNew
    SELECT p.PlantID,
    p.PlantName,
    CASE WHEN pd.PlantID IS NULL THEN 0 ELSE 1 END,
    PlantAssistantDirID,
    PlantDirID
    FROM @Plant p
    LEFT JOIN (SELECT PlantID,
    MAX(CASE WHEN Assistant = 1 THEN PlantDirectorID END) AS PlantAssistantDirID,
    MAX(CASE WHEN Assistant = 0 THEN PlantDirectorID END) AS PlantDirID
    from @PlantDirector
    GROUP BY PlantID)pd
    ON pd.PlantID = p.PlantID

  • Read table context data into Internal table

    Hi All,
    I created a table and filled it with values and bind it to output.
    i have a field in ouput when i change the value in the output i need to change the values in my table.
    how to get the entie table(table context node ) into my method.
    is it possible to get the output table data when "On action " event is triggered.

    Hello.
    I guess you want to do that with Web Dynpro.
    So you need a function which is called, when your click-event is triggered.
    And within your function you need something like that:
    DATA lo_node_of_table TYPE REF TO if_wd_context_node.
    DATA lo_some_other_node TYPE REF TO if_wd_context_node.
    DATA lo_element TYPE REF TO if_wd_context_element.
    DATA ld_counter TYPE i.
    DATA ld_value TYPE i.
    DATA ld_sum TYPE i.
    lo_node_of_table = wd_context->path_get_node( path = `PATH_TO.CONTEXT_NODE` ).
    ld_counter = lo_node_of_table->get_element_count( ).
      DO ld_counter TIMES.
        lo_element = lo_nd_in->get_element( index = sy-index ).
        lo_element->get_attribute(
          EXPORTING name = 'FIELD_NAME'
            IMPORTING value = ld_value ).
        ld_sum = ld_sum + ld_value.
      ENDDO.
    lo_some_other_node->set_attribute( name = 'SUM_OF_SOMETHING' value = ld_sum ).
    Please reply if you meant something else.
    Regards
    Thomas

  • Read data from E$ table and insert into staging table

    Hi all,
    I am a new to ODI. I want your help in understanding how to read data from an "E$" table and insert into a staging table.
    Scenario:
    Two columns in a flat file, employee id and employee name, needs to be loaded into a datastore EMP+. A check constraint is added to allow data with employee names in upper case only to be loaded into the datastore. Check control is set to flow and static. Right click on the datastore, select control and then check. The rows that have violated the check constraint are kept in E$_EMP+ table.
    Problem:
    Issue is that I want to read the data from the E$_EMP+ table and transform the employee name into uppercase and move the corrected data from E$_EMP+ into EMP+. Please advise me on how to automatically handle "soft" exceptions in ODI.
    Thank you

    Hi Himanshu,
    I have tried the approach you suggested already. That works. However, the scenario I described was very basic. Based on the error logged into the E$_EMP table, I will have to design the interface to apply more business logic before the data is actually merged into the target table.
    Before the business logic is applied, I need to read each row from the E$EMP table first and I do not know how to read from E$EMP table.

  • Selecting Records from 125 million record table to insert into smaller table

    Oracle 11g
    I have a large table of 125 million records - t3_universe.  This table never gets updated or altered once loaded,  but holds data that we receive from a lead company.
    I need to select records from this large table that fit certain demographic criteria and insert those into a smaller table - T3_Leads -  that will be updated with regard to when the lead is mailed and for other relevant information.
    My question is what is the best (fastest) approach to select records from this 125 million record table to insert into the smaller table.  I have tried a variety of things - views, materialized views, direct insert into smaller table...I think I am probably missing other approaches.
    My current attempt has been to create a View using the query that selects the records as shown below.  Then use a second query that inserts into T3_Leads from this View V_Market.  This is very slow. Can I just use an Insert Into T3_Leads with this query - it did not seem to work with the WITH clause?    My Index on the large table is t3_universe_composite and includes zip_code, address_key, household_key. 
    CREATE VIEW V_Market  as
    WITH got_pairs    AS  
         SELECT /*+ INDEX_FFS(t3_universe t3_universe_composite) */  l.zip_code, l.zip_plus_4, l.p1_givenname, l.surname, l.address, l.city, l.state, l.household_key, l.hh_type as l_hh_type, l.address_key, l.narrowband_income, l.p1_ms, l.p1_gender, l.p1_exact_age, l.p1_personkey, e.hh_type as filler_data, 1.p1_seq_no, l.p2_seq_no 
         ,      ROW_NUMBER () OVER ( PARTITION BY  l.address_key 
                                      ORDER BY      l.hh_verification_date  DESC 
                      ) AS r_num   
         FROM   t3_universe  e   
         JOIN   t3_universe  l  ON   
                l.address_key  = e.address_key
                AND l.zip_code = e.zip_code
              AND   l.p1_gender != e.p1_gender
                 AND   l.household_key != e.household_key         
                 AND  l.hh_verification_date  >= e.hh_verification_date 
      SELECT  * 
      FROM  got_pairs
      where l_hh_type !=1 and l_hh_type !=2 and filler_data != 1 and filler_data != 2 and zip_code in (select * from M_mansfield_02048) and p1_exact_age BETWEEN 25 and 70 and narrowband_income >= '8' and r_num = 1
    Then
    INSERT INTO T3_leads(zip, zip4, firstname, lastname, address, city, state, household_key, hh_type, address_key, income, relationship_status, gender, age, person_key, filler_data, p1_seq_no, p2_seq_no)
    select zip_code, zip_plus_4, p1_givenname, surname, address, city, state, household_key, l_hh_type, address_key, narrowband_income, p1_ms, p1_gender, p1_exact_age, p1_personkey, filler_data, p1_seq_no, p2_seq_no
    from V_Market;

    I had no trouble creating the view exactly as you posted it.  However, be careful here:
    and zip_code in (select * from M_mansfield_02048)
    You should name the column explicitly rather than select *.  (do you really have separate tables for different zip codes?)
    About the performance, it's hard to tell because you haven't posted anything we can use, like explain plans or traces but simply encapsulating your query into a view is not likely to make it any faster.
    Depending on the size of the subset of rows you're selecting, the /*+ INDEX hint may be doing your more harm than good.

  • Build a sql query fro different table and insert into a table

    Hi I have a requirement ,
    i have some table 1 table which holds rules which rules i have to apply on the sql query
    2 table will hold table name and column name and transformation
    with these help of 2 tables i want to build a sql quey and the sql query need to be insert into another  table.

    Hi Karthick,
    I am not going to build Dynamic Data Model.
    i already have table 1 contains rules let's say COUNT,
    and another table contain source table name , column name , Target table name, Source Table name like that
    so with the help of these 2 tables i want to build Sql query and going to insert into 3rd table.

Maybe you are looking for

  • DB Link is not Active

    Hi DBAs, I have 2 DBs in 2 different servers and trying to create DB link from dbA(serverA) to dbB(serverB). I've created the DB link using OEM in dbA but when test the link I'm prompted with "The Database Link is not Active". I've disabled the "NAME

  • Extra margins when printing double sided

    I'm using Word 2007 and have created recipe cards using a basic recipe templete in Word. I have the top margin set to .25 and I'm printing on a regular 8x11 piece of card stock (I want to simply cut the sides and bottom down to make a 4x6 index card)

  • Generating using the entity name

    My earlier post would not have made make any sense as the entity names got interpreted! I'll try leaving out the & from the entity names this time. My xsl was: <xsl:template match="ROW"> <xsl:value-of select="COLUMN_NAME"/>: lt;INPUT NAME="<xsl:value

  • Minimize WLW build time?

    Hi! Is it possible to get Workshop only to build elements that actually has changed on the file system? In regular ant you typically achieve this by using the timestamp mechanisms. This would greatly decrease the build time, and thereby increase the

  • Replaced HD and now I can't get authorization for purchased songs

    I've had to erase & install 2x in the last year and then about a month ago, my HD finally crashed and burned. Today I tried to play a song I purchased prior to the crash (and backed up on a separate drive) and I'm being told the song is not authorize