Using case pull infor from one of two columns

how can I use the case statement to pull data from rows that are grouped together from a table? or is there a way to use if..then?
my incorrect , unfinished query.....
select t1.col1 from tab1 t1,tab2 t2
where
t1.col1= t2.col1 and
t1.col1= < if I find an 'x' in t2.col2 then return all t1 rows from that group that have x's in corresponding t2.col2
else return all rows that have an x's in corresponding t2.col3>
group by t1.col1

One table has data like this:
STG_CLAIMANT_XREF
SRC_EVENT_NUMBER     SRC_CLAIM_NUMBER     SRC_CLMT_NO     STG_CLAIM_TYPE
0040283362              00402833620001                 0001          112
0040283362              00402833620002                 0002          111
0040283362              00402833620003                 0003          112
0040283362              00402833620050                 0050          115The above represents one group of data from a group by SRC_EVENT_NUMBER,
a subset of groups from the whole table.
The other has data like this:
CLAIMTYPE_X_BI_PD
CODE_ID     PD_TYPE     BI_TYPE
110       -1     
111            -1
112       -1     
119            -1I want to run through the 1st table and match the STG_CLAIM_TYPEs to the CODE_IDs
in the second table.
I'm going to join STG_CLAIM_TYPE = CODE_ID.
If ANY rows in the first table have STG_CLAIM_TYPEs with values in the PD_TYPE col in the second table than for that group I can ONLY return the rows that have STG_CLAIM_TYPEs = 111 for example.
However, if No rows of type 111 exist but rows STG_CLAIM_TYPEs = 111 exist (STG_CLAIM_TYPEs with values in the BI_TYPE col) Than I can only return rows that have STG_CLAIM_TYPEs = 112
my first try was a query that worked but returned both type out of each group. It was
select xr.SRC_EVENT_NUMBER, xr.SRC_CLAIM_NUMBER, xr.STG_CLAIM_TYPE
from STG_CLAIMANT_XREF xr, CLAIMTYPE_X_BI_PD BP
where
xr.STG_CLAIM_TYPE = bp.CODE_ID
and
(bp.PD_TYPE = -1 or bp.BI_TYPE = -1)
group by xr.SRC_EVENT_NUMBER, xr.SRC_CLAIM_NUMBER, xr.STG_CLAIM_TYPE;
will return rows 1,2,& 3. I need only 1 & 3 or just 2.
I figured using a case statement would help me solve this issue but I am usure of how to
implement it.
What would you suggest?
Message was edited by:
user623359

Similar Messages

  • Learning to use lookup transformation - match value in one of two columns

    Im a little new to using lookup transforms.  Been reading a bit, but using two columns is throwing me off.
    Have a dataflow with the source having a column I want to use to lookup in a table in another DB.  The match could be in one of two columns in that table.  
    If a match is found, I need a different value from the lookup table added to the source flow that is going into the destination.
    How can I match on one of two columns in the lookup table, and use a totally different column added to the final input going into the destination ?  
    In the Lookup configuration, I can set the lookup operation to replacing the value in the source, but I want EITHER value match from the two columns from the lookup table to go into the value that will go into the destination.
    With TSQL - I would use a case statement and compare the source column to BOTH of the lookup table columns.

    You can handle this within single lookup using below query
    SELECT CASE WHEN <condn1> THEN Field1 ELSE Field2 END AS lookupField,
    CASE WHEN <condn1> THEN Field3 ELSE Field4 END AS MatchField
    FROM Table2
    Then just do single relationship with LookupField and select MatchField to be aded to output
    the condition will specify your fields value condition based on which you determine which column to be matched against
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • TS3510 I have 3 different apple devices using the same Apple ID and would like to use FaceTime to call from one device to the other.  Do I need a different Apple ID for one of the devices in order to do that?

    I have 3 different apple devices (iPod Touch, iPad and MacBook Pro) using the same Apple ID and would like to use FaceTime to call from one device to the other.  Do I need a different Apple ID for one of the devices in order to do that?

    I found this on a related question in the Community:
    Yes you can do it. I do it with 4 different devices all using the same Apple ID.
    You need to associate different email addresses for each device in order to use those email addresses as the "contact at" email address. The reason the calls are dropping on you now is that what you are trying to do is like calling yourself on your own phone.
    You can also create new iCloud accounts on each device simply to use for FaceTime, but I'm guessing that the users of the other two devices have their own email addresses which will make this work for you quite easily.
    Take a look at this for more information.
    The seems to go against what Gail said and the issue you raised about buying dup apps was my first concern.  If this other post is correct, how to I set a different "contact at" in the iPod Touch?
    Goose

  • Guys i have a problem, I used to download apps from one of my friends apple id, now i created my new account, but when i was about to update my apps its asks for my friends id and password. now how could i update my old apps from my new apple id?

    Guys i have a problem, I used to download apps from one of my friends apple id, now i created my new account, but when i was about to update my apps its asks for my friends id and password. now how could i update my old apps from my new apple id?

    The_Tonmoy wrote:
    I have no communication with my that friend :/ So it means i need to delete those apps? There's no other solution to update those apps?
    No.  purchases are forever tied to the apple ID used to buy them.  Delete them and buy your own copies.

  • Text flow into one or two column text boxes depending on the number of text lines

    Question InDesignCS3
    Is it possible to let text flow into one or two column textboxes depending on the number of text lines?
    Example 1)
    --Default text box--|
    | Text line 1 |
    | Text line 2 |
    | Text line 3 |
    | Text line 4 |
    ------------------- |
    If there are more than 4 text lines in the in the text box, this box has to become a two column box. like example 2
    example 2)
    |Text line 1 | Text line 4 |
    |Text line 2 | Text line 5 |
    |Text line 3 | Text line 6 |

    if (myTextFrame.lines > 4) {
    myTextFrame.textFramePreferences.textColumnCount = 2;
    } else {
    myTextFrame.textFramePreferences.textColumnCount = 1;

  • Sharepoint client object model - Pull files from one site and move to another

    Dear All,
    I am using client object model to retrieve files of certain criteria using caml query and copy them to some other site using 
    client object model. There is no exception being thrown, but the application is not performing either. No files are being copied to destination. Here is the code. Please advise.
    The message box that I have kept at the end is being displayed, but no files are being copied.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Net;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Microsoft.SharePoint;
    using SP = Microsoft.SharePoint.Client;
    namespace WindowsFormsApplication2
        public partial class Form1 : Form
            public Form1()
                InitializeComponent();
            private void Form1_Load(object sender, EventArgs e)
            private void button1_Click(object sender, EventArgs e)
                SP.ClientContext srcContext = new SP.ClientContext(textBox1.Text);
                srcContext.Credentials = new NetworkCredential(textBox3.Text, textBox4.Text, textBox5.Text);
                SP.ClientContext destContext = new SP.ClientContext(textBox2.Text);
                destContext.Credentials = new NetworkCredential(textBox3.Text, textBox4.Text, textBox5.Text);
                SP.CamlQuery camlQuery = new SP.CamlQuery();
                camlQuery.ViewXml = "<View Scope='RecursiveAll'><Query><Where><And><Geq><FieldRef Name='Created' /><Value IncludeTimeValue='TRUE' Type='DateTime'>2013-01-01T04:16:20Z</Value></Geq><And><Lt><FieldRef
    Name='Created' /><Value IncludeTimeValue='TRUE' Type='DateTime'>2013-12-31T04:16:43Z</Value></Lt><Or><Eq><FieldRef Name='Document_x0020_Classification' /><Value Type='Choice'></Value></Eq><Eq><FieldRef
    Name='Document_x0020_Classification' /><Value Type='Choice'>Case Studies</Value></Eq></Or></And></And></Where></Query></View>";
                SP.Web oWebsite = srcContext.Web;
                srcContext.Load(oWebsite, website => website.Webs);
                srcContext.ExecuteQuery();
                SP.Web dWebsite = destContext.Web;
                destContext.Load(dWebsite);
                destContext.ExecuteQuery();
                foreach (SP.Web web in oWebsite.Webs)
                    MessageBox.Show(web.Title);
                    foreach (SP.List list in web.Lists)
                        if (list.BaseType.ToString() == "DocumentLibrary")
                            MessageBox.Show(list.Title);
                            SP.ListItemCollection collListItem = list.GetItems(camlQuery);
                            srcContext.Load(collListItem);
                            srcContext.ExecuteQuery();
                            foreach (var doc in collListItem)
                                        SP.File f = doc.File;
                                        srcContext.Load(f);
                                        srcContext.ExecuteQuery();
                                        string destLibrary = "shared Documents";
                                        string nLocation = dWebsite.ServerRelativeUrl.TrimEnd('/') + "/" + destLibrary.Replace(" ", "")
    + "/" + f.Name;
                                        SP.FileInformation fileInfo = SP.File.OpenBinaryDirect(srcContext, f.ServerRelativeUrl);
                                        SP.File.SaveBinaryDirect(destContext, nLocation, fileInfo.Stream, true);
                MessageBox.Show("Completed");
    sk.Rakhishma

    Hi,
    To copy files from one site collection to another site collection, the simplest way is to open document library in windows explorer view.
    Go to document library, click library tab, click open with explorer.
    You can open the document library1 in explorer then copy the files which you want to paste to another site collection
    document library2, then open the document library2 in explorer to paste the documents.
    Besides, there are other method:
    https://social.msdn.microsoft.com/Forums/office/en-US/67282348-25c7-4bd0-9d95-61024c6892f9/how-we-move-a-document-library-from-one-site-collection-to-another-sitecollection?forum=sharepointgeneralprevious
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/8c112d85-1ab8-426b-be37-d010cf8647fe/copy-a-list-from-one-site-collection-to-another-using-web-service
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • One user receiving WINMAIL.DAT attachments from one or two domains

    I have a single user in our organization that is RECEIVING WINMAIL.DAT attachments which contain PDF's from only one or two domains external to the organization.
    Let me be clear that he is not sending out WINMAIL.DAT attachments to anyone. I have tested sending him RTF emails with a PDF attachment from an external address and he is receiving them just fine. We are running two Exchange 2013 servers in
    HA configuration and this user is using Outlook 2010 for his email client. If he looks at these messages in OWA, they still have the WINMAIL.DAT attachment within OWA. I cannot find an answer for this anywhere, and this is not related to disabling TNEF on
    our exchange servers.  Does anyone have any ideas?  I would really appreciate the assistance.
    Thanks,
    Dean

    Hi
    Did you try this article -
    http://support.microsoft.com/kb/278061/en-us
    If the above article did not help then you can try the following
    1) Create an external contact for sender email address from whom the email is sent to the affected user.
    Run the below command for that sender external contact
    Set-MailContact "External Contact" -UseMapiRichTexFormat Never
    Ask the user to send email once again to that affected recipient and see if it still occurs.
    Most likely the latter should fix your problem.
    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you.
    Regards,
    Sathish

  • Multiple BW Systems pulling data from one R/3

    Does SAP recommend multiple SAP-BW systems to pull data from the same R/3 system?
    If so then how does delta get get handled in such a scenario?

    Hi Roberto,
    I have a similar question.We currently have one R3 system connected to one BW system.
    Now, we have to connect another BW system and start extracting data for 2LIS_03_BF and 2LIS_03_BX.
    The delta loads are already happening for the existing BW system for these 2 datasources.
    I intend to follow the following steps :
    1) Lock all Material postings
    2) Transfer data from existing Extraction queue and then the Delta Queue for the 2 Datasources
    3) Delete SetUp tables
    4) Fill SetUp tables (MCNB and OLI1BW)
    5) Initialize Delta in new BW source system
    6) Unlock Material postings
    a) If I don't run the job for emptying the extraction queue, will ther be duplicate entries in the new BW system whenI run delta after Init? Which leads me to my second question, when data is transferred from extraction queue to delta queue, is it done for each target system?
    b) Can this whole process disturb the existing delta flow in the existing BW system.
    Thanking you in anticipation.
    Pankaj

  • Using logged user detail from one table ,then use another table to link more details for same user ?

    Table 'user' fields:
    UserID* (Primary Key)
    Address
    FirstName
    LastName
    Email
    UserName
    Password
    UserLevel
    RegDate
    Table 'transaction' fields:
    transactionID* (Primary Key)
    MonthID
    UserID (Foreign Key)
    UserName
    transactionDate
    transactionType
    transactionAmount
    OpeningBalance
    Balance
    Desired output table (for the logged user):
    transactionDate
    transactionType
    transactionAmount
    OpeningBalance
    Balance
    My advance recordset details is like this :
    <?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;
    mysql_select_db($database_bankusers, $bankusers);
    $query_Recordset1 = "SELECT transactions.UserName, transactions.transactionDate, transactions.transactionType, transactions.transactionAmount, transactions.OpeningBalance, transactions.EndBalance, users.FirstName, transactions.transactionID FROM transactions, users WHERE users.UserName = transactions.UserName ORDER BY transactions.UserName, transactions.transactionID DESC";
    $Recordset1 = mysql_query($query_Recordset1, $bankusers) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?>
    This enables me to pull all the records from both tables but not specific to the logged user.
    This is my problem. I would like the record to be pull is for the right user.
    I am not sure if the the problem is to do with Session variable MM_UserName as I have no idea how to include it in the advanced recordset box but i am not sure there is no missing session start on this page.  Your help or suggestion will be much appreciated.

    I am getting this error on the browser :
    You have an error in your SQL syntax; check the manual that corresponds  to your MySQL server version for the right syntax to use near 'ORDER BY  transactions.UserName, transactions.transactionID DESC' at line 1
    Here is my full code :
    <?php require_once('Connections/bankusers.php'); ?>
    <?php @session_start(); ?>
    <?php
    if (!isset($_SESSION)) {
      session_start();
    $MM_authorizedUsers = "";
    $MM_donotCheckaccess = "true";
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
      // For security, start by assuming the visitor is NOT authorized.
      $isValid = False;
      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
      // Therefore, we know that a user is NOT logged in if that Session variable is blank.
      if (!empty($UserName)) {
        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
        // Parse the strings into arrays.
        $arrUsers = Explode(",", $strUsers);
        $arrGroups = Explode(",", $strGroups);
        if (in_array($UserName, $arrUsers)) {
          $isValid = true;
        // Or, you may restrict access to only certain users based on their username.
        if (in_array($UserGroup, $arrGroups)) {
          $isValid = true;
        if (($strUsers == "") && true) {
          $isValid = true;
      return $isValid;
    $MM_restrictGoTo = "loginuser.php";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  
      $MM_qsChar = "?";
      $MM_referrer = $_SERVER['PHP_SELF'];
      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
      if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
      $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
      header("Location: ". $MM_restrictGoTo);
      exit;
    ?>
    <?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;
    mysql_select_db($database_bankusers, $bankusers);
    $query_Recordset1 = "SELECT transactions.UserName, transactions.transactionDate, transactions.transactionType, transactions.transactionAmount, transactions.OpeningBalance, transactions.EndBalance, users.FirstName, transactions.transactionID FROM transactions, users WHERE users.UserName = transactions.UserName AND users.UserName = $MM_UserName ORDER BY transactions.UserName, transactions.transactionID DESC";
    $Recordset1 = mysql_query($query_Recordset1, $bankusers) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?>
    <!DOCTYPE HTML>
    <html>
    <head>
      <title>user summary</title>
      <meta name="description" content="website description" />
      <meta name="keywords" content="website keywords, website keywords" />
      <meta http-equiv="content-type" content="text/html; charset=windows-1252" />
      <link rel="stylesheet" type="text/css" href="style/style.css" title="style" />
    </head>
    <body>
      <div id="main">
        <div id="header">
          <div id="logo">
            <div id="logo_text">
              <!-- class="logo_colour", allows you to change the colour of the text -->
              <h1><a href="index.php">ModelOnline<span class="logo_colour">Bank</span></a></h1>
              <h2>Your. Bank. On. Demand.</h2>
            </div>
          </div>
          <div id="menubar">
            <ul id="menu">
              <!-- put class="selected" in the li tag for the selected page - to highlight which page you're on -->
              <li class="selected"><a href="indexoriginal.php">Home</a></li>
              <li><a href="register.php">REGISTER</a></li>
              <li><a href="login.php">lOGIN</a></li>
              <li><a href="aboutus.php">ABOUT US</a></li>
              <li><a href="contactus.php">Contact Us</a></li>
              <li><a href="cookies.php">Cookies</a></li>
              <li><a href="accessibility.php">Accessibility</a></li>
              <li><a href="security.php">Security</a></li>
            </ul>
          </div>
        </div> <div align="center" class="bankservices"><a href="http://www.modelonlinebank.com/bankproducts.php#one">Current Accounts</a> | <a href="http://www.modelonlinebank.com/bankproducts.php#two">Savings Accounts</a> | <a href="http://www.modelonlinebank.com/bankproducts.php#three">Mortgages</a> | <a href="http://www.modelonlinebank.com/bankproducts.php#four">Insurance</a> | <a href="http://www.modelonlinebank.com/bankproducts.php#five">Credit Cards</a> | <a href="http://www.modelonlinebank.com/bankproducts.php#six">Investments</a></div>
        <div id="site_content">
          <div class="sidebar">
            <!-- insert your sidebar items here -->
            <<h3>Latest News</h3>
            <h4>Personal Banking</h4>
            <h5>January 1st, 2014</h5>
            <p>Current Accounts,Saving Accounts,Range of Credit And Debit cards to suit all your needs. We have your interest in mine.<br />
            <a href="#">Read more</a></p>
    <p></p>
            <h4>Corporate Banking</h4>
            <h5>February 5th, 2014</h5>
            <p>We help you achieve your goals by providing numerous funding options.Provide Risk management of your finances and look for strategic and finance options to promote business.<br /><a href="#">Read more</a></p>
            <h3>Useful Links</h3>
            <ul>
              <li><a href="#">Credit card</a></li>
              <li><a href="#">Debit card</a></li>
              <li><a href="#">Loans</a></li>
              <li><a href="#">Insurance</a></li>
            </ul>
            <h3>Search</h3>
            <form method="post" action="#" id="search_form">
              <p>
                <input class="search" type="text" name="search_field" value="Enter keywords....." />
                <input name="search" type="image" style="border: 0; margin: 0 0 -9px 5px;" src="style/search.png" alt="Search" title="Search" />
              </p>
            </form>
          </div>
          <div id="content">
            <!-- insert the page content here -->
            <h1>Welcome <?php echo $row_Recordset1['FirstName']; ?>,to your control panel.</h1>
            <p><a href="logout.php">Logout</a> </p>
            <p>Summary of Last Transaction on our system:
             </p>
            <form name="form1" method="post" action="">
              <table border="0">
                <tr>
                  <th bgcolor="#D6D6D6">Date</th>
                  <th bgcolor="#D6D6D6">Transaction Type</th>
                  <th bgcolor="#D6D6D6">Transaction Amount</th>
                  <th bgcolor="#D6D6D6">Previous Balance</th>
                  <th bgcolor="#D6D6D6">Balance</th>
                </tr>
                <tr>
                  <td><?php echo $row_Recordset1['transactionDate']; ?></td>
                  <td><?php echo $row_Recordset1['transactionType']; ?></td>
                  <td><?php echo $row_Recordset1['transactionAmount']; ?></td>
                  <td><?php echo $row_Recordset1['OpeningBalance']; ?></td>
                  <td><?php echo $row_Recordset1['EndBalance']; ?></td>
                </tr>
              </table>
            </form>
    <p><a href="monthly.php">View Monthly Statement</a></p>
            <p><a href="paysomeone.php">Pay Someone</a></p>
            <p><a href="standingorder.php">Standing Orders</a></p>
            <p><a href="directdebit.php">Direct Debits</a></p>
            <p><a href="contactus.php">Customer Services</a></p>
            <p> </p>
            <p> </p>
    </div>
        </div>
        <div id="content_footer"></div>
        <div id="footer">
          Copyright &copy; Sundeep gurroby BCS PGD<a href="http://www.html5webtemplates.co.uk"></a>
        </div>
      </div>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>

  • Build view with data rows from one of two views.

    Hello. I've got problem with PL/SQL.
    I have built two PL/SQL views. Now I have to write a third
    view based on the data from "view_1" or "view_2". "view_2" contains all data rows
    but "view_1" contains special information. If the needed data rows (it's
    always a tupel of two rows) are available in "view_1" i have to use these data.
    Are they not available in "view_1" i have to get it from the second view.
    I've tried it with the DECODE function and a procedure I've written but I think it's
    the completly wrong way because I have to search for a tour_id and there are always
    two shipments for one tour.
    It looks something like:
    >
    SELECT
    DECODE(FNC_OPERATION_INSTRUCTION_EXISTS(T1.TOURNO),0,
    (SELECT SHIPPING_NO
    FROM VIEW_SHIPPINGADRESS
    WHERE TOUR_ID=TO_CHAR(T1.TOURNO)),
    (SELECT SHIPPING_NO
    FROM VIEW_SHIPPINGADRESS_OPERATION_INSTRUCTION
    WHERE TOUR_ID=TO_CHAR(T1.TOURNO)) "SHIPPING_NO"
    FROM
    TB_TOURS     T1
    WHERE
    But for sure I've got the error "ORA-01427: single-row subquery returns more than one row."
    because there are always two rows for one T1.TOURNO.
    I think that it's a standard problem but I also think that I'm on the wrong way.
    I will be very thankful for any hint.
    Thanx,
    Christoph

    select col1,
           col2,
           col3
      from  (select (select decode(count(*),0,0,1) cnt
                       from view_1
                      where ...)) chk,
                     col1,
                     col2,
                     col3
               from view_1
              where ...) tab1
    where tab1.chk = 1
    union all
    select col1,
           col2,
           col3
      from  (select (select decode(count(*),0,0,1) cnt
                       from view_1
                      where ...)) chk,
                     col1,
                     col2,
                     col3
               from view_2
              where ...) tab1
    where tab1.chk = 0note: untested.

  • Can we pull data from one cube to another cube

    Hi All,
    I need to pull the data for a 4 fields from an existing info cube to another cube. Can any one let me know the procedure of how to do this.
    Thanks in Advacne

    scenario cube1 --> cube2
    1) load data into cube1
    2) cube1 > export datasource > it creates the ds with 8cube1
    3) rsa1 > source systems > myself sourcesystem > replicate datasources
    4) cube2 > rt clk > create update rules
    5) map the update rules for the 4 fields and activate
    6) rsa1 > infosources > search for 8cube1 > create infopackage and load data.
    Regards,
    BWer
    Assign points if helpful.

  • When I try and send mail from one of two email addresses, it asks me for a password to a google e-mail account I no longer have, so now I can't send any mail

    I have x6 gmail accounts set up on my Thunderbird pop mail. When ever I try and send ANY email from 2 of these accounts ([email protected] & [email protected]) a window pops up and says the following:
    Enter your password for [email protected] on smtp.googlemail.com
    I haven't had that email address for a couple years, and I've tried every password I've ever used with no luck.
    I eventually have to hit cancel, the a new error box pops up that says the following:
    Sending of message failed.
    An error occurred sending mail: Could not get password for smtp.googlemail.com. The message was not sent.
    PLEASE PLEASE help, I need these two address to work. Every other address (x4) through Thunerbird works.
    Thank you for your time and support.

    Are you trying to send an email from "[email protected]" this address??
    Check your Thunderbird Account Settings and SMTP
    *https://support.mozilla.org/en-US/kb/manual-account-configuration
    *http://kb.mozillazine.org/Multiple_SMTP_servers_%28Thunderbird%29

  • Difference in use of connection pools from one server to another

    Hi all
    we are running wl5.1 with sp9 against SQLServer 2000
    On our performance test server (2 CPU) which has weblogic & sqlserver runnig
    on it we run out out of connection pools when running a specific method,
    having looked at it we noticed that it contained nested sql, so that each
    client would actually hang onto multiple connections until finished. The
    total number of connections used seemed approximately the same as the number
    of SQL statements.
    However we then ran the weblogic server on a different machine against the
    same database, so it was now running over a network and everything worked ok
    and the total number of client connections was just 1.
    Can anyone shed any light onto this, I have a few ideas but nothing to back
    them up as follows:
    Multi CPU versus single CPU
    Local connection rather than network connection between WLServer and
    DBServer
    WL Configuration
    DBServer configuration
    Is nested SQL valid ?
    Any help much appreciated Paul Taylor
    (An example of what I mean by nested sql is shown below, method1() creates
    instances of class2 and calls c2.method which contains sql before releasing
    its connection.)
    class c1
    public void method1()
    try
    rs=executesql(sqlString)
    while rs.next()
    new c2();
    c2.method2()
    finally
    closeConnection()
    class c2
    public void method2()
    try
    rs=executesql(sqlString)
    finally
    closeConnection()

    because when you are dealing with a remote server, your calls will be
    serialized over one socket. and the connection is assigned to that socket
    probably...or something like that...or not...shouldn't be important :)
    Filip
    ~
    Namaste - I bow to the divine in you
    ~
    Filip Hanik
    Software Architect
    [email protected]
    www.filip.net
    "Paul taylor" <[email protected]> wrote in message
    news:[email protected]...
    The code has now been changed, but the real point was why are two server
    dealing with the same code in a different way
    "Filip Hanik" <[email protected]> wrote in message
    news:[email protected]...
    Any help much appreciated Paul Taylor
    (An example of what I mean by nested sql is shown below, method1()creates
    instances of class2 and calls c2.method which contains sql beforereleasing
    its connection.)well this is obviously not a good way of doing it. you know that you are
    obtaining multiple connections so why not code your software in a
    smarter
    way.
    pass the connection object into c1 and c2 that way they both use thesame
    connection. Or release in between.
    Filip
    ~
    Namaste - I bow to the divine in you
    ~
    Filip Hanik
    Software Architect
    [email protected]
    www.filip.net
    <l> wrote in message news:[email protected]...
    Hi all
    we are running wl5.1 with sp9 against SQLServer 2000
    On our performance test server (2 CPU) which has weblogic & sqlserverrunnig
    on it we run out out of connection pools when running a specific
    method,
    having looked at it we noticed that it contained nested sql, so thateach
    client would actually hang onto multiple connections until finished.
    The
    total number of connections used seemed approximately the same as thenumber
    of SQL statements.
    However we then ran the weblogic server on a different machine against
    the
    same database, so it was now running over a network and everythingworked
    ok
    and the total number of client connections was just 1.
    Can anyone shed any light onto this, I have a few ideas but nothing
    to
    back
    them up as follows:
    Multi CPU versus single CPU
    Local connection rather than network connection between WLServer and
    DBServer
    WL Configuration
    DBServer configuration
    Is nested SQL valid ?
    Any help much appreciated Paul Taylor
    (An example of what I mean by nested sql is shown below, method1()
    creates
    instances of class2 and calls c2.method which contains sql beforereleasing
    its connection.)
    class c1
    public void method1()
    try
    rs=executesql(sqlString)
    while rs.next()
    new c2();
    c2.method2()
    finally
    closeConnection()
    class c2
    public void method2()
    try
    rs=executesql(sqlString)
    finally
    closeConnection()

  • I want to break my slide from one to two slides.

    I have a slide with too much text. I want to know how to split the slide into two slides. In PowerPoint this is something that the program asks automatically.

    Thanks, John. It seems that PowerPoint is a little more effective in this area. The program asks if you want to split the slide and, depending on the answer, you can either split the information or keep it in one.

  • Problem using "CASE" (trying convert from IIF in access)

    I try convert a function IIF from ACCESS, replacing "IIF" for a "CASE", and get me a error in "SELECT line 19", can any1 help me ?
    PROCEDURE  [GetInfo_ASN] 
    @P1 smalldatetime     -- Data de Entrada
    AS
    BEGIN
      SET NOCOUNT ON;
    SELECT 
      dados.dbo.GVAL_PEDIDOS.AVAP_Id AS [Reg SIGA], 
      dados.dbo.GVAL_BEM.AVAB_Codigo AS [Cod Bem], 
      select case when (SUBSTRING([dados.dbo.AVAB_Codigo],5,1)="0")
                  then Right([dados.dbo.AVAB_Codigo],6)
     else (SUBSTRING([dados.dbo.AVAB_Codigo],5,1) & Right([dados.dbo.AVAB_Codigo],6))
             end as [UE/UL],
      dados.dbo.GVAL_PEDIDOS.AVAP_dtEnvio AS [Dt Envio], 
      dados.dbo._FREGUESAS.F_Distrito AS Distrito, 
      dados.dbo._FREGUESAS.F_Concelho AS Concelho
    FROM (dados.dbo.GVAL_PEDIDOS INNER JOIN dados.dbo.GVAL_BEM 
    ON GVAL_PEDIDOS.AVAP_Codigo = GVAL_BEM.AVAB_Codigo) INNER JOIN _FREGUESAS 
    ON GVAL_BEM.AVAB_DCF = _FREGUESAS.F_Codigo
    WHERE (((GVAL_PEDIDOS.AVAP_dtEnvio)>=@P1) 
          AND ((GVAL_PEDIDOS.AVAP_Status)=7) 
          AND ((GVAL_PEDIDOS.AVAP_Origem)='7521'));

    Remove the SELECT in front of your CASE Expression, then it should work =>
    PROCEDURE [GetInfo_ASN]
    @P1 smalldatetime -- Data de Entrada
    AS
    BEGIN
    SET NOCOUNT ON;
    SELECT
    dados.dbo.GVAL_PEDIDOS.AVAP_Id AS [Reg SIGA],
    dados.dbo.GVAL_BEM.AVAB_Codigo AS [Cod Bem],
    case when (SUBSTRING([dados.dbo.AVAB_Codigo],5,1)="0")
    then Right([dados.dbo.AVAB_Codigo],6)
    else (SUBSTRING([dados.dbo.AVAB_Codigo],5,1) & Right([dados.dbo.AVAB_Codigo],6))
    end as [UE/UL],
    dados.dbo.GVAL_PEDIDOS.AVAP_dtEnvio AS [Dt Envio],
    dados.dbo._FREGUESAS.F_Distrito AS Distrito,
    dados.dbo._FREGUESAS.F_Concelho AS Concelho
    FROM (dados.dbo.GVAL_PEDIDOS INNER JOIN dados.dbo.GVAL_BEM
    ON GVAL_PEDIDOS.AVAP_Codigo = GVAL_BEM.AVAB_Codigo) INNER JOIN _FREGUESAS
    ON GVAL_BEM.AVAB_DCF = _FREGUESAS.F_Codigo
    WHERE (((GVAL_PEDIDOS.AVAP_dtEnvio)>=@P1)
    AND ((GVAL_PEDIDOS.AVAP_Status)=7)
    AND ((GVAL_PEDIDOS.AVAP_Origem)='7521'));
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for

  • Avoiding Logical Loop Error while defaulting values

    Hi Experts, We have a requirement where lets say Attribute A and Attribute B are displayed on the screen, we need to default value for Attribute B to NA if value of Attribute A is set by the user to "XYZ", else whatever value user enters in Attribute

  • Java.io.IOException: Permission denied

    Hi All, Having a bit of trouble out of a school project. I need to save information to an XML file and read from it and put those values into fields. Writing to the file is no big deal, however I get a Permission Denied error when I attempt to read t

  • Table Link between the Functional Location and work order

    Hi Gurus, I am stuck in a big problem and have to find a way to list down the work order with a specific user status in the system. I am trying to link it based on the functional location as the inputs will have to be functional location and the date

  • Can Firefox os be developed to run on old Nokia handsets.

    Handsets like Nokia 5800, n8, x7, e7...etc.

  • Install Aperture From App Store On Multiple Machines?

    Hi.. Can anyone help with this question? I own a hard copy of Aperture 2 and I'm considering buying Aperture 3 from the App Store. I have a 17" MBP for portability plus another machine back at base. If I buy the App whilst on my 17" MBP, it will be a