Connecting multiple tables

I am trying to figure out the most efficient way to display data from multiple tables. Currently I have it set up all in one table as follow:
SELECT title, merchant, image, price, description, link_product,  shipping_info, tax_info, other_info, deal_expire, list_price, category_items, buying_instruction,DATE_FORMAT(date_created, '%m/%d/%Y %l:%i %p') AS 'date_created',DATE_FORMAT(date_created,'%W %M %d %Y') AS 'date_only'
FROM mylist
WHERE date_created > SUBDATE(NOW(), 3)
ORDER BY date_created DESC
I manually input all the value from mechant’s database. What I would like to do is somehow connect above table with merchant’s data table such that I can just put merchant’s name and product sku # and it will fill up above table with relevant information. Thanks

Thank you so much for reply. I am not sure JOIN will work as the table merchant is different for each merchant. my main table is mylist and other tables are the table from merchants . From what little I know I think here are my options.
1. I have created a form that I use to insert data. If I could add IF ELSE statement such that once i put the sku # and merchant_name It autofills rest of the field with the data from the merchant's table. This is what i Prefer but I don't have enough knowledge to insert php code for this.Here is the code for the form I have. Please note that I have not created field for SKU# or product id yet
<?php require_once('Connections/shoppingsite.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;   
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  return $theValue;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO mylist (title, merchant, image, link_product, price, list_price, other_info, price_price, dollar_sign, click_here, listprice_text, dealexpire_text, added_text, to_shop, price_note, description, shipping_info, tax_info, deal_expire, category_items, buying_instruction) VALUES (%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['merchant'], "text"),
                       GetSQLValueString($_POST['image'], "text"),
                       GetSQLValueString($_POST['link_product'], "text"),
                       GetSQLValueString($_POST['price'], "double"),
                       GetSQLValueString($_POST['list_price'], "text"),
                       GetSQLValueString($_POST['other_info'], "text"),
                       GetSQLValueString($_POST['price_price'], "text"),
                       GetSQLValueString($_POST['dollar_sign'], "text"),
                       GetSQLValueString($_POST['click_here'], "text"),
                       GetSQLValueString($_POST['listprice_text'], "text"),
                       GetSQLValueString($_POST['dealexpire_text'], "text"),
                       GetSQLValueString($_POST['added_text'], "text"),
                       GetSQLValueString($_POST['to_shop'], "text"),
                       GetSQLValueString($_POST['price_note'], "text"),
                       GetSQLValueString($_POST['description'], "text"),
                       GetSQLValueString($_POST['shipping_info'], "text"),
                       GetSQLValueString($_POST['tax_info'], "text"),
                       GetSQLValueString($_POST['deal_expire'], "text"),
                       GetSQLValueString($_POST['category_items'], "text"),
                       GetSQLValueString($_POST['buying_instruction'], "text"));
  mysql_select_db($database_shoppingsite, $shoppingsite);
  $Result1 = mysql_query($insertSQL, $shoppingsite) or die(mysql_error());
  $insertGoTo = "insert-data1.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  header(sprintf("Location: %s", $insertGoTo));
mysql_select_db($database_shoppingsite, $shoppingsite);
$query_datainsert = "SELECT title, merchant, image, price, price_price, dollar_sign, click_here, listprice_text, dealexpire_text, added_text, to_shop, price_note, description, link_product, shipping_info, tax_info, other_info, deal_expire, list_price, category_items, buying_instruction,DATE_FORMAT(date_created, '%m/%d/%Y %l:%i %p') AS 'date_created',DATE_FORMAT(date_created,'%W %M %d %Y') AS 'date_only' FROM mylist";
$datainsert = mysql_query($query_datainsert, $shoppingsite) or die(mysql_error());
$row_datainsert = mysql_fetch_assoc($datainsert);
$totalRows_datainsert = mysql_num_rows($datainsert);
?><!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=iso-8859-1" />
<title>datainsert-restricted page</title>
</head>
<body>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
  <table align="center">
    <tr valign="baseline">
      <td nowrap align="right">Title:</td>
      <td><input type="text" name="title" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Merchant:</td>
      <td><input type="text" name="merchant" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Image:</td>
      <td><input type="text" name="image" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Link_product:</td>
      <td><input type="text" name="link_product" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Price:</td>
      <td><input type="text" name="price" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">List_price:</td>
      <td><input type="text" name="list_price" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Other_info:</td>
      <td><input type="text" name="other_info" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Price_price:</td>
      <td><input type="text" name="price_price" value="price" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Dollar_sign:</td>
      <td><input type="text" name="dollar_sign" value="$" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Click_here:</td>
      <td><input type="text" name="click_here" value="Click here" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Listprice_text:</td>
      <td><input type="text" name="listprice_text" value="List price : $" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Dealexpire_text:</td>
      <td><input type="text" name="dealexpire_text" value="Deal expire :" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Added_text:</td>
      <td><input type="text" name="added_text" value="Added :" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">To_shop:</td>
      <td><input type="text" name="to_shop" value="to shop for this deal" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Price_note:</td>
      <td><input type="text" name="price_note" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right" valign="top">Description:</td>
      <td><textarea name="description" cols="50" rows="5"></textarea>
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Shipping_info:</td>
      <td><input type="text" name="shipping_info" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Tax_info:</td>
      <td><input type="text" name="tax_info" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Deal_expire:</td>
      <td><input type="text" name="deal_expire" value="Limited time" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Category_items:</td>
      <td><input type="text" name="category_items" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Buying_instruction:</td>
      <td><input type="text" name="buying_instruction" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right"> </td>
      <td><input type="submit" value="Insert record"></td>
    </tr>
  </table>
  <input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</body>
</html>
<?php
mysql_free_result($datainsert);
?>
2. Other option will be copy all of ther merchant's data in one table and than join that table with table mylist . I don't prefer this because the database with all the data from merchat will be too large
Thanks

Similar Messages

  • Simultaneously Connecting Multiple Tables of the same Database to Textboxes of the same Form using a single ADO Control Code using VB6 Enterprise Edition and MS Access 2007

    Iv 10 Tables consisting of atleast 10 fields each in a single Database. Bt, Im only able to connect 1 table at a time to a form using an ADO Control. Im able to add data from table 'student' to text-boxes in my form. Bt, hw can I add data from field(0) of
    Table 'Student' to Textbox1 and data from field(0) of Table 'Marks' to Textbox2 using VB6??
    This is the current sample coding iv got to connect a single table to a form:
    Global con As New ADODB.Connection
    Global rs As New ADODB.Recordset
    Public Function Connect()
    If con.State = 1 Then con.Close
    con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\bca.mdb;Persist Security Info=False"
    End Function
    Private Sub Add_Click()
    If rs.State = 1 Then rs.Close
    rs.Open "select * from student", con, adOpenDynamic, adLockOptimistic
    rs.AddNew
    rs.Fields(0) = (Text1.Text)
    rs.Fields(1) = (Text2.Text)
    rs.Fields(2) = (Text13.Text)
    rs.Fields(3) = (Text4.Text)
    rs.Fields(4) = (Text5.Text)
    rs.Fields(5) = (Text6.Text)
    rs.Fields(6) = (Text7.Text)
    rs.Fields(7) = (Text8.Text)
    rs.Fields(8) = (Text9.Text)
    rs.Fields(9) = (Text10.Text)
    rs.Fields(10) = (Text11.Text)
    rs.Update
    MsgBox " Record Added"
    End Sub
    What can I do to add fields from 2 different tables to different text boxes within the same form using a single ado control using vb6 and MS Access 2007??

    Hi,
    Since VB6 product is not supported in this forum, you may go to these forums for support:
    #Where to post your VB 6 questions
    http://social.msdn.microsoft.com/Forums/en-US/6a0719fe-14af-47f7-9f51-a8ea2b9c8d6b/where-to-post-your-vb-6-questions
    Thank you for your understanding.
    Best regards,
    Franklin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • "Failed to open the connection" problem related to multiple tables in the report?

    Post Author: Gadow
    CA Forum: Data Connectivity and SQL
    System specifics:
    Web environment using ASP.Net 2.0 (from Visual Studio 2005 Professional)
    Crystal Reports 2008, v. 12.0.0.549, Full
    We have set up the following method for displaying reports via our website:
    User is sent to a report-specific page. The user is given some filtering options specific to the report that will be viewed. When the user has specified the data filters, the user clicks a button.
    The page wraps up the report parameters -- selection query, formula values, report location, the name to be displayed, etc. -- into a class which gets put into the Session object.
    The page redirects to DisplayReport.aspx. ALL reports redirect to this page.
    DisplayReport.aspx retrieves the report parameters from Session. A ReportDocument object is created and loaded, then set with the data from the parameters class.
    A ConnectionInfo object is created and set with the relevant log on credentials. All of the reports draw from the same database, so the connection information is hard-coded as the same for all reports. The page then iterates through all of the tables in the Database.Tables collection of the ReportDocument and calls ApplyLogOnInfo to each table using the ConnectionInfo object.
    The page is rendered and the user gets the filtered report.
    We currently have seven reports. Five reports work fine and display the correctly filtered data with no error messages. Two reports generate a Failed to open the connection error and do not display. I have verified that the queries being sent to DisplayReport.aspx are valid, and as I said the connection information itself is hard-coded in the one page that displays the reports and this is identical to all reports.
    The five reports that do work all have a single data table, either an actual database table or a single view. The two reports that do not work all have multiple tables. As far as I can tell, this is the only difference between the sets; all seven reports are based on the same DSN and I have verified the database on all of the reports. All of the reports were written using Crystal Reports 8, and all of the reports display fine in a Windows app I wrote some years ago using Crystal Reports 8. Again, the only difference between those reports that do work and those that do not is the number of tables used in the report: one table or view in the reports that display, more than one table (tables only, none use views) in the reports that do not display.
    As for the code I am using, below are the relevant methods. The function MakeConnectionInfo simply parses out the components of a standard SQL connection string into a ConnectionInfo object. DisplayedReport is the ID of the CrystalReportViewer on the page.Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim o As Object = Session("ReportParams")
            Dim ReportURL As String = ""
            'Verify that there is a ReportParameters object
            If o Is Nothing OrElse o.GetType IsNot GetType(ReportParameters) Then 'Redirect to the error page
                Response.Redirect("/errors/MissingReport.aspx")
            End If
            ReportParams = CType(o, ReportParameters)
            'Verify that the report exists
            ReportURL = "/Reports/ReportFiles/" + ReportParams.ReportName
            ReportPath = Server.MapPath(ReportURL)
            If Not File.Exists(ReportPath) Then
                Response.Redirect("/errors/MissingReport.aspx?Report=" + ReportParams.ReportTitle)
            End If
            InitializeReport()       
        End Sub
        Protected Sub InitializeReport()
            Dim RD As New ReportDocument
            Dim CI As ConnectionInfo = MakeConnectionInfo(DB_Bonus)
            Dim RPF As CrystalDecisions.Shared.ParameterField = Nothing
            RD.Load(ReportPath)
            If ReportParams.SelectString <> "" Then
                Dim Adapt As New SqlDataAdapter(ReportParams.SelectString, DB_Bonus)
                Dim DS As New Data.DataSet
                Adapt.Fill(DS)
                RD.SetDataSource(DS.Tables(0))
            End If
            For Each kvp As KeyValuePair(Of String, String) In ReportParams.Formulas
                Dim FFD As FormulaFieldDefinition = Nothing
                Try
                    FFD = RD.DataDefinition.FormulaFields(kvp.Key)
                Catch ex As Exception
                    'Do nothing
                End Try
                If FFD IsNot Nothing Then
                    Select Case FFD.ValueType
                        Case FieldValueType.DateField, FieldValueType.DateTimeField
                            If IsDate(kvp.Value) Then
                                FFD.Text = String.Format("Date()", Convert.ToDateTime(kvp.Value).ToString("yyyy, MM, dd"))
                            Else
                                FFD.Text = "Date(1960, 01, 01)"
                            End If
                        Case FieldValueType.StringField
                            FFD.Text = String.Format("""""", kvp.Value)
                        Case Else
                            'For now, treat these as if they were strings. If things blow up here,
                            'we will need to add the appropriate formatting for the field type.
                            FFD.Text = String.Format("""""", kvp.Value)
                    End Select
                End If
            Next
            For Each T As CrystalDecisions.CrystalReports.Engine.Table In RD.Database.Tables
                Dim TLI As TableLogOnInfo = T.LogOnInfo
                TLI.ConnectionInfo = CI
                T.ApplyLogOnInfo(TLI)
            Next
            DisplayedReport.ReportSource = RD
        End Sub
    Does this approach not work with reports containing multiple tables, or is there something I'm missing? Any meaningful suggestions would be much appreciated.

    Dear Dixit,
    Please refer to the Crystal report landing page to get the details
    information about the support for crystal report issues.
    Please use the following thread to post your questions related to
    crystal report.
    SAP Business One and Crystal Reports
    Regards,
    Rakesh Pati
    SAP Business One Forum Team.

  • Crystal Reports and connecting to multiple tables in a dataset - I'm Going Crazy!!

    This is my first application, first report and first everything.  Wouldn't you know the report I am trying to produce is probably more difficult!!  What is happening is that I have a form(screen) up in my application with the information displayed on it from a recrod in a table that I want to put on a report to be view and/or printed and eventually down the road I want to incorporate a signature.  One step at a time though, here is what I have accomplished.  I have created the report, I have gotten it to display in the viewer but it will not push the data from the table that I want displayed.  It only displays the text that I have typed on the form.  This is a Visual Basic application created in Visual Studio 2005 using a SQL database.  If you need more information then just ask and I will try to fumble through and tell you what I know.  (Oh and to top it off............I am also trying to get information to display from other tables also (codes connected to descriptions etc.))
    Any help would be really appreciated as I have went through tutorials, read white papers, tech notes and anything else I can find but I just can't get it to work!!
    Thanks!

    You do need to give more information. To better help, we would need to know the database, when you say SQL do you mean SQL Server, how you created the dataset, whether there are multiple tables in a single dataset or multiple datasets, etc.
    The report appears to be running so the underlying issue as you know will likely be the dataset. You may want to confirm the dataset does in fact have data in it.  Returning a simple count will let you know there are rows. If you used the components rather than code to create the objects you can also see the data returned in the fill process.
    Once you know you have data in the dataset, you can check your reports connection to the dataset.
    Just hang in there... the problem is probably a simple fix. I am sure others will follow on with more suggestions.
    Regards,
    John W.

  • Reading Multiple Tables with VB

    I'm attempting to retrieve records from multiple tables base on info returned from the previous call.
    This code fails on the second call to " IF RFC_Read_TableTJ.Call = True"
    also if I comment out "IF RFC_Read_TableTJ.Call = True" is creates the next text file with records from the previous table"
    Why is this happening and how do I change tables?
    thanks!
      Dim RFC_ReadTableTJ, TblFields, TblData, TblOptions As Object
       Dim I, J, K, IntCol As Integer
       Dim IntRow, LastRow As Long
       Dim StopTJ As Boolean
       Dim StrTemp, OutLine, OutLine2, TempChar, DelimitFromXL As String
       Dim strExport1, strExport2 As Object
       Dim ObjFileSystemObject As Object
       Dim MATNO(1 To 10) As String
    '   Dim R3 As SAPFunctions
    'Create Server object and Setup the connection
       Set R3 = CreateObject("SAP.Functions")
       R3.Connection.ApplicationServer = SAPServerIP
       R3.Connection.SystemNumber = SAPSystemNo
       R3.Connection.System = SAPSystem
       R3.Connection.client = SAPClient
       R3.Connection.language = SAPLang
       If R3.Connection.Logon(0, False) <> True Then
          Exit Sub
       End If
       Set ObjFileSystemObject = CreateObject("Scripting.FileSystemObject")
       Set TblFields = Nothing
       Set TblData = Nothing
       Set TblOptions = Nothing
    'Call RFC function RFC_READ_TABLE
       Set RFC_Read_TableTJ = R3.Add("RFC_READ_TABLE")
       Set strExport1 = RFC_Read_TableTJ.Exports("QUERY_TABLE")
       Set strExport2 = RFC_Read_TableTJ.Exports("DELIMITER")
       Set TblOptions = RFC_Read_TableTJ.Tables("OPTIONS")
       Set TblData = RFC_Read_TableTJ.Tables("DATA")
       Set TblFields = RFC_Read_TableTJ.Tables("FIELDS")
    'MATERIAL DESCRIPTION***********************************************
    'LOOK UP MATERIAL DESC TO GET MATERIAL NO
       strExport1.Value = "MAKT"
       DelimitFromXL = ","
       strExport2.Value = Chr(165)
    'Criteria
        TblOptions.AppendRow
        TblOptions(1, "TEXT") = "MAKTX LIKE '%A19118N1A%'"
    'Fields to retrieve
        TblFields.AppendRow
        TblFields(1, "FIELDNAME") = "MANDT" 'Client
        TblFields.AppendRow
        TblFields(2, "FIELDNAME") = "MATNR" 'Material Number
        TblFields.AppendRow
        TblFields(3, "FIELDNAME") = "SPRAS" 'Language Key
        TblFields.AppendRow
        TblFields(4, "FIELDNAME") = "MAKTX" 'Material Description
        TblFields.AppendRow
        TblFields(5, "FIELDNAME") = "MAKTG" 'Material description in upper case for matchcodes
    'Call RFC and write output
        If RFC_Read_TableTJ.Call = True Then
            If TblData.RowCount > 0 Then
                'Write output to file
                'MANDT , MATNR, SPRAS, MAKTX, MAKTG
                Set OutFile = ObjFileSystemObject.CreateTextFile("c:\MAKT.txt", True)
                OutFile.WriteLine "MANDT , MATNR, SPRAS, MAKTX, MAKTG" 'Header
                For IntRow = 1 To TblData.RowCount
                    'Replace all instances of the delimeter that occur in the data with a ";"
                    OutLine = ""
                    For K = 1 To Len(TblData(IntRow, "WA"))
                        If Mid(TblData(IntRow, "WA"), K, 1) = DelimitFromXL Then
                            TempChar = ";"
                        Else
                            TempChar = Mid(TblData(IntRow, "WA"), K, 1)
                        End If
                        OutLine = OutLine & TempChar
                    Next K
                        'Put in delimeter
                    OutLine2 = ""
                    For K = 1 To Len(OutLine)
                        If Mid(OutLine, K, 1) = Chr(165) Then
                            TempChar = DelimitFromXL
                        Else
                            TempChar = Mid(OutLine, K, 1)
                        End If
                        OutLine2 = OutLine2 & TempChar
                    Next K
                    'Write to file
                    OutFile.WriteLine OutLine2
                Next
                'MsgBox "Completed Successfully"
            Else
                'MsgBox "No records returned"
            End If
        Else
        '    MsgBox "Error calling SAP RFC_READ_TABLE"
        End If
    ''MAST Material to BOM Link*****************************************

    hi John
    you can create a join of those multiple tables in an internal table
    and then u can view that on this single internal table....
    like:-
    example
    SELECT c~carrname
                  p~connid
                  f~fldate
    INTO CORRESPONDING FIELDS OF TABLE itab
        FROM ( ( scarr AS c INNER JOIN spfli AS p
                      ON pcarrid   = ccarrid
                      AND p~cityfrom = p_cityfr
                      AND p~cityto   = p_cityto )
             INNER JOIN sflight AS f ON fcarrid = pcarrid
                                    AND fconnid = pconnid ).
    LOOP AT itab INTO wa.
      WRITE: / wa-fldate, wa-carrname, wa-connid.
    ENDLOOP.

  • How to generate a query involving multiple tables(one left join others)

    Hi, all,
    I want to query a db like these:
    I need all the demographics information(from table demo) and their acr info(from table acr), and their clinical info(from table clinical), and their lab info(from table lab).
    The db is like this:
    demo->acr: one to many
    demo->clinical info: one to many
    demo->lab info: one to many
    I want to get one query result which are demo left join acr, and demo left join clinical, and demo left join lab. I hope the result is a record including demo info, acr info, clinical info, and lab info.
    How could I do this in SQL?
    Thanks a lot!
    Qian

    Thank you very, very much!
    Actually, I need a huge query to include all the tables in our db.
    We are running a clinical db which collects the patients demographics info, clinical info, lab info, and many other information.
    The Demographics table is a center hub which connects other tables. This is the main architecture.
    My boss needed a huge query to include all the information, so others could find what they need by filtering.
    As you have found, because one patients usually has multiple clinical/lab info sets, so the result will be multiplied! the number of result=n*m*k*...
    My first plan is to set time point criteria to narrow all the records with one study year. If somebody needs to compare them, then I have to show them all.
    So I have to know the SQL to generate a huge query including as many tables as possible.
    I show some details here:
    CREATE TABLE "IMMUNODATA"."DEMOGRAPHICS" (
    "SUBJECTID" INTEGER NOT NULL,
    "WORKID" INTEGER,
    "OMRFHISTORYNUMBER" INTEGER,
    "OTHERID" INTEGER,
    "BARCODE" INTEGER,
    "GENDER" VARCHAR2(1),
    "DOB" DATE,
    "RACEAI" INTEGER,
    "RACECAUCASIAN" INTEGER,
    "RACEAA" INTEGER,
    "RACEASIAN" INTEGER,
    "RACEPAC" INTEGER,
    "RACEHIS" INTEGER,
    "RACEOTHER" VARCHAR2(50),
    "SSN" VARCHAR2(11),
    PRIMARY KEY("SUBJECTID") VALIDATE
    CREATE TABLE "IMMUNODATA"."ACR" (
    "ID" INTEGER NOT NULL,
    "THEDATE" DATE ,
    "SUBJECTID" INTEGER NOT NULL,
    "ACR_PAGENOTCOMPLETED" VARCHAR2(1000) ,
    "ACR_MALARRASHTODAY" INTEGER ,
    "ACR_MALARRASHEVER" INTEGER ,
    "ACR_MALARRSHEARLIESTDATE" DATE ,
    PRIMARY KEY("ID") VALIDATE,
    FOREIGN KEY("SUBJECTID") REFERENCES "IMMUNODATA"."DEMOGRAPHICS" ("SUBJECTID") VALIDATE
    CREATE TABLE "IMMUNODATA"."CLIN" (
    "ID" INTEGER NOT NULL,
    "THEDATE" DATE ,
    "SUBJECTID" INTEGER NOT NULL,
    "CLIN_PAGENOTCOMPLETED" VARCHAR2(1000) ,
    "CLIN_FATIGUE" VARCHAR2(20) ,
    "CLIN_FATIGUEDATE" DATE ,
    "CLIN_FEVER" VARCHAR2(20) ,
    "CLIN_FEVERDATE" DATE ,
    "CLIN_WEIGHTLOSS" VARCHAR2(20) ,
    "CLIN_WEIGHTLOSSDATE" DATE ,
    "CLIN_CARDIOMEGALY" VARCHAR2(20) ,
    PRIMARY KEY("ID") VALIDATE,
    FOREIGN KEY("SUBJECTID") REFERENCES "IMMUNODATA"."DEMOGRAPHICS" ("SUBJECTID") VALIDATE
    Other tables are alike.
    Thank very much!
    Qian

  • How to extract data from multiple tables (always got errors)

    Dear Experts,
    I have a simple mapping to extract data from multiple tables as a source (A, B, C) to a target table (X). Below is the picture:
    (Sources)....(Target)
    A----------------***
    B----------------X
    C----------------***
    Sample Source Data:
    Table A:
    ColA1
    100
    200
    etc
    Table B:
    ColB1 ColB2 ColB3
    10 Y Ten
    20 Y Twenty
    30 Y Thirty
    etc
    Table C:
    ColC1 ColC2
    11
    12
    13
    etc
    Target table (X) should be (just has 1 group INGRP1):
    ColA1 ColB1 ColB3 ColC1
    100 10 Ten 11
    100 10 Ten 12
    100 20 Twenty 21
    etc
    Scenarios:
    1. Directly map from A, B, C to X. Unable to map with error message: "API8003: Connection target attribute group is already connected to an incompatible data source. Use a Joiner or Set operator to join the upstream data first before connecting it into this operator."
    2. Map each source to Expression Operator and then map from each Expression to target table. I am able to map all attributes successfully but got error when validating it with message: "VLD-1104: Attributes flowing into TEST.EXPR_SRC.INGRP1 have different data sources."
    How can I achieve the correct mapping for this purpose?
    Use Joiner? I have no key to join the sources
    Use Set? The sources have different number of columns
    Thanks in advance
    Prat

    Thanks Nico,
    I think it will results data like this:
    100 10 Ten 11
    200 20 Twenty 12
    300 30 Thirty 13
    etc
    and not the expected:
    100 10 Ten 11
    100 10 Ten 12
    100 20 Twenty 21
    etc
    But it inspired me to solve this by adding key expression in each source table (B & C) to be joined to table A with this formula:
    100+TRUNC(INGRP1.COLB1,-2)
    Regards
    Prat

  • Xsql multiple table insert

    I'm having trouble getting my xml document inserted into multiple tables. My xml has a parent child relationship. The main node is the parent I'll call <CAKE> then later on in the xml doc it has a node called <INGREDIENTS> which is a repeating element (more than 1). I need to insert information from the root node, <CAKE> into 1 table and all the info from <INGREDIENTS> node into another table.
    I've tried to get Steve Muench's book a try (chapter 14) but when I try to run the examples from the book (XMLLoader) i get the following error.
    C:\jdev9i\jdk1.3\bin\javaw.exe -ojvm -classpath C:\jdev9i\jdev\mywork\orxmlapp\Examples\ch14\classes;C:\oracle\ora81\RDBMS\jlib\xsu12.jar;C:\jdev9i\lib\xmlparserv2.jar;C:\jdev9i\jdev\lib\jdev-rt.jar;C:\jdev9i\jdbc\lib\classes12.jar;C:\jdev9i\jdbc\lib\nls_charset12.jar;C:\jdev9i\jlib\jdev-cm.jar;C:\jdev9i\rdbms\jlib\xsu12.jar;C:\jdev9i\lib\xmlparserv2.jar;C:\jdev9i\lib\xmlcomp.jar;C:\jdev9i\lib\oraclexsql.jar;C:\jdev9i\rdbms\jlib\xsu12.jar;C:\jdev9i\lib\xsqlserializers.jar;C:\jdev9i\lib\xmlparserv2.jar;C:\jdev9i\jdev\mywork\orxmlapp\Examples\ch14\classes;C:\jdev9i\jdev\mywork\orxmlapp\Examples\ch14\classes;C:\jdev9i\jdev\mywork\orxmlapp\Examples\ch14\classes -
    mx50m
    XMLLoader -file deptempdepend.xml -transform deptempdepend.xsl
    Processed 1 Documents
    Node doesn't belong to the current document.
    Error: java.lang.NullPointerException
    Process exited with exit code 0.

    I made the changes in the java files as per the previous
    reference, but I'm still getting an error. Seeing that I'm not
    much of a Java guy yet, I'm not sure where to debug the error.
    So here it is:
    XMLLoader -file deptempdepend.xml -transform deptempdepend.xsl
    Processed 1 Documents
    null
    Error: java.lang.NullPointerException
    Process exited with exit code 0.
    I tried to debug it and came to the conclusion that it is
    failing at line 22 of ConnectionFactory
    The value connNode is returend as null.
    I don't understand why:
    I ran testxpath.exe for the connections file.
    C:\jdev9i\jdev\mywork\orxmlapp\Examples\ch14>testxpath connections.xml
    Type an XPath expression to test and press [Enter]
    To quit, press [Enter] without entering a path.
    connections.xml> /connections/connection[@name='doug']
    <connection name="doug">
    <username>user</username>
    <password>password</password>
    <dburl>jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))
    (CONNECT_DATA=(SERVICE_NAME=dtxml.hmms)))</dburl>
    <driver>oracle.jdbc.driver.OracleDriver</driver>
    </connection>
    connections.xml>
    and it returned what i thought would be the correct nodes.
    Any help would be appreciated
    Doug

  • How to connect multiple Xserve Raid for Best Performance

    I like to get an idea how to connect multiple Xserve Raid to get the best performance for FCP to do multiple stream HD.

    Again, for storage (and retrieval), FireWire 400 should be fast enough. If you are encoding video directly to the external drive, then FireWire 800 would probably be beneficial. But as long as the processing of the video is taking place on the fast internal SATA drive, and then you are storing files on the external drive, FireWire 400 should be fine.
    Instead of speculating about whether it will work well or not, you need to set it up and try your typical work flow. That is the only way you will know for sure if performance is acceptable or not.
    For Time Machine, you should use a single 1.5TB drive. It is likely that by the time your backup needs comes close to exceeding that space, you will be able to buy a 3TB (or larger) single drive for the same cost. Also, I would not trust a RAID where the interaction between the two drives is through two USB cables and a hub. If your primary storage drive fails, you need your backup to be something that is simple and reliable.
    Oh, and there should be no problem with the adapter, if you already have it and it works.
    Edit: If those two external drives came formatted for Windows, make sure you have use Disk Utility Partition tab to repartition and reformat the drive. When you select the drive in the Disk Utility sidebar, at the bottom of the screen +Partition Map Scheme+ should say *GUID Partition Table*. When you select the volume under the drive in the sidebar, Format should say *Mac OS Extended (Journaled)*.

  • Efficient Way of Inserting records into multiple tables

    Hello everyone,
    Im creating an employee application using struts framework. One of the functions of the application is to create new employees. This will involve using one web form. Upon submitting this form, a record will be inserted into two separate tables. Im using a JavaBean (Not given here) between the JSP page and the Java file (Which is partly given below). Now this Java file does work (i.e. it does insert a record into two seperate tables).
    My question is, is there a more efficient way of doing the insert into multiple tables (in terms of performance) rather than the way I've done it as shown below? Please note, I am using database pooling and MySQL db. I thought about Batch processing but was having problems writing the code for it below.
    Any help would be appreciated.
    Assad
    package com.erp.ems.db;
    import com.erp.ems.entity.Employee;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Collection;
    import java.util.ArrayList;
    public class EmployeeDAO {
         private Connection con;
         public EmployeeDAO(Connection con) {
              this.con = con;
         // METHOD FOR CREATING (INSERTING) A NEW EMPLOYEE
         public void create(Employee employee) throws CreateException {
              PreparedStatement psemployee = null;
              PreparedStatement psscheduleresource = null;
              String sqlemployee = "INSERT INTO employee (FIRSTNAME,SURNAME,GENDER) VALUES (?,?,?)";
              String sqlscheduleresource = "INSERT INTO scheduleresource (ITBCRATE,SKILLS) VALUES (?,?)";
              try {
                   if (con.isClosed()) {
                        throw new IllegalStateException("error.unexpected");
                            // Insert into employee table
                   psemployee = con.prepareStatement(sqlemployee);
                   psemployee.setString(1,employee.getFirstName());
                   psemployee.setString(2,employee.getSurname());
                   psemployee.setString(3,employee.getGender());
                            // Insert into scheduleresource table
                   psscheduleresource = con.prepareStatement(sqlscheduleresource);
                   psscheduleresource.setDouble(1,employee.getItbcRate());
                   psscheduleresource.setString(2,employee.getSkills());
                   if (psemployee.executeUpdate() != 1 && psscheduleresource.executeUpdate() != 1) {
                        throw new CreateException("error.create.employee");
              } catch (SQLException e) {
                   e.printStackTrace();
                   throw new RuntimeException("error.unexpected");
              } finally {
                   try {
                        if (psemployee != null && psscheduleresource != null)
                             psemployee.close();
                             psscheduleresource.close();
                   } catch (SQLException e) {
                        e.printStackTrace();
                        throw new RuntimeException("error.unexpected");
         }

    Hi ,
    U can use
    set Auto Commit function here ..
    let it be false first
    and when u do with u r all queries ..
    make it true
    this function take boolean values
    i e helful when u want record to be inserted in all or not at all..
    Hope it helps

  • Import flat file to multiple tables based on identifier column

    Hello,
    I am trying to setup a package that will import one pipe-delimited flat file (a utility bill) to multiple data tables based on the value of the first column.  I have been told it is similar in format to an EDI file, but there are some differences.
    The number of columns is consistent where the first columns are the same.  Meaning a record that has '00' in the first column will always have 10 columns; a record that has '01' in the first column will always have 9 columns; etc.
    Each value in the first column represents a separate destination data table.  Meaning a record that has '00' in the first column should be output to table '00'; a record that has '01' in the first column should be output to table '01'; etc.  All
    destination tables reside on the same SQL Server.
    Identifier columns can repeat multiple times throughout the flat file.  Meaning a record that starts with '01' may be repeated multiple times in the same.
    Sample Data:
    00|XXXXXXXX|XXX|XXXXXXXX|XXXXXX|XXXX|X|XXXXXXXXXX|XX|XXXXX
    01|XXXXXXXXXXX|XXX|XXXXXXXX|XXXXX|XXXXXXXXXXXXXXXXXXXX|XXXXXXXXXX|XXXXXXX|XXXXXXXXXXXXXX
    02|XXXXXXXXXXX|XXXXXXXX|XXXXXXX|XXXXX|XXXXX|XXXXX|XXXXX|XXXXX|XXXXX|XXXXX|XXXXX
    04|XXXXXXXXXXX|XXXXXXXXXXXXX|XXX|XXXXXXXX
    05|XXXXXXXXXXX|XXXXXXXXXXXXX|XXX|XXXXXXXX|XXXX
    07|XXXXXXXXXXXXX|X|XXXXXXXXXXXXXXX|XXX|XXXXXXXX|XXXX|XXXXXXX|XXXXXXXXXXX
    07|XXXXXXXXXXXXX|X|XXXXXXXXXXXXXXX|XXX|XXXXXXXX|XXXX|XXXXXXX|XXXXXXXXXXX
    07|XXXXXXXXXXXXX|X|XXXXXXXXXXXXXXX|XXX|XXXXXXXX|XXXX|XXXXXXX|XXXXXXXXXXX
    07|XXXXXXXXXXXXX|X|XXXXXXXXXXXXXXX|XXX|XXXXXXXX|XXXX|XXXXXXX|XXXXXXXXXXX
    01|XXXXXXXXXXX|XXX|XXXXXXXX|XXXXX|XXXXXXXXXXXXXXXXXXXX|XXXXXXXXXX|XXXXXXX|XXXXXXXXXXXXXX
    02|XXXXXXXXXXX|XXXXXXXX|XXXXXXX|XXXXX|XXXXX|XXXXX|XXXXX|XXXXX|XXXXX|XXXXX|XXXXX
    04|XXXXXXXXXXX|XXXXXXXXXXXXX|XXX|XXXXXXXX
    Any help would be appreciated.

    Hi koldar.308,
    If there are few distinct values in the first column, we can use Flat File Source connect to that flat file, then use Conditional Split Transformation to split the first column to multiples, and then load the data to multiple tables with OLE DB Destination
    based on the outputs of Conditional Split.
    After testing the issue in my environment, please refer to the following steps to achieve this requirement:
    Drag a  Flat File Source connect to that flat file with Flat File Connection Manager.
    Drag a Conditional Split Transformation connects to the Flat File Source.
    Double-click the Conditional Split Transformation, add several Output based on the first column values as below:
    Drag same number OLE DB Destinations as the outputs of Conditional Split, connect to Conditional Split with one case output:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Reports using multiple tables

    I am trying to create a report using portal that use links between multiple columns. The info I want is mainly in two tables. Some of the info in the table is numeric (Foreign Keys). I want to display them in readable format so set up joins to the respective parent tables. When I do this the result only produces 12 lines of output irrespective of the number of lines I set per page. When I show only the data from the main tables, without the joins to the other parent tables, i.e. the foreign keys as numbers I get all the rows. I have tried to create the report by using all three options given but get the same result.
    I am using 9iAS verison 1.0.2.0 and Portal version 3.0.7.
    Can someone please explain why this happens and how I can solve this problem urgently.

    Hi Ashok,
    Sorry for posting the solution with delay. Actually I ran into the similar situation and upon deep analysis, I could crack it., the very next day.
    This is how your write back template should be for updating on multiple tables
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="WRITE">
    <XML>
    <writeBack connectionPool="Oracle Data Warehouse Connection Pool">
    <insert> </insert>
    <update> UPDATE FACT SET COUNT = '@{c4}', W_UPDATE_DT = CURRENT_DATE
    WHERE EXISTS (SELECT ROW_WID FROM DIM WHERE DIM.ROW_WID = FACT.DIM_WID AND
    DIM.X = '@{c1}' AND DIM.Y= '@{c2}' AND DIM.Z = '@{c3}' ) AND EXISTS (SELECT ROW_WID FROM DT WHERE DT.ROW_WID = FACT.DT_WID AND DT.PER_NAME_YEAR = '@{c0}') </update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    =====
    Using exits, will improve the performance.
    Hope it helps. If yes, pls award points. Thanks
    Regards,
    Sarat Nallapati

  • Crystal Reports - ECC Tables - Row level security on Multiple tables

    Hi Experts,
    We are implementing Crystal Reports directly reporting on ECC Tables.  Lot of information on row-level security has been provided by experts Ingo Hilgefort, Don Williamsand Mike Seblani, but not related to multiple tables or Wild cards
    Requirement:
    Crystal Users should have access to ALL the tables in ECC, but restricted by Company code, plant, Sales Organization, Purchasing Organization fields to what ever table it applies to. Example: MARC table should be restricted by Plant, BSEG table should be restricted by Plant and company code, GLT0 table should be restricted by Company code..etc
    Users should ONLY see their Organization related data.
    Solution Developed:
    1. We created custom authorization object with BUKRS and WERKS
    2. In  /CRYSTAL/RLS  we used Wild Cards *, +  rather than specific table  and referenced the custom authorization object with =BUKRS and =WERKS  in the Field Value
    3. Enabled global lock
    4. Custom Authorization object was added to user-profiles with corresponding restrictions
    *Observation:*
    1. This security works when a crystal report was developed on a ECC table which has both BUKRS and WERKS
    2. This setup DOES NOT work when a crystal report developed on a table with either one of BUKRS or WERKS
        Example: Does not work on MARC table - error message "Database connection error: /CRYSTAL/OSQL_EXECUTE_QUERY Message: field T0~BUKRS" unknown"
       Does not work on GLT0 table - error message "Database connection error: /CRYSTAL/OSQL_EXECUTE_QUERY Message: field T0~WERKS unknown"
    Trouble Shooting:
    In the "where clause" of the internal ABAP code generated for MARC, system is checking for BUKRS - which  should not be the expected result
    ANYTHING WRONG IN THE SECURITY SETUP ? PLEASE ADVICE
    Note: Document "BusinessObjects XI Release 2, Integration Kit for SAP, Installation Guide" does not talk much about this multiple table restriction. Any other document to be referred to ?

    I'm not sure how that would help; by using the Faculty_ID Session Variable I can identify the CRN and Term of all courses a faculty member is teaching. But I don't think that has to do with the problem I am having?

  • Connecting multiple CRM systems to one backend R/3 and vice versa

    Hello experts
    Can you tell me whether it is advisable to connect 2 CRM systems to a single backend R/3 and vice versa? Is it recommended by SAP? I require some notes or docs on this. I got some notes on this forum but they are all Internal ones which I am unable to see.
    Please help!
    Warm Regards
    Debolina

    Hi,
    Though SAP does not recommend connecting multiple systems to one ECC backend. But still it has designed a procedure to achieve this.
    Here is the excerpts of the steps required.
    1. Execute report MCRM_SETTINGS for each CRM system connected to the ERP
    system.
    2. Check the entries of the table CRMRFCPAR of the connected ERP system:
    The field REM_LOGSYS should be filled for every entry marked with
    u2018Created by the MCRM reportu2019.
    3. Activate the corresponding consumers in the table CRMCONSUM
    (transaction SM30).
    4. Internal and external number ranges for Business Partners have to be aligned
    manually.
    Hope it helps you!!!!
    Good Luck.
    Pardeep

  • Possibility of connecting multiple BW systems to single ECC system

    Hi all,
    I have a requirement in my company to connect multiple BW systems to single ECC system. Would like to confirm whether this may not be supported by all BW extractors in particular the delta mechanism?
    For logistics extractor in ECC side in RSA7 it stores BW System as target which shows they support multiple BW systems as target, but for FI extractors which keeps delta timestamps in BWOM2_TIMEST table, it doesn't store the target system. I'm afraid if we connect multiple BW systems to single ECC system, some of the delta records might go to one BW system and some others go to the other BW system when we execute delta load in both BW systems.
    Thank you very much in advance.
    regards,
    arie

    Hi,
    You can very well connect multiple BW systems to single ECC system and you will not miss any delta as well. In the source system for each delta data source a delta queue is maintained for each target system.
    for e.g. I have two BW systems ABW and BBW connected to AEC system then for 0FI_AP_4 data source we will have DQ1_ABW and DQ2_BBW as two different delta queues (I am not following any naming conventions, actual names will be as per the target system logical name).
    The settings maintained in BWOM2_TIMEST table are across the system and they define some global settings e.g. till what time the FI data should be extracted in BW system, for e.g. the time maintained is 2.00 AM then though you do extraction from multiple systems same data will be extracted till next time interval occurs.
    In summery you can very well connect multiple BW systems to a single ECC system.
    Regards,
    Durgesh.

Maybe you are looking for

  • Frames w/Text-like u can do in Windows Movie maker- Help Please

    not referring to Titles. I want fames with text in them, sentences and short paragraphs. I was on this forum until 2:30 am trying to find similar and only 1, referring to typewriter that is in wmm they said on the old HDimovie download which isn't av

  • XML message mapping issue!!

    Hi ipbuff, Many Thanks for your very quick reply. I have tried the way what explain, but not working . I am attaching both the structures, please guys throw your valuable openions and technical ways how to resolve this. I have 5 segments in Header, m

  • Export with Photokit Sharpening

    I am trying to figure out how to use the export function of LR to somehow export and sharpen with Photokit. There is a box for "post-processing" in the LR export window but I'm not sure if I need to make a droplet from CS3 or an action or what to get

  • Won't transfer some of videos

    I bought a season of a TV show from iTunes recently and when I tried to transfer the videos to my iPod only 3 of the episodes would transfer. They play fine on my iTunes/computer when I attempt to find them and I know there is room on my iPod; howeve

  • CAN USE COPY COMMAND INSIDE PROCEDURE BODY

    Hi all can we use COPY command inside procedure body like this CREATE OR REPLACE procedure USER2.PRO1 Begin execute immediate'copy from hr/hr@ERP to USER21/PASS@DB1 append user2.per_images using select * from hr.per_images'; commit; end; YOU ADVICE P