String returned when no line is found

All,

I have a query based on a table that returns at most only 1 row due to pk filter, but now I want to add as (select 'Generic' of the double) If no line is returned from the table the main tableEmp, then how do about it? Pls remember I want to use a proc/pkg etc I want just a query statement / select pure.

Oracle 11g,

Thank you all.

with your_query as (
  select ename
  from scott.emp
  where empno=99999
)
select nvl(ename,'Generic') ename
from DUAL D
  left outer join your_query on (1=1);

Tags: Database

Similar Questions

  • Empty string returned after receipt gpib

    Nobody knows why, I would periodically get an empty string returned after the issuance of a receive().  It is originally a big delay in my program that I can't really afford to have. The delay occurs while the front desk manages the empty string. This sequence works fine most of the time.

    VB code:

    Public void GetData (GPIBAddress, SendString) As String
    Dim ReadThis AsString, RPD As Integer, ReadTemp As String
    read:
        
    Call Send (0, GPIBAddress, SendString, NLend)
    Wait (500)
    Call ReadStatusByte (0, GPIBAddress, RPD %)
        
    ReadThis = Space$ (140)
        
    Call Receive (0, GPIBAddress, ReadThis, STOPend) I get an empty string here, not always.
        
    If Trim (ReadThis) = "" then to correct, I issue this sequence.
    Call DevClear (0: 26)
    GoTo review
    End If
        
    GetData = ReadThis
    End Function

    OR SPY:

    See attachment.

    I'm talking to a Keithley 2612.

    I use NI488.2 2.73

    In your code snippet, I see where you made a ReadStatusByte, but the result is not checked. When considering the capture of Spy file, where the reception work, the ReadStatusByte returns the result of "0 x 04", as noted in the attached bitmap, ReadStatusByteWithMAV.gif. This result is known as the VMR (Message available) bit. If 4 (MAV bit) Bit is set, which indicates that there is something in the output queue which can be read. Information about the parameters of the ILO for a Keithley 2612 can be found starting on Page 655 by the section called, Status byte and service request (SRQ) in the reference manual. Here is a link to the reference manual:

    http://www.Keithley.com/data?asset=52057

    In the case of the reception fails (line 63 in the capture file), result of the previous call of the ReadStatusByte was '0x00' (as shown in the attached picture, ReadStatusByteNoMAV.gif), which means that there was nothing in the output queue to read.

    After a ReadStatusByte, you should check the result to see if there is something in the output queue to read. If the result is "0x00", then you can probably do something like add a delay and keep control of the ReadStatusByte again until the ReadStatusByte is back with 4 bits set. When Bit 4 is set, you can do a front desk to read the output queue.

    Hope this information is useful.

  • Search for value in the subset of data and returns a single line.

    Hello

    I wonder if you can help me with a query.

    I want to return a single line of data below

    where the Rno = 1 but also include a column to indicate a code of T555 tran was found in the subset (based on customer no)

    I used an analytic function (row_number) to enter the data in the following order and wonder if there is something similar for helping me understand the transaction code.

    Customer without Tran Code TranDate NWR

    1 T345 01/01/2001 1

    1 B455 01/01/1999 2

    1 T555 01/01/1998 3

    1 R433 01/01/1997 4

    1 "T543" 01/01/1996 5

    Thank you


    SQL> with t
      2  as
      3  (
      4  select 1 client_no, 'T345' tran_code, to_date('01/01/2001', 'dd/mm/yyyy') trandate, 1 rno
      5    from dual union all
      6  select 1 client_no, 'B455' tran_code, to_date('01/01/1999', 'dd/mm/yyyy') trandate, 2 rno
      7    from dual union all
      8  select 1 client_no, 'T555' tran_code, to_date('01/01/1998', 'dd/mm/yyyy') trandate, 3 rno
      9    from dual union all
     10  select 1 client_no, 'R433' tran_code, to_date('01/01/1997', 'dd/mm/yyyy') trandate, 4 rno
     11    from dual union all
     12  select 1 client_no, 'T543' tran_code, to_date('01/01/1996', 'dd/mm/yyyy') trandate, 5 rno
     13    from dual
     14  )
     15  select client_no
     16       , tran_code
     17       , trandate
     18       , rno
     19       , case when t555_cnt > 0 then 'YES' else 'NO' end t555
     20    from (
     21            select t.*
     22                 , count(decode(tran_code, 'T555', 1)) over() t555_cnt
     23              from t
     24             where client_no = 1
     25         )
     26   where rno = 1;
    
     CLIENT_NO TRAN TRANDATE         RNO T55
    ---------- ---- --------- ---------- ---
             1 T345 01-JAN-01          1 YES
    
    SQL>
    
  • Add LogFilter match string for the subject line of the e-mail notification

    Hello

    On the LogFilter alerts, I add the matching string in the subject line of the e-mail logfilter alert notification. I followed KB 75058 for this requirement. But I'm getting other data also with the match string. Please find the attached screenshot. The chain is marked in yellow. I don't need data which is marke red din. Can you let me know if a setting can be done in the script that retrieves the hitstring so that only the histstring appear

    FMS: 5.6.4

    Kind regards

    Roshan.

    Additional accessories:

    Hi Roshan

    We do something similar.  We have configured a Message appropriate for each matching string user:

    Then, in the rule Condition, I created an expression UserError containing the following:

    def controls = checkObservationAlarms (#LogFilter_ErrorVerbose to 1ms #,)

    {the entry->

    If (entry.get ("Severity") == "WARNING") {}

    return 2;

    }

    If (entry.get ("Severity") == 'CRITICAL') {}

    return 3;

    }

    If (entry.get ("Severity") == "FATAL") {}

    return 4;

    }

    return 0;

    },

    {entry, severity-> {switch (severity)}

    case 2:

    Return entry.get ("User_Message");

    case 3:

    return "" + entry.get ("User_Message") + "";

    case 4:

    return "" + entry.get ("User_Message") + "";

    by default:

    Return ' ';

    }}, @foglight_rule_id);

    If (checks.size () > 0) {}

    return checks [0] [1];

    } else {}

    Return ' ';

    }

    By referencing @UserError in the subject line, I get the Message to the appropriate user.

    I also do a similar thing for the severity of error appropriate in my subject line.

    Hope this helps

    Brian

  • How to filter data according to internal application and in case if returns nothing outside the query must return all the lines

    create table ab (a number, b varchar2 (20));

    Insert into ab

    Select rownum, rownum. "" sample "

    of the double

    connect by level < = 10

    create table bc (a number, b varchar2 (20));

    Insert into BC.

    Select rownum + 1, rownum + 1 | "" sample "

    of the double

    connect by level < = 10

    Select * AB

    where b in (select b BC where b = "2sample")

    This query will return me 1 row, but there are cases where the value of the parameter b is null

    and that it should return all rows in the table

    as

    Select * AB

    where b in (select b BC where b = "2sample")

    which return specific values, but I want to change in a way when the inner query returns nothing then outer query should return all the lines and works as

    Select * AB;

    Is it possible to put in a single query

    Hello

    You seem to ask for different things.  You want all the lines AB when

    1. The parameter ("2sample' in the example) is NULL, or when
    2. There is no corresponding row in the 2 tables (which could happen even if the parameter is not NULL)

    ?

    Assuming you want the option 2, here's one way:

    WITH got_rnk AS

    (

    SELECT ab.*

    DENSE_RANK () (ORDER IN CASE

    WHEN b (IN)

    SELECT b

    BC.

    WHERE b = "2sample" - parameter

    )

    THEN "A".

    OF ANOTHER 'B '.

    END

    ) AS rnk

    AB

    )

    SELECT a, b

    OF got_rnk

    WHERE rnk = 1

    ;

    This does not assume b is unique in each table.

    Thanks for posting the CREATE TABLE and INSERT statements; It is very useful.

  • How to automatically complete a transitional according to the value of another attribute when attribute line is questioned in the VO?

    Hello world

    The task seems simple enough, but I have not found a way to populate an attribute transitional according to the value of another attribute when the line is queried. What is the best way to achieve this?

    Thank you.

    James

    Use VORowImpl, if you have any transient attributes defined in the view object, whose value is derived from other attributes of the line, you can override the GET method and add logic there

    Please note that this class represents a row in the results collection in a display object.

  • The error message "no more virtual tiles can be allocated" appears when I try to use the effects in the quick edit mode in my 13 elements. The OK wand has to press several times for loading all effects models. The error returns when selecting th

    The error message "no more virtual tiles can be allocated" appears when I try to use the effects in the quick edit mode in my 13 elements. The OK wand has to press several times for loading all effects models. The error returns when you select the particular model.

    The problem does not appear, if PH 13 items is run in administrator mode.

    The available computer resources are rather big enough: INTEL CPU i7 4 cores, 16 GB RAM, 1 TB HDD + 32 GB SSD, Windows 8.1.

    Please, advice how to fix this problem? Perhaps, there is patch or update available?

    I had this problem with some of the choices menu in PSE13 when my drive to work was only a SSD with 53 GB of free space. I assigned a second disc of work (my data disc with ~ 2 TB of free space) and the error disappeared.

    Scratch disk settings can be found under preferences / Performance.

  • How to return to the line in the text field

    I created a form with a text field, but by filling out the form, the words don't word wrap, but just go in a single line across the field to text box.

    When can I format the text box for the return to the line?

    TKS

    Under the Options tab of the Properties dialog box, you can set the Multiline field.

  • How to pass an xml CDATA in the string element when OSB call a webservice?

    How to pass an xml CDATA in the string element when OSB call a webservice?

    I have a business service (biz) this route to exploitation of a Web service.

    An example of this legacy Web service request:
    < soapenv:Envelope xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/' xmlns: ex = "example" >
    < soapenv:Header / >
    < soapenv:Body >
    < ex: run >
    < ex: arg > <! [CDATA [< searchCustomerByDocumentNumber >
    < documentNumber > 12345678909 < / documentNumber >
    [[< / searchCustomerByDocumentNumber >]] > < / ex: arg >
    < / ex: run >
    < / soapenv:Body >
    < / soapenv:Envelope >

    type ex: arg is a string.

    How to pass this structure CDATA webservice in OSB?

    Steps to resolve this problem:
    1 create an XML schema. For example:


    elementFormDefault = "unqualified" >


              
                   
                        
                             
                             

                        

                        
                             
                        

                   

         

         

         
         

    With this XSD, XML can be generating:


    documentNumber

    2 create an XQuery query to create a ComplexType searchCustomerByDocumentNumber. For example:
    (: pragma bea: element global-element-return = "searchCustomerByDocumentNumber" location = "searchCustomerByDocumentNumber.xsd" ::))

    declare namespace xf = "http://tempuri.org/NovoSia/CreateSearchCustomerByDocumentNumber/";

    declare function xf:CreateSearchCustomerByDocumentNumber($documentNumber_as_xs:string)
    as {(searchCustomerByDocumentNumber)}

    {$documentNumber}

    };

    declare the variable $documentNumber as XS: String external;

    XF:CreateSearchCustomerByDocumentNumber ($documentNumber)

    3. in your step in proxy pipeline add to assign the created the XQuery function call from the number of the document of your payload.
    Assign to a variable (for example: called searchCustomerByDocumentNumberRequest)

    4. create an another Transformation of XQuery (XQ) to create a request to the existing Web service. For example:
    {fn - bea: serialize ($searchCustomerByDocumentNumberRequest)}

    For more information about xquery Serialize function:
    41.2.6 fn - bea: serialize()
    You can use the fn - bea: serialize() function if you need to represent an XML document as a string instead of as an XML element. For example, you can share an XML document through an EJB interface and the EJB method takes the string as an argument. The function has the following signature:

    FN - bea: serialize($input as item()) as xs: string

    Source: http://docs.oracle.com/cd/E14571_01/doc.1111/e15867/xquery.htm

  • plugin VMware update manager returns with "the remote server returned an error: (404) not found."

    Hello

    We have recently updated our virtual Center Server to version 4 and now when I try to download and install from the page manager plugin vmware update manager plugin is back with "the remote server returned an error: (404) not found"

    Has anyone had this problem before and eventually worked out how to fix this?

    Gregg Robertson, VCP, MCSE, MCSA, MCTS, MCITP

    You are welcome!!

  • single-line subquery returns moret one line han

    UPDATE T74
    SET LORRYOWNERNAME = 'BELLA. "
    OWNERFATHERNAME = "GHANIMIYA"
    AND
    (SELECT T74 INVOICEDATE, T74A WHERE T74.) REFERENCENO = T74A. REFERENCENO AND T74. "LORRYNO ="KA05AA4916"AND INVOICEDATE > = February 25, 2011")
    = February 25, 2011 "
    my inner query returns 5 rows ihave to update only the data that are greater than 25 February 2011"
    not below when I use > = any it updates all rows, if I removed everything he is in error:
    single-line subquery returns moret one line han


    could you please correct the query

    Published by: 848525 on Sep 7, 2011 12:18 AM

    Try

    UPDATE T74
    SET LORRYOWNERNAME='BASHA',
    OWNERFATHERNAME='GHANIMIYA',
    PANNO='AGNPD4113G'
    WHERE LORRYNO='KA05AA4916'
    AND exists
    (SELECT INVOICEDATE FROM T74A WHERE T74.REFERENCENO=T74A.REFERENCENO  AND INVOICEDATE>='25-FEB-2011') 
    

    do not duplicate the post please

    Published by: Alexandr Sep 6, 2011 23:52

  • Assign activity erros with the XPath query string returns multiple nodes.

    It comes to xml message we have with two elements < corecom:BusinessScopeReference > inside. How to assign the first < corecom:BusinessScopeReference > value of the other variable in the string.


    < variableentree >
    < xmlns:corecom fault = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2" xmlns:default = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2" xmlns = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2" >
    < corecom:EBMReference >

    < corecom:BusinessScopeReference >
    < corecom:ID xmlns = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/CustomerParty/V2" xmlns:ebo = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/CustomerParty/V2" >
    Account: NUANCE (AIMA 17N9IL) < / corecom:ID >
    < / corecom:BusinessScopeReference >

    < corecom:BusinessScopeReference >
    < corecom:ID xmlns = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/CustomerParty/V2" xmlns:ebo = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/CustomerParty/V2" >
    CREATECUSTOMERPARTYMSG/39303832313732363632373734303732 < / corecom:ID >
    < / corecom:BusinessScopeReference >

    < / corecom:EBMReference >
    < / failures >
    < / variableentree >


    When I use the sub element assign, I get the error: "XPath query string returns multiple nodes." How to point to the specific element in the table.


    < assign the name 'AssignId' = >
    < copy >
    < variable from = part "Variableentree" = "Fault."
    Query = "/ corecom:Fault / corecom:EBMReference / corecom:BusinessScopeReference / corecom:ID" / >
    < variable = "business_object_name" / >
    < / copy >
    < / assign >


    Please suggest.

    Check if this useful BPEL foreach

  • FIRST analytical functions returns the null line

    The following query returns a null line when there is no such thing as a line for the predicate. Is it a bug or expected behaviour. If so what is the meaning of the null row, is it not logical?



    SELECT NVL (max (ah.fyr_end_dt) KEEP (DENSE_RANK FIRST ORDER BY ah.as_of_dt DESC), ' RETURNED NULL')
    Of account_history ah
    WHERE
    Ah.acct_id = 999
    AND trunc (ah.as_of_dt) < = 31 December 08 '
    ;

    Hello

    user4900730 wrote:
    Moreover, in my example how I distinguish the case where a line really exists, but the column is null when there is no such thing as a line and the FIRST function returns the same value null? Hopefullly I should be able to do it in a single SQL and know the difference?

    COUNT (*) > 0, but COUNT (col_x) = 0, then there is a line, but col_x happened to be null.

    For example, the following query shows that there is 1 row in the group with the lowest name ("ADAMS"), but the column comm in all ranks of this group is null:

    SELECT     COUNT (*)    KEEP (DENSE_RANK FIRST ORDER BY ename)
                              AS total_cnt
    ,     COUNT (comm) KEEP (DENSE_RANK FIRST ORDER BY ename)
                              AS comm_cnt
    FROM     scott.emp
    ;
    

    Output:

     TOTAL_CNT   COMM_CNT
    ---------- ----------
             1          0
    

    The employee whose highest name ("WARD") has a number in the comm column.

  • I can't get the tabs of the previous session of the return when I reopen it Firefox. The header of the window, or 'Quit' in the file Menu using 'Close' of Firefox not working. Note that "Restoration of previous Session" on my Menu history is grayed out so

    Question
    I can't get the tabs of the previous session of the return when I reopen it Firefox. I tried closing with 'Close' header of Firefox window, but also 'Quit' in the file Menu. Note that "Restoration of previous Session" on my Menu history is grayed out so I can't use it. In addition, there is no tab at the top of my window to open Firefox Firefox - only a menu bar that shows "File", "Edit", "View", "History", "Favorites", "Tools" and "Help". I am running Windows 7 Home Professional and Firefox 4.01

    "I can't do the tabs from the previous session of the return when I reopen it Firefox.

    Remember that you are not private browsing or they are in permanent private browsing mode. See: https://support.mozilla.com/en-US/kb/Private%20Browsing (2nd and 3rd options menu on this page)

    Make sure that you are not clearing history during a session or when Firefox is closed. See:

    • Clear recent history: https://support.mozilla.com/en-US/kb/Clear%20Recent%20History
    • Clear history of Firefox closing: uncheck 'Clear history of Firefox closing' options > Privacy panel (the first item under "History" on this Panel should be set on "Firefox will be: use the custom settings for history" to see that point to uncheck)

    "There is no Firefox tab at the top of my Firefox window open - only a menu bar.

    The Firefox button is supposed to be on by default in Vista and Windows 7.

    In Firefox 4, you have the choice of using the Firefox (orange or grey) button in the upper left or the menu bar (File, Edit, View, history, Favorites, tools.) Help).

    • The selections on the Firefox button are distinguished by the menu bar options.
    • You can easily switch between the Menu bar and the Firefox button or leave one or the other active.
    • One used depends on if the Menu bar is enabled
      • Bar menu checked = Bar Menu on, Firefox off button
      • Bar menu unchecked = Menu Bar off, Firefox button on

    When the Firefox button appears and you want to temporarily view and use the menu bar, press ALT or F10 displays the menu bar and you can make your selections in the Menu bar displayed temporarily.

    To check (or uncheck) the menu bar, do one of the following:

    • using the Firefox button: click on the Firefox button > Options > Menu bar
    • using the Menu bar: click on view > toolbars > Menu bar
    • Hold DOWN the ALT key while pressing the VTM keyboard letters
  • is it possible to put in place a control of the event in labview to create a string indicator when you press a button

    I'm trying to implement a user interface where an operator can set the column headers for a report and I use indicators of the string as the placement for the text in the column headers.  Given that many of them will have experience with Labview, I was hoping to set a button with the ability to add or possible delete a string indicator when you press.  Is it possible to set up an event like this?

    You cannot create an indicator of the string, but you can change the visibility of the existing volumes.

    For example, you can display an indicator of the string, giving the impression that his creating.

    /Y

Maybe you are looking for

  • Apple remote activated iTunes on my computer while I'm sailing in Apple TV

    Apple remote activated iTunes on my computer while I'm sailing in Apple TV So when I try to navigate the Apple TV using my apple remote, my computer meets her while she sleeps, and the screen is closed. Is it possible that I can get the computer stop

  • Qosmio X 770-Crash Dump when the games

    Hope this is the right forum for this. I am retired and have minimal knowledge of technology, although I've used them for many years. In the 5-6 months, I get a crash dump on my laptop whenever I enter a game when the computer is turned off. I only p

  • SCART VGA cable

    So, I have a HP 550 with only the VGA output and a computer with connection SCART and S-video only! Y at - it something like VGA to SCART or S-Video?

  • System Restore is no longer available.

    When I go to 'Start' / restoration of the system, the dialog box displays "System Restore's protection is no longer your computer." Restart and try again. "I made several and restarted, with always the same result. How can I activate SR again? TIA

  • 'Windows 7 Build 7601 this copy of windows not genuine' how to fix this?

    I have an original windows 7 Professional and I get this message that it is not authentic. I have a run Diagnostic tests and here is the result. What it means? Diagnostic report (1.9.0027.0):-----------------------------------------Validation of Wind