False result of decode within max()

hallo,
I'm using decode within a max() on an outer joined column. Further on, I'm outer joining multiple tables and therefore I'm executing a kind of the following query on my database (Oracle 10g R2). Finally, the query returns a false result:
Query:
select  max(t.TIME_ID), max(decode(s.promo_id, null,null, t.TIME_ID)) test_date
from    sales s
       ,times t
where   s.TIME_ID(+) = t.TIME_ID
  and   s.PROD_ID(+) = 22
  and   t.TIME_ID <= to_date('10021998', 'ddmmyyyy')
order by t.time_id;Result:
MAX(T.TIM TEST_DATE
10-FEB-98 31-JAN-98If you omit the aggregate functions, you can see that the result is not correct:
31-JAN-98 31-JAN-98
31-JAN-98 31-JAN-98
01-FEB-98
02-FEB-98 02-FEB-98
03-FEB-98 03-FEB-98
03-FEB-98 03-FEB-98
04-FEB-98
05-FEB-98
06-FEB-98
07-FEB-98 07-FEB-98
08-FEB-98 08-FEB-98
09-FEB-98
10-FEB-98 10-FEB-98
10-FEB-98 10-FEB-98Can anyone help me?
Thanks

Martin_H. wrote:
For instance, how do you write this query in ANSI syntax without adding the column PROD_ID into the on clause and avoide breaking the outer join:
select  t.TIME_ID, s.time_id
from    times t
,sales s
where   t.time_id = s.time_id(+)
and   s.PROD_ID(+) = 22If you use the ANSI syntax and exclude a column from the on clause it will break the outer join. I personally exclude any column from the on clause, which definitely stands not for a join column and therefore I do not know how to use the ANSI syntax for outer joins without breaking them.
select  t.TIME_ID, s.time_id
from    times t
left outer join sales s on (t.time_id) = ((s.time_id))
where   s.PROD_ID = 22  // how to tell oracle to outer join s.prod_id within the where clauseRegards,
Martin
Edited by: Martin_H. on 30-Jul-2010 02:01Ah I see your problem. But you are restricting yourself by saying that the condition should not belong into the ON clause. This would be the usual solution.
However this is not a technical restriction because of the ansi syntax but a restriction that you impose upon you by yourself.
how to tell oracle to outer join s.prod_id
select  t.TIME_ID, s.time_id
from    times t
left outer join sales s on t.time_id = s.time_id and s.PROD_ID = 22I think this is abosolutly ok to write it like that. From a logic point of view it means:
Find all times and show me if there had been sales for product 22.
what should also work is
how to tell oracle to outer join s.prod_id within the where clause
select  t.TIME_ID, s.time_id
from  times t
left outer join sales s on t.time_id = s.time_id
where (s.PROD_ID = 22 or s.PROD_ID is null)It means:
Find all times and show me if there had been sales
I only want to see sales for product 22.
Edited by: Sven W. on Jul 30, 2010 11:09 AM

Similar Messages

  • How to get result of HTTPService within a function?

    Hello all,
    I'm trying to call an HTTPService's send() and get the
    resulting data from within a function, and assigning it locally.
    Specifically, this is what I want:
    private function getData():void {
    myRPC.send();
    //How do I set the result of myRPC.send to a variable here?
    // Neither myRPC.send().result, nor myRPC.lastResult works! I
    get null both times!
    // But if I set myRPC.result to a separate function that
    handles an event, I get the correct data...but not what I want.
    var myObject:Object = ???? myRPC.???
    <mx:HTTPService result="???" fault="???" id="myRPC"
    method="GET" resultFormat="e4x" url="someurl" useProxy="false">
    <mx:request xmlns="">
    <somedata>hi</somedata>
    </mx:request>
    </mx:HTTPService>
    I am also not sure what to put in 'result' and 'fault' since
    I don't want the result/fault to be passed to another
    function...could anyone explain this please? Thanks!

    "Hamshmam" <[email protected]> wrote in
    message
    news:g70olu$jcd$[email protected]..
    > Hi Greg,
    >
    > While this is not what I am looking for, thanks for your
    response.
    >
    > I am familiar with traditional HTTPService requests and
    passing the
    > resulting
    > event to a function handle directly and then modifying
    the object from
    > there.
    > However, as I described in my earlier post, I'm looking
    for a way to get
    > the
    > resulting event of the HTTPService.send() within a
    different function.
    >
    > I am doing this because if I have another function
    dependent on the
    > HTTPService.send()'s data, I cannot simply call the
    HTTPService.send()
    > from
    > within that function and update a class private var with
    the data, which I
    > access from the wrapping function. This is because the
    HTTPService is by
    > nature
    > asynchronous, so it is possible that the class private
    var will remain
    > null
    > while further lines of code are executed, all the while
    the HTTPService is
    > interacting with the server concurrently.
    >
    > I hope it is clear now why I need to assign the result
    of a HTTPService
    > result
    > directly within a function, if you or anyone else could
    shed some light on
    > that, I would appreciate it! Thanks for your response.
    http://www.johnwilger.com/2007/03/future-value-pattern-in-actionscript-3.html

  • Picking returns false results when aspect ratio is different from 1:1

    Hi,
    When using picking with perspective projection when the aspect ratio is different from 1:1 I get false results.
    Any idea how to fix it ?
    Thanks
    Ophir
    Following is the related code:
    // For the perspective projection
    Transform3D prespective = new Transform3D();
    prespective.perspective(hFov, Math.tan(hFov/2)/Math.tan(vFov/2), 1f, 30f);
    view.setProjectionPolicy(View.PERSPECTIVE_PROJECTION);
    view.setLeftProjection(prespective);
    // Picking code
    Point3d eye_pos = new Point3d();
    Point3d mouse_pos = new Point3d();
    canvas.getCenterEyeInImagePlate(eye_pos);
    canvas.getPixelLocationInImagePlate(x, y, mouse_pos);
    Transform3D motion = new Transform3D();
    canvas.getImagePlateToVworld(motion);
    motion.transform(eye_pos);
    motion.transform(mouse_pos);
    Vector3d direction = new Vector3d(mouse_pos);
    direction.sub(eye_pos);
    PickRay ray = new PickRay(eye_pos, direction);

    I tried to download the FireFox setup from both locations you mentioned. I could not reproduce your problem. Always the same file with the same MD5 hash:
    C:\tmp>md5sum "Firefox Setup 18.0.2.exe
    181ac7211db54e793845e8c7216c1a8b *Firefox Setup 18.0.2.exe
    Is it still reproducible from your location? Where are you located?

  • Unexpected Result Sets by Changing MAX to MIN

    I was expecting the identical result sets from the following two SQL statements:
    SELECT HIST.LDR_SYSTEM_ID "MISSING SYSTEM PK"
    FROM GM_SYSTEM_HIST HIST
    WHERE HIST.SYSTEM_HIST_ID = (SELECT MAX (DUPL.SYSTEM_HIST_ID) /* SYSTEM_HIST_ID is the PK for GM_SYSTEM_HIST */
    FROM GM_SYSTEM_HIST DUPL
    WHERE HIST.LDR_SYSTEM_ID = DUPL.LDR_SYSTEM_ID)
    AND HIST.LDR_SYSTEM_ID NOT IN (SELECT SYSTEM_ID FROM GM_SYSTEM) /* SYSTEM_ID is the PK for GM_SYSTEM */
    AND HIST.SYSTEM_HIST_ID IN
    (SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_INVN
    UNION
    SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_PROXIMITY);
    SELECT HIST.LDR_SYSTEM_ID "MISSING SYSTEM PK"
    FROM GM_SYSTEM_HIST HIST
    WHERE HIST.SYSTEM_HIST_ID = (SELECT MIN (DUPL.SYSTEM_HIST_ID) /* SYSTEM_HIST_ID is the PK for GM_SYSTEM_HIST */
    FROM GM_SYSTEM_HIST DUPL
    WHERE HIST.LDR_SYSTEM_ID = DUPL.LDR_SYSTEM_ID)
    AND HIST.LDR_SYSTEM_ID NOT IN (SELECT SYSTEM_ID FROM GM_SYSTEM) /* SYSTEM_ID is the PK for GM_SYSTEM */
    AND HIST.SYSTEM_HIST_ID IN
    (SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_INVN
    UNION
    SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_PROXIMITY);
    MISSING SYSTEM PK
    411539
    610343
    311152
    311155
    431231
    631785
    6 rows selected.
    MISSING SYSTEM PK
    332000
    612339
    2 rows selected.
    Why would the result sets change from MAX to MIN?

    Bob from Austin wrote:
    I was expecting the identical result sets from the following two SQL statements:And why would they be the same? Assume table GM_SYSTEM_HIST has:
    SYSTEM_HIST_ID LDR_SYSTEM_ID
    1              10
    2              10
    3              10Now, even though resgrless if you use MAX or MIN you will get back LDR_SYSTEM_ID = 10, using MAX will return row
    3              10while using MIN will return row:
    1              10And it could be row
    3              10satisfies other where clause conditions:
        AND HIST.LDR_SYSTEM_ID NOT IN (SELECT SYSTEM_ID FROM GM_SYSTEM) /* SYSTEM_ID is the PK for GM_SYSTEM */
        AND HIST.SYSTEM_HIST_ID IN (
                                     SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_INVN
                                    UNION
                                     SELECT SYSTEM_HIST_ID FROM GM_INTGRTY_PROXIMITY
                                   );while row
    1              10does not. Or vice versa.
    SY.
    Edited by: Solomon Yakobson on Dec 16, 2009 2:49 PM

  • Help with query to return results from group within table?

    Hi
    Im a total noob, so please be gentle....!
    I am looking at a table that has a WORD column and a WORD_TYPE_ID column.
    Words can have the same type_id.
    What I am trying to do is write a query that will return the longest word for each word_type_id.
    I have been trying for hours to get this and all I seem to get is either error messages or I return the longest word in the whole WORD column.
    The furthest I can get before things break down is.....
    select word
    from table
    where
    length(word) =
    select
    max(length(word))
    from table
    Any help on this or if I could be pointed in the right direction it would be greatly appreciated.
    Thanks

    Hi,
    Welcome to the forum!
    Here's one way:
    SELECT    word_type_id
    ,       MIN (word) KEEP (DENSE_RANK LAST ORDDER BY LENGTH (word))     AS longest_word
    FROM       table_x
    GROUP BY  word_type_id;If there happens to be a tie within some word_type_id (that is, 2 or more words have exactly the same length, which is the longest in that group) the expression above will return the first one, in alphabetic order. (That's what MIN means here.)
    Edited by: Frank Kulash on Aug 11, 2009 1:56 PM
    You almost had it.
    As you noticed, you were getting the longest row in the whole table. That's because your sub-query was looking at the whole table.
    If you correlate the sub-query to the row in the main table, as shown below, you can get the longest word in each group:
    select  word
    from     table     m                              -- m for main
    where      length (word) = (
                                select  max (length(word))
                   from     table
                   where     word_type_id  = m.word_type_id     -- New
                   );

  • How can I make a row of cells containing 3-digit decimals, who's values resulted from calculations within the spreadsheet, appear as durations of minutes and seconds?

    Row 6 in this spreadsheet is the result of Row 2/Row 3 as evidenced by the formula listed while Cell Y6 selected. How can I make the values in this row appear as durations of minutes and seconds rather than 3-digit decimals? For example, rather than appearing as 9.84 I would like the value of Cell Y6 to appear as 9:50 or 9min 50sec. (obviously .84x60seconds 50 seconds). I tried changing the cell formats from "number" to "duration," but no change is made. Using the "duration" format does however work if I am manually entering the decimal value into the cell rather than allowing it to result from another caluclation within the spreadsheet. Is there a solution to this within Numbers '09? You can see why I would want the "pace" displayed in minutes and seconds. Thanks in advance!
    Ryan

    Hi Ryan,
    You wrote:
    "The problem is that my "Distance" is a row of automatically generated values resulting from ((Row1/60)*Row 6). Changing the format of Row 1 to minutes causes row two to be expressed as a duration, which obviously it shouldn't because it is a distance. The spreadsheet has to be designed so that all I have to manually input on each entry are Row 1 Values (Time) and Row 6 Values (Average Pace). The rest of the cells must be automatically poulated as a result of formulas."
    I'm assuming that where you say "Row 1" in this you mean "Row 2", which is labeled "Time" in the example in the OP.
    In the original post, you presented a formula from cell Y6. Replacing the Header labels in that formula's cell reference with the Addresses of the referenced cells, the formula was:
    Y6: =Y2/Y3
    In this post, you are saying that Y6 contains entered data: "...all I have to manually input on each entry are Row 1 Values (Time) and Row 6 Values (Average Pace).
    Which is correct?
    Regards,
    Barry

  • Search Results Are Highlighted Within The Text Box? How ? Access 2013

    Hi Every one ,
    Below I am describing some coding issue in VBA-MS Access I am facing right now , and I hope u guys could help me resolve the issues :
    DB : MS access 2013 - RichTextBox In A Form -
    Language : VBA
    Problem In short : struggling to highlighting user search word within the search result query ..
    What I want :
    Helping to fix the second code shown below , the one I used to highlight ( reformat ) the text who's bound to a a field that store memo data type . code
    My Result Search Query VBA COde ( Work perfectly )
    strWhereToSearch = IIf(.framSearchIn.Value = 1, "[quknotSubject]", "[quknotBody] ")
    strCondition = strWhereToSearch & " Like '* " & strTextSearch & " *' OR " & _
    strWhereToSearch & " Like '" & strTextSearch & " *' OR " & _
    strWhereToSearch & "Like '* " & strTextSearch & "'"
    strSql = " Select * from qryExtraTool_QuickNoteSubCatMainCat "
    strSql = strSql & " WHERE " & strCondition & " ORDER BY quknotDate"
    The code that i am struggling to make it work for me to highlight the search word inside the textbox called .txtQuickNoteBody :
    'Control Source for the text box to display matches.
    Const strcTagStart = "<font color=""""red"""">"
    Const strcTagEnd = "</font>"
    strControlSource = "=IIf(" & strField & " Is Null, Null, " & _
    "Replace(" & strField & ", """ & strSearchValue & """, """ & _
    strcTagStart & strSearchValue & strcTagEnd & """))
    .txtQuickNoteBody.ControlSource = strControlSource
    Thank u all in advance .

    Thank u so Bruce , I finally found an answer to my question.
    The solution u provided looks complete except that i am confused by the meaning of strField , may i didnt provide more details in my  post .
    The strField var i provided earlier was not meant to be placed in my code  , the correct one is shown below .However , the strField means according to me is the field against which the search operation should take place based on the ( search Term )
    the user provided . 
    Here is the code after applying the solution u suggested :
    'Information collected from the user      
     strWhereToSearch = IIf(.framSearchIn.Value = 1, "[quknotSubject]", "[quknotBody] ")       
    strCondition = strWhereToSearch & "  Like '* " & strTextSearch & " *' OR " & _
    strWhereToSearch & " Like '" & strTextSearch & " *' OR " & _ 
    strWhereToSearch & "Like '* " & strTextSearch & "'" 
    'Fill result search  Recordset      
    strSql = " Select  * from qryExtraTool_QuickNoteSubCatMainCat   "         
    strSql = strSql & " WHERE   " & strCondition & "  ORDER BY quknotDate"  
    'Control Source for the text box to display matches. ( Highlight the search word )     
    txtQuickNoteBody = SearchHilight(strWhereToSearch, strTextSearch)
    Tell me if my implementation to your code is right ?
    Thank u again Bruce ...

  • Running resman results blue screen under MAX

    Our old PC with NT4 came to end of the road, and we had to replace it with new one that came with windows XP. We use the PC for running Labview 5.1 (updated to 5.1f1) and TestStand 1.01. Our hardware is PCI-MXI-2 and VXI-MXI-2. In VXI chassis we one DIO-128 and one MIO-64E-1 card. We have also PCI-GBIP card installed. Because the old drivers that we had for old PC doesn't work with XP, we downloaded the latest drivers for XP and LV5.1 from NI support pages. We have now NI-DAQ 6.9.3 and NI-VXI 3.3.1 and with them there came VISA 3.2 and MAX 3.1.1
    Now everything else seems to be in condition, but if we run Resman undex MAX, at the end of the run, Blue Screen enters and says something about "nidaq32k.sys". It goes away very quickly and PC reboots, so we don't have time to read it. If we run Resman without MAX, PC don't crash, but when we start TestStand, and try to run some test, it crashes again with same "nidaq32k.sys" Blue Screen when initialization begins. Also running Resman before starting MAX causes crashing, when we try to open the "Devices and interfaces" from MAX.
    So, should those drivers work with our hardware with XP and LV5.1 or what kind of setup should we use?
    Updating LV5.1 for LV7 or 8 is not an option, it causes incompatibility problems with our business partners.
    Regards,
    Ville

    I don't understand why this thread is moved here, because I think I posted it under VXI and VME discussion. Anyway, we got rid of the crashing by installing everything again, but this time we installed 488.2 version 2.1 instead of 2.4 we installed earlier. Now it don't crash anymore, and MAX version is 2.2. We have still problems with our GBIP devices, they might need new drivers too.

  • Returning results that fall within the current financial year

    Hi Everyone,
    I am using MSSQL Server 2008R2 and I am interested in returning rows from a 'financial' table that fall within the current year (each row contains a 'Entered Date'). I am located in Australia so my financial year consists of all entries between the date
    01/07/xx to the 30/06/yy.
    Can anybody suggest some code, perhaps using the datediff() function, or other functions as required to achieve what I need?
    Kind Regards,
    David

    Hi,
    Try the Below Script.Hope it works
    DECLARE @StartOfFinancialYear
    DATETIME
    -- This gets 1st April for the current year
    SET @StartOfFinancialYear
    = CAST(YEAR(GETDATE())
    AS VARCHAR)
    + '0701'
    SELECT
    FROM
    <YourTable>
    WHERE DateField
    >= @StartOfFinancialYear
    AND DateField <
    DATEADD(yy, 1, @StartOfFinancialYear)
    -- less than 1st July NEXT year
    Regards, PS

  • Upload Gives False Result

    I am running Dreamweaver CS3 on Mac OS X 10.5.5. I have only
    one site defined and have had no problems up until now. Now, I
    cannot upload to the site.
    1. When I click on the remote icon to connect to the site,
    the connection appears to work and all of my files on the remote
    site show up in the "Remote Site" window, just as before.
    2. If I update a file in the "Local Files" window and then
    drag it to the "Remote Site" window, a progress window pops up
    indicating that the file is transferring and then the window goes
    away, indicating successful transfer. The date on the file in the
    "Remote Site" window indicates successful transfer. However, when I
    use my browser on my site the file has not been updated.
    3. I tried defining a new file and uploading that. The
    "Remote Site" window indicates the page is now up on my site, but
    again, I can't get there through my browser.
    So Dreamweaver thinks the uploads are taking place, but I
    can't get them through my browser. The site definition is unchanged
    so far as I can tell when I go to "Manage Sites" in Dreamweaver.
    Really need help on this one.

    Martin_H. wrote:
    For instance, how do you write this query in ANSI syntax without adding the column PROD_ID into the on clause and avoide breaking the outer join:
    select  t.TIME_ID, s.time_id
    from    times t
    ,sales s
    where   t.time_id = s.time_id(+)
    and   s.PROD_ID(+) = 22If you use the ANSI syntax and exclude a column from the on clause it will break the outer join. I personally exclude any column from the on clause, which definitely stands not for a join column and therefore I do not know how to use the ANSI syntax for outer joins without breaking them.
    select  t.TIME_ID, s.time_id
    from    times t
    left outer join sales s on (t.time_id) = ((s.time_id))
    where   s.PROD_ID = 22  // how to tell oracle to outer join s.prod_id within the where clauseRegards,
    Martin
    Edited by: Martin_H. on 30-Jul-2010 02:01Ah I see your problem. But you are restricting yourself by saying that the condition should not belong into the ON clause. This would be the usual solution.
    However this is not a technical restriction because of the ansi syntax but a restriction that you impose upon you by yourself.
    how to tell oracle to outer join s.prod_id
    select  t.TIME_ID, s.time_id
    from    times t
    left outer join sales s on t.time_id = s.time_id and s.PROD_ID = 22I think this is abosolutly ok to write it like that. From a logic point of view it means:
    Find all times and show me if there had been sales for product 22.
    what should also work is
    how to tell oracle to outer join s.prod_id within the where clause
    select  t.TIME_ID, s.time_id
    from  times t
    left outer join sales s on t.time_id = s.time_id
    where (s.PROD_ID = 22 or s.PROD_ID is null)It means:
    Find all times and show me if there had been sales
    I only want to see sales for product 22.
    Edited by: Sven W. on Jul 30, 2010 11:09 AM

  • How to show Report Result line breaked(or seprate) into Total AVG MAX MIN?

    Hi all,
    in my report i have report result line which give Total value of all charetristic lines,
    I required to show this Report result line breaked into 4 section one for Total, one for avg, one for max, one for min of that cheretristic lines value, OR if we can show 4 diffrent(Total, Avg,.... ) result lines in report.
    we can show one result line for Total or AVG or MAX OR MIN Eitherwise by setting keyfiguer result line property from calculate > calculate result as - Total or Max or Min or Avg, My requirement to show all together for singal Keyfiguer.
    Is there any work around for this OR enhancment of result line by user exit or by setting some where possibel?
    Regards,
    Dushyant.

    in last post output is scattered,
    I am getting output like this:
    characteristic(row).......................... KeyFig(column)
    Equipment 1...................................... 2 (outstanding notification value)
    Equipment 2...................................... 3
    Equipment 3 ......................................4
    Result Value ......................................9 (By default Total value of above 3 notification)
    My require output is:
    characteristic(row).......................... KeyFig(column)
    Equipment 1...................................... 2 (outstanding notification value)
    Equipment 2...................................... 3
    Equipment 3 ......................................4
    Result Value ......................................9 (By default Total value of above 3 notification)
    req additional row...........................3 (Average of above 3 equipment value).
    req additional row...........................4 (Max from above 3 equipment value).
    I require all single value row of equipment and its(equipment) result required as Total, Avg, Max simultaneously in row only, is there any work around.
    Regards,
    Dushyant.

  • Error -3016 when trying to compare a column value via "decode" function

    The following statement:
      select * from turbine_user
      where login_name  = decode(1, 2,  'name1', 'name2')
    yields a "-3016 Invalid numeric constants" error.
    OTOH, the following variations work as expected:
      (a)
      select * from turbine_user
      where login_name  = 'name1'
      (b)
      select * from turbine_user
      where login_name  = 'name2'
      (c)
      select * from turbine_user
      where 'name1'  = decode(1, 2,  'name1', 'name2')
      (d)
      select decode(1, 2,  'name1', 'name2') from turbine_user
    Does MaxDB have problems with using the decode function to compare something to column values?
    My MaxDB-Version: 7.6.03.07
    Thanks in advance,
    Alex
    Edited by: Alexander Zimmer on Feb 6, 2008 3:53 PM

    Hi,
    unfortunately I assume that I should explain the doing of decode a little bit:
    As we see in the reference manual:
    DECODE(<check_expression>,<search_and_result_spec>,...[,<default_expression>])
    <check_expression> ::=
      <expression>
    <search_and_result_spec> ::=
      <search_expression>,<result_expression>
    <default_expression> ::=
      <expression>
    <search_expression> ::=
      <expression>
    <result_expression> ::=
      <expression>
    Ok, that will mean, that the first parameter of decode will be compared to parameter number 2, 4, 6, 8, 10,... up to number n-1.
    If the result of the comparison is true with parameter number x, the result of decode will be the value of parameter x+1.
    If no comparison results in 'equal', then NULL will be returned if there is an odd number of parameters respectively the value of the last parameter if there is an even number of parameters of the decode function.
    In your context, this means, that 1 is compared to 2 (always false), thus returning 'name2' always. Therefore I do not understand what you want to do with that decode.
    Ok, if we assume that the select sent is only a short form of what you really want to do, then I have to apologize, but there is a bug in the kernel coding. It will be fixed ASAP.
    To be able to work until then, put the function DIGITS around your 1 and around the 2 (or the corresponding real parameter values) and it should do.
    BTW: with column on the left hand side, the error occurs and with a string literal it does not? This is different to my check where both values on the left side cause this error to occur.
    Elke

  • Show return value of a method-call within a column of ADF table component

    Hi,
    I'm currently developing a ADF "Master Form - Detail Table" component, which displays trips of a car in master form, and all related trip-point information in detail table. This detail table contains the following fields within a row :
    - idTripPoint
    - receivedAt
    - speed
    - coordinates
    Everything is displayed well when deploying my app. What I now want to implement is one more column into my detail table, which displays the result of a method-call which gets the coordinates of the corresponding tripPoint and executes a query to find the nearest neighbour to this point. This method afterwards returns a string which contains a textual description for the coordinates (e.g. 10 km south of Hilton Plaza). This method is defined within my SessionBean and also available within the Data Control Palette.
    What I first did, was just to drag the result (String) of my getTripPointDescription(JGeometry) method to a newly created column within my details table, released it there and set the corresponding NDValue for my method. I used the id of my details table table definition in PageDef for that (${bindings.TripstripPointsList.currentRow.dataProvider.coordinates}). I don't know if this is correct.
    When deploying my app, nothing happened, because my method has never been called. So I decided to implement an invokeAction within my PageDef which calls the generated methodAction within PageDef.
    It looks like that now:
    <executables>
    <invokeAction id="callDescription" Binds="getTripPointDescription"
    Refresh="prepareModel"/>
    </executables>
    <bindings>
    <methodAction id="getTripPointDescription"
    InstanceName="TripsEJBFacadeLocal.dataProvider"
    DataControl="TripsEJBFacadeLocal"
    MethodName="getTripPointDescription"
    RequiresUpdateModel="true" Action="999"
    IsViewObjectMethod="false"
    ReturnName="TripsEJBFacadeLocal.methodResults.TripsEJBFacadeLocal_dataProvider_getTripPointDescription_result">
    <NamedData NDName="tripPoint"
    NDValue="${bindings.TripstripPointsList.currentRow.dataProvider.coordinates}"
    NDType="oracle.spatial.geometry.JGeometry"/>
    </methodAction>
    </bindings>
    Now my method is called once for the coordinates of the first row of my detail table and the generated result is entered within each row.
    So how is it possible to get this standard-behaviour (within other application-frameworks) work in ADF? I just want to display a textual description of a coordinate instead of x/y coordinates within my table. And the corresponding method to get this textual description based on the x/y coordinate should be called for each row displayed in my table.
    I currently walked through all ADF-tutorials and blogs I found on the Internet, but every table example I found only displays data of the associated Entity-Bean. And method Action and accessorIterator are only used with command objects.
    Thank you,
    Thomas

    Sorry, I forgot to say which technologies I use:
    - Toplink Essentials JPA for Model layer (EJB 3.0)
    - ADF in View Layer
    I still hope someone can help me finding an answer.
    Bets Regards,
    Thomas

  • New Charset Encoder/Decoder for Microsoft telnet

    Hello,
    I have a problem for writing a server which is accessible by microsoft windows telnet.
    I have managed to find out these relationships:
              switch ((int) c) {
                   case -27: c = '�'; break;
                   case -28: c = '�'; break;
                   case -102: c = '�'; break;
                   case -103: c = '�'; break;
                   case -108: c = '�'; break;
                   case -114: c = '�'; break;
                   case -124: c = '�'; break;
                   case -127: c = '�'; break;
    So how could i write an encoder/decoder which could map these charcters specially and others as norma ISO-8859-1.
    I switched them after encoding/decoding but then i got problem, that
    i got two characters(in telnet window). First was some wierd symbol and second the right character.
    Any help lplease?

    Okay, got working the charset include and everything is okay.
    Now i need to look after charcodes below 0. I though that it would be useful to create new charset for this purpose which adds little extra functionality to IBM850. When running this code it says that IBM850 charset not found when initilizating X-MICRO charset. But it is accessible in main program. Any ideas what is wrong?... Please help me, this damn internationallization has driven me mad.
    package ee.feelfree.charset;
    import java.nio.charset.Charset;
    import java.nio.charset.spi.CharsetProvider;
    import java.util.HashSet;
    import java.util.Iterator;
    public class MicrosoftCharsetProvider extends CharsetProvider {
         private static final String CHARSET_NAME = "X-MICRO";
         private Charset micro = null;
         public MicrosoftCharsetProvider()
         this.micro = new MicrosoftCharset (CHARSET_NAME, new String [0]);
         public Iterator charsets() {
              HashSet set = new HashSet (1);
              set.add (micro);
              return (set.iterator());
         public Charset charsetForName (String charsetName) {
              if (charsetName.equalsIgnoreCase (CHARSET_NAME)) {
                   return (micro);
                   return (null);
    package ee.feelfree.charset;
    import java.nio.CharBuffer;
    import java.nio.charset.*;
    import java.nio.ByteBuffer;
    public class MicrosoftCharset extends Charset {
         private static final String BASE_CHARSET_NAME = "IBM850";
         Charset baseCharset;
         protected MicrosoftCharset(String canonical,String [] aliases) {
              super (canonical, aliases);
              baseCharset = Charset.forName(BASE_CHARSET_NAME);
         public CharsetEncoder newEncoder() {
              return new MicrosoftEncoder(this,baseCharset.newEncoder());
         public CharsetDecoder newDecoder() {
              return new MicrosoftDecoder(this,baseCharset.newDecoder());
         public boolean contains (Charset cs) {
              return false;
         private class MicrosoftEncoder extends CharsetEncoder {
              private CharsetEncoder baseEncoder;
              MicrosoftEncoder(Charset cs,CharsetEncoder baseEncoder) {
                   super(cs, baseEncoder.averageBytesPerChar(),
                             baseEncoder.maxBytesPerChar());
                   this.baseEncoder = baseEncoder;
              protected CoderResult encodeLoop (CharBuffer cb, ByteBuffer bb)
                   CharBuffer tmpcb = CharBuffer.allocate (cb.remaining());
                   while (cb.hasRemaining()) {
                   tmpcb.put (cb.get());
                   tmpcb.rewind();
                   baseEncoder.reset();
                   CoderResult cr = baseEncoder.encode (tmpcb, bb, true);
                   cb.position (cb.position() - tmpcb.remaining());
                   return (cr);
         private class MicrosoftDecoder extends CharsetDecoder
         private CharsetDecoder baseDecoder;
         private boolean microClient = false;
              MicrosoftDecoder (Charset cs, CharsetDecoder baseDecoder)
                   super (cs, baseDecoder.averageCharsPerByte(),
                   baseDecoder.maxCharsPerByte());
                   this.baseDecoder = baseDecoder;
              protected CoderResult decodeLoop (ByteBuffer bb, CharBuffer cb)
                   baseDecoder.reset();
                   CoderResult result = baseDecoder.decode (bb, cb, true);
                   myDecode (cb);
                   return (result);
              public boolean getClient() {
                   return microClient;
              private void myDecode(CharBuffer cb) {
                   microClient = false;
                   for (int pos = cb.position(); pos < cb.limit(); pos++) {
                        int c = (int) cb.get (pos);
                        if (c<0) microClient=true;
    }

  • Mp3 decoding with libmpg123 lib to pass refer to AS3

    Hello to everybody.
    I would like to ask a question in relation to the project that I am working at the moment. I am trying to use libmpg123 decoder library to process mp3 file and return the result back to Alchemy so that I can return a decoded instance of the mp3 back to AS3. I wish to use the source code of the decoder within the project so I can embed its functionality into the application. I do not want to install the decoder itself but to use its source code to incorporate its functionality within our app.
    1. Hasanybody implemented the decoder with Alchemy API ? How?
    2. Can you pass the decoded mp3 into AS3 using Alchemy? How?
    Has anybody used libmpg123 decoder with Alchemy to process mp3 file? I will appreciate if somebody points me to a useful reference or information related to my query?
    Thanks

    Yes I know that already but my goal is to use an open source C decoder that will take a reference to a mp3 file from AS3 and start processing the request while AS3 takes care of less CPU intensive tasks. Beside that decoding mp3 file with a C decoder (mpg123) will provide me with a native data structure that I can further use in more extensive sound analysis  and only the output of it will be send back to AS3 using Alchemy 's APIs . That is why I try NOT to use extract method of AS3. Have you tried decoding mp3 inside Alchemy ? Is it possible?
    Regards

Maybe you are looking for