Subquery returns the same value but no returnet lines

HY all

First of all excuse me for my English. I know that is very bad.

I have a very annoying problem...

I habe a query like this

Select the car of cars where car_color = (select color color where car_id = '5452')

My real Qery is mor complicated, but this is how it works.

Now the problem:

If I run the first query select car of cars where car_color = 'black' the query returns a value.

If I run the subquery *(select color from Colors where car_id ='5452') * the subquery returns a value (black)

If I run the query and subquery select car of cars where car_color = (select color color where car_id = '5452')
I get no value :(

How this bee? If I take the (black) result of the subquery, and paste of STIs in the first request, then I get a value.
But if I use the two querys it works.

Thank you for your support

Welcomes Burillo

user13568585 wrote:

I can see that the results are not the same, but how can it happen?
Without your thing, I'll never be able to see the problem. Toad is really stupid as I think?

It has nothing to do with the toad. You will get the same results in SQL * more. Most of the tools on the client side display the nonprinting characters such as spaces. And in your case, string returned by the subquery has had new line at the end. Anyway, the other way to understand would compare dumps of returned strings:

select DUMP(LTRIM(RTRIM(rem.PSTREM_KURZ_BEZ))) from p_pveps_episode eps,  p_pvrep_re rep, p_strem_rechempf rem
WHERE
eps.allmnd_mandant='Test' and
eps.ppveps_aufnr='101224' and
eps.allmnd_mandant=rep.allmnd_mandant and
eps.ppveps_epsnr=rep.ppveps_epsnr and rep.pstrem_ident=rem.pstrem_ident -- {and ltrim(rtrim(rem.PSTREM_KURZ_BEZ)) =} quotet to show result

SY.

Tags: Database

Similar Questions

  • : Nom_element and V ('ITEM_NAME') do not return the same value

    Hi all

    I'm developing a shared application process that is called by an AJAX request.

    For the pl/sql code, stored procedure validation e development support I moved the logic inside a database.
    So I have this situation:

    Application process

    ...
    : MYITEM: = wwv_flow.g_x01; -received setting of ajax call I want to put
    ...
    MY_FUNCTION();

    MyFunc

    ...
    v('MYITEM') - here I use value MyItem
    ...

    The problem is that when I call v ('MYITEM') the value I get is the previous and not one that I put with: MYITEM: = wwv_flow.g_x01;
    I have the same problem if I set the V ('MYITEM') inside the apex application process.

    I saw that it worked right if I use the following to set the value of the element in the application process:

    APEX_UTIL. SET_SESSION_STATE('P0_LST_DATA',:P0_LST_DATA);

    Is this a bug?
    I was expecting to get the value of the item: MONELEMENT and v ('MYITEM') are equivalent...

    Thank you
    Davide

    Davide,

    If you encode the block like that, you should get the results you expect:

    : P100_VAR1: = '1'. : P100_VAR1;
    : P100_TEST: =: P100_VAR1;

    The reason why this block does not give you what you expect:

    : P100_VAR1: = '1'. : P100_VAR1;
    : P100_TEST: = v ('P100_VAR1');

    ... is that v ('P100_VAR1') returns the current value of the item in the table of PL/SQL State session as it existed before the execution of the block. The assignment to the variable binding: P100_VAR1 has registered only a value in storage variable to bind the dynamic execution at this time and has not yet spread to session state, which is located at the end of the execution of the block. It's a little weird, we know.

    Andy,

    I figured that the: xxxx points have been settled during the loading of the page with what the source is...

    They contain the session state value and can be read or written in notation variable bind.

    However, they are updated only in the session when you send page...

    They are updated in session state when the particular block is completed and a commit is issued at this time there.

    In order to update a piece of code PL/SQL session state, you must use... apex_util.set_session_state.

    You must be careful to call it when scoring also bind variable to set the session state may cause one to deny the other. Using one method or the other should work very well.

    Scott

  • decrypt not returns the same value that encrypt

    Hi all
    Please help if you have encountered this problem before or have any brilliant suggestion to my question below.

    I try to encrypt the value "4120166668", insert in the database, and then decipher that it appears on the system. It seems that the value "4120166669" appears. Build an example of code that is not complete database, and it still does not work.

    But if I exert the ToBase64() function then encrypt, as well as decrypt and then run tostring (tobinary ()), it works. The thing is, if I change that, the rest of encryption is stored in the database will have error when the display on the system because it uses the same encrypt and decrypt the value.

    How should I go about this? Does anyone have suggestions or other ways? And I really want to know what causes this problem to occur.

    See you soon,.
    Jamie

    delete the part of the encrypted value (chr 10/newline at the end of the value). Delete this Trim() and you can convert without problem.

    CR

  • VecMath.intersects () returns the false value, but intersect line segments

    VecMath.intersects (309, 262, 311, 269, 314, 266, 295, 266);

    Returns false. Why?

    THX

    THX.

    I have found a workaround at the same time, I guess

    VecMath.intersects (ax0 ay0 ax1, ay1, bx0, by0, BX 1, by1) |
    VecMath.intersects (bx0 by0, BX 1, by1, ax0, ay0, ax1, ay1);

    will do the job.

  • return the same value defined in a group.

    All,
    I have the below requirement,

    I had a table (deptid, deptname, address, city, zip, State, other columns) I want to write a query to determine any errors (records with different values) because I expect all records grouped by(deptid, deptname, address,city,zip, state) to have the same deptid (Please note that deptid is not unique).

    or a specific deptid should have only one record based on the groupping (deptid, deptname, address, city, State, zip).

    any suggestion? Thank you.

    One way to check is to check for a Unique Deptid deptname combination, address, city, zip, State;

    In this way, you will get all the combination deptname, address, city, zip, Associate State with more than 1 dept_id. However, if one of these have different value, then you are bound to get several lines and thus false positives.

    select deptname, address,city,zip, state, count(distinct dept_id)
      from dept_table
    group by deptname, address,city,zip, state
    having count(distinct dept_id) > 1
    

    How about you, you give us the structure of the Table and a few examples of data as well as the expected release of him. It will help us giving you the good request that fits your needs.

  • NotificationsDialog returns the same value for the two buttons

    I have a NotificationsDialog with two SystemUiButtons, now when I click on buttons and console the result they both return the number two, I don't really understand why.

    {NotificationDialog}
    ID: alertdialog
    Title: "Alarm" - + alarmTime
    body: Setting.get ("alarmCompletedMessage")
    repeat: true
                
                    
    buttons:]
    {SystemUiButton}
    label: "Stop".
    },
    {SystemUiButton}
    label: "Snooze."
    }
    ]
    onFinished: {}
    Console.log ('result' + result)
    Console.log (Error)
    }
    }

    Is there a better way to identify which button has been activated?

    Wish a little, she supported confirm and Cancel buttons, or SystemUIButtons have their own onClicked properties

    Thank you

    Use buttonSelection () instead of the result .label

  • 2 queries must return the same result (but they are not...)

    Hello
    I have a query:
    select col1,extract(year from datum) yr, COUNT(*)
    from tableA@dblink where
    DATUM between '1-jan-1985' and '31-dec-2012'
    and col2 > 100 and col2 not in ('999999')
    and TRIM(TO_CHAR(col1)) in ('0','1')
    group by col1,extract(year from DATUM);
    the query above returns the number: 143 982 for the year 1991
    However, when I put the filter directly in this year the request returns a different number: 143 917
    select col1,extract(year from datum) yr, COUNT(*)
    from tableA@dblink  where
    DATUM between '1-jan-1991' and '31-dec-1991'
    and col2 > 100 and col2 not in ('999999')
    and TRIM(TO_CHAR(col1)) in ('0','1')
    group by col1,extract(year from DATUM);
    Please can you help me understand why what is happening and why these 2 heads are different?
    ID appreciate any advice
    Thank you very much
    Rgds

    Try these...

    select col1,extract(year from datum) yr, COUNT(*)
    from tableA@dblink where
    trunc(DATUM) between to_date('1-jan-1985','dd-mon-yyyy') and to_date('31-dec-2012','dd-mon-yyyy')
    and col2 > 100 and col2 not in ('999999')
    and TRIM(TO_CHAR(col1)) in ('0','1')
    group by col1,extract(year from DATUM);
    
    select col1,extract(year from datum) yr, COUNT(*)
    from tableA@dblink  where
    trunc(DATUM) between to_date('1-jan-1991','dd-mon-yyyy') and to_date('31-dec-1991','dd-mon-yyyy')
    and col2 > 100 and col2 not in ('999999')
    and TRIM(TO_CHAR(col1)) in ('0','1')
    group by col1,extract(year from DATUM);
    
  • Mosaic Georaster does not return the same values as sources

    I have created a mosaic using the plsql block... and when you query the source and the mosaic I get different results...

    Any suggestions...

    Best regards

    Tagle Hugo

    -PLSQL

    DECLARE

    GR sdo_georaster;

    BEGIN

    INSERT INTO NED_MOSAIC (id, rast)

    VALUES (1, sdo_geor.init ('NED_MOSAIC_RDT'))

    RETURN rast IN gr.

    sdo_geor. Mosaic ("ned", "rast", gr, 'block size = (1024, 1024)', sdo_number_array(-100));

    UPDATE ned_mosaic SET rast = gr WHERE id = 1;

    END;

    /

    -QUERIES

    SELECT 'source' x, sdo_geor.getCellCoordinate (rast, 0, sdo_geometry (2001,4326, SDO_POINT (-80.290818, 25.753106, null), null, null)) cells.

    SDO_GEOR.getCellValue (rast, 5, SDO_GEOMETRY (2001, 4326, SDO_POINT (-80.290818, 25.753106, NULL), NULL, NULL), 1) elevation

    OF rm_ent.ned

    ---

    WHERE ned_ref_id IN (SELECT ned_ref_id FROM rm_ent.ned_ref

    WHERE sdo_relate (geom, SDO_GEOMETRY (2001, 4326, SDO_POINT (-80.290818, 25.753106, NULL), NULL, NULL), "mask = ANYINTERACT'") = "TRUE" ROWNUM AND < 2) AND ROWNUM < 2

    ;

    SELECT 'mosaic' x, sdo_geor.getCellCoordinate (rast, 0, sdo_geometry (2001,4326, SDO_POINT (-80.290818, 25.753106, null), null, null)) cells.

    SDO_GEOR.getCellValue (rast, 5, SDO_GEOMETRY (2001, 4326, SDO_POINT (-80.290818, 25.753106, NULL), NULL, NULL), 1) elevation

    OF rm_ent.ned_mosaic;

    -RESULTS

    X CELLS RISE

    ------ ----------------------------------------------------- --------------

    source MDSYS. SDO_NUMBER_ARRAY (2666,7659) 2.79998779

    X CELLS RISE

    ------ --------------------------------------------------------------------

    Mosiac MDSYS. SDO_NUMBER_ARRAY (35066,29259) 2.6000061

    Hi Hugo, you check the values of the cells on level 5 of the pyramid. You can check the original cell values to see what is happening?

    That is to say, change SDO_GEOR.getCellValue (rast, 5, SDO_GEOMETRY (...

    to SDO_GEOR.getCellValue (rast, 0, SDO_GEOMETRY (...

  • CFQUERY returns always the same value

    < name cfquery = "qryGetMAXID" datasource = "#Request.DSN #" >

    SELECT

    MAX (FLEET_CON_ID) + 1 as MaxFleetId

    Of

    CONFIGURATION

    < / cfquery >

    < cfset intFLEET_CON_ID = #qryGetMAXID.MaxFleetId #/ >

    < name cfquery = "qryAddOperator" datasource = "" #Request.DSN # "result = 'test' >"

    INSERT INTO

    CONFIGURATION

    (FLEET_CON_ID,

    COL2,

    COL3,

    COL4)

    VALUES

    (#intFLEET_CON_ID #,)

    "ADD OPERATOR."

    "#strCode, #

    ("#strName #")

    < / cfquery >

    the qryGETMAXID query always returns the same value as 18703. I inserted a few values in the database directly. the query should return 18705. When I run the same query in SQL Developer, it returns the correct value. I've not cached the query.

    Please help me.

    Thanks in advance

    Dan and Wolfshade,

    Thanks for the problem.

    I found the problem, then that I insert into the database, I didn't do it. He was thus the same value.

    Sorry...

  • get the index of the same values in table

    Hi guys,.

    I'm trying to get the index of array elements with the same value but it can solve mine.

    my case is:


    array1 = [1,2,3,4]; <-here are the names of the pages, always in the order of CSA (these table I used only to check the results of my work, probably will not be for you but maybe...)

    array2 = [1,1,2,2,2,3,4,4,4]; <-these numbers are random, but always in the CSA order (these are the names of pages for items in table 3)

    array3 = [a, b, g, i, f, e, c, h, d]; <-these are all the values of the elements I want to work with later. number of articles is still the same as in array2, their indexes are corresponding.

    array4 = [];

    I need to remove array3 everything, but one of each issue of array2 (as I will remove duplicates) or push to array4 an article of array3 for each number of the array array2 (as I'm going to ignore duplicates)

    don't know is my desc is clear enough, but the result I get is:

    ex. [a, g, e, c]

    above example for each number of array2 array3 items, but do not have to be first, can be second or third if etc exist, but have to be alone.

    I thought that if I get duplicate values, the index in the array array2 and delete this index in array3 will get what I want, but can not solve.

    You will appreciate all help.

    Thank you

    Try something like this:

    var array2 = [1,1,2,2,2,3,4,4,4];
    var array3 = ["a","b","g","i","f","e","c","h","d"];
    
    var tempArray = [];
    var resultArray = [];
    var n , x ;
    
    for(var n=array2.length-1;n>=0;n--)
    {
        var string = ""+array2[n];
        tempArray[string] = array3[n];
    }
    
    for(x in tempArray)
    {
        resultArray.push(tempArray[x]);
    }
    
    resultArray.reverse();
    // a,g,e,c
    

    Hope, that helps.

    Uwe

  • convert the column values to a single line...

    I have to return the column values to a single line separated by commas.
    If the nulls in the column just ignore without a comma.
    Here is one for example. There are three values and two NULL values in the table
    SQL> select ID from temp_fa;
    ID
    -----
    
             1
             2
    
             3
    
             5
    
    6 rows selected.
    
    
    I am expecting an output as 1,2,3,5
    Help, please

    There is always more than one title in the Oracle world ;)
    You can use the TRIM, for example (same configuration as your example):

    hoek&XE>  create table t as select level col  from dual connect by level <= 6;
    
    Tabel is aangemaakt.
    
    hoek&XE> update t set col = null where col in (1,3,5);
    
    3 rijen zijn bijgewerkt.
    
    hoek&XE> select * from t;
    
           COL
    ----------
    
             2
    
             4
    
             6
    
    6 rijen zijn geselecteerd.
    
    hoek&XE> select ltrim(sys_connect_by_path(col, ','), ',') output
      2  from  ( select col
      3          ,      row_number() over (order by col) rn
      4          from   t
      5        )
      6  where connect_by_isleaf=1
      7  start with rn=1
      8  connect by rn = prior rn+1;
    
    OUTPUT
    -------------------------------------------------------------------------------------------------------------
    2,4,6,,,
    
    1 rij is geselecteerd.
    
    hoek&XE> select trim ( both ',' from sys_connect_by_path(col, ',')) output
      2  from  ( select col
      3          ,      row_number() over (order by col) rn
      4          from   t
      5        )
      6  where connect_by_isleaf=1
      7  start with rn=1
      8  connect by rn = prior rn+1;
    
    OUTPUT
    -------------------------------------------------------------------------------------------------------------
    2,4,6
    
    1 rij is geselecteerd.
    
  • Satellite P300-156 - and the button Return give the same values

    Hello

    I have a satellite P300-156, and it has a numeric keypad.
    I have problems because the Enter key and the Return key give the same values. I believe that it is incorrect.
    Can anyone help.

    Key on the numeric keypad should give an input it does.
    the Enter key on the main keyboard should give a carriage return value, but it gives an input value.

    Usually this does not cause a problem, but with software like photo shop that makes the distinction between a carriage return and a hard fall it does not work.

    Can someone help me please

    Thank you

    Hello

    To my eyes the entry and return keys are the same keys that provides the same functionality.
    I really put t know why you believe that there is something not right

    By the way; Check if you are using the latest version of the BIOS!

  • inputText and ouputText does not display the same value

    Hello

    JDev 11.1.2.4

    On my page, I have an inputText and outputText bound to the same link of the attribute. The bind value is defined in a value change listener, and then the two components are updated. Say I put in 2009 for the PeriodFrom, the inputText remains empty, but the outputText shows the 2009. How is possible that the two items related to the same link does not show the same value.

    < af:inputText value = "#{bindings." PeriodFrom.inputValue}"required =" #{bindings. " PeriodFrom.hints.mandatory}.

    columns = "#{bindings." PeriodFrom.hints.displayWidth}"shortDesc =" #{bindings. " PeriodFrom.hints.tooltip}"id ="id1 ".

    autoSubmit = "true" simple = "true" >

    < f: validator binding = "#{bindings." PeriodFrom.validator} "/ >"

    < / af:inputText >

    < af:outputText value = "#{bindings." PeriodFrom.inputValue}"id ="ot3"clientComponent ="true"/ >

    Furthermore, I tried to get the RichInputText component and call a getValue on it, and the value returned is 2009. I'm completely lost.

    Thank you

    I made the fragment of page from scratch. I discovered why the update does not work. This is because the selectOneChoice is inside an af:subform. If I remove the subform, the update works correctly.

    shortDesc = "#{bindings." StdcntyCode.hints.tooltip}"id ="soc2"simple ="true"autoSubmit = 'true '.

    valueChangeListener = "#{pageFlowScope.identificationSessionEditBean.countryValueChangeListener}" > "

    columns = "#{bindings." PeriodFrom.hints.displayWidth}"shortDesc =" #{bindings. " PeriodFrom.hints.tooltip}"id ="id1 ".

    autoSubmit = "true" simple = "true" >

    columns = "#{bindings." PeriodTo.hints.displayWidth}"shortDesc =" #{bindings. " PeriodTo.hints.tooltip}"id ="id2 ".

    autoSubmit = "true" simple = "true" >

  • Need to show the same values in all jspx pages

    Hello.

    I use jdeveloper 11.1.1.5

    I had created a jspx pages such as dept.jspx and emp.jspx

    I've been using this in my jspx page
     <af:outputText value="#{bindings.return.inputValue}"
                               binding="#{pageFlowScope.backing_dept.ot1}"
                               id="ot1"/>
    The bindings.return.inputValue will return the value of the code below
        public String checkLoginCredentials1(String p_user,String p_pwd)
        {
        System.out.println(p_user + " " + p_pwd);
         ApplUsersVOImpl  vo = (ApplUsersVOImpl)this.getApplUsers1();
         /*set the bind variable value*/
        vo.setNamedWhereClauseParam("p_user",p_user.toUpperCase());
        vo.setNamedWhereClauseParam("p_pwd",p_pwd.toUpperCase());
        vo.executeQuery();
        int rowCount=vo.getEstimatedRangePageCount();
        System.out.println("rowCount="+rowCount);
        if(rowCount==0) 
        { 
           throw new JboException("Password doesn't match");
         }
           return "Welcome"+ "  " + p_user.toUpperCase();
        } 
    My scenario is that I need to display the same value in emp.jspx

    I had created a task flow frm dept.jspx to emp.jspx and emp.jspx to dept.jspx

    I tried the same XML file in my emp.jspx
    <af:outputText value="#{bindings.return.inputValue}"
                               binding="#{pageFlowScope.backing_emp.ot1}"
                               id="ot1"/>
    But while I m browsing frm emp.jspx to dept.jspx there are doesnot.,.

    This means that for the faces-config. XML (the standard JSF configuration file), there is no scope spanning application except for the scope of the session. This does not mean that you should not use extended session if you use faces - config.Xml.

    However, you have been advised to use the workflow and no faces - config.Xml.

  • Question of value Popup Lov key (description of the poster, returns the key value) by default

    Hello

    I have a Popup Lov key (description of the poster, returns the key value) and I want a default value. It is based on a list (user name, id).
    I tried to put the id of the user logged on as default, but what I see on the screen in the field is the value of the id, not the username.
    How can I pass the user id and see the user name?

    Thank you.

    Oh! My bad, I thought you are talking about regualt lOVs not popups.

    OK, so that's what you need to do, I tried it and it worked for me:

    your popup LOV > default > type: body of the PLSQL function > and enter a query like:

    declare
    UID number.
    Start
    Select user_id from the uid of the user
    where UPPER (username) = UPPER(:APP_USER);

    This should show username and retune userid.

    Hope this helps,

    Sam
    Please give good answers by marking correct or useful.

Maybe you are looking for