How can i run this query in BI Answers

Hi,
pls tell me how can i run this sql statement in BI Answers....???
select abc_date,abc_asset_desc,sum(nvl(abc_market_val_lcy,0)+nvl(abc_accr_lcy,0)) "total balance" from abc
group by abc_date,abc_asset_desc;any help would be appriciated.... :-)
Regards

Strange question this one.
normally with Answers you pick the columns you want to report on and the BI server will construct the SQL for you.
In this example you would need a star with the abc dimension logical table and a logical fact for abc (these can be in the same table), which has a calculated field for 'Total Balance'.
You then pick the columns you require and Answer and the BI will automatically add the group by.
Adrian
Majendi

Similar Messages

  • How can i improve this query.

    Hi guys i am beginner , just wanted to know some info , how can i improve this query ..
    select *
    from tableA A, viewB B,
    where A.key = B.key
    and a.criteria1 = '111'
    and a.criteria2 = some_funtion(a.key)
    one more thing should function should be on left side of equal sign.
    will a join make it better or something else is needed more than that .

    952936 wrote:
    Hi guys i am beginner , just wanted to know some info , how can i improve this query ..
    select *
    from tableA A, viewB B,
    where A.key = B.key
    and a.criteria1 = '111'
    and a.criteria2 = some_funtion(a.key)
    one more thing should function should be on left side of equal sign.
    will a join make it better or something else is needed more than that .If you are a beginner try to learn the ANSI Syntax. This will help you a lot to write better queries.
    Your select would look like this in ANSI.
    select *
    from tableA A
    JOIN viewB B ON A.key = B.key
    WHERE a.criteria1 = '111'
    and a.criteria2 = some_function(a.key);The good thing here is that this separates the typical joining part of the select from the typical filter criteria.
    The other syntax very often let you forget one join. Just because there are so many tables and so many filters, that you just don't notice correctly anymore what was join and what not.
    If you notice that the number of column is not what you expect, you can easiely modify the query and compare the results.
    example A
    Remove View B from the query (temporarily comment it out).
    select *
    from tableA A
    --JOIN viewB B ON A.key = B.key
    WHERE a.criteria1 = '111'
    and a.criteria2 = some_funtion(a.key)
    example B
    You notice, that values from A are missing. Maybe because there is no matching key in ViewB? Then change the join to an outer join.
    select *
    from tableA A
    LEFT OUTER JOIN viewB B ON A.key = B.key
    WHERE a.criteria1 = '111'
    and a.criteria2 = some_funtion(a.key)(The outer keyword is optional, left join would be enough).

  • How  can i run this code correctly?

    hello, everybody:
        when  i run the code, i found that it dons't work,so ,i  hope somebody can help me!
        the Ball class is this :
        package {
        import flash.display.Sprite;
        [SWF(width = "550", height = "400")]
        public class Ball extends Sprite {
            private var radius:Number;
            private var color:uint;
            private var vx:Number;
            private var vy:Number;
            public function Ball(radius:Number=40, color:uint=0xff9900,
            vx:Number =0, vy:Number =0) {
                this.radius= radius;
                this.color = color;
                this.vx = vx;
                this.vy = vy;
                init();
            private function init():void {
                graphics.beginFill(color);
                graphics.drawCircle(0,0,radius);
                graphics.endFill();
    and the Chain class code is :
    package {
        import flash.display.Sprite;
        import flash.events.Event;
        [SWF(width = "550", height = "400")]
        public class Chain extends Sprite {
            private var ball0:Ball;
            private var ball1:Ball;
            private var ball2:Ball;
            private var spring:Number = 0.1;
            private var friction:Number = 0.8;
            private var gravity:Number = 5;
            //private var vx:Number =0;
            //private var vy:Number = 0;
            public function Chain() {
                init();
            public function init():void {
                ball0  = new Ball(20);
                addChild(ball0);
                ball1 = new Ball(20);
                addChild(ball1);
                ball2 = new Ball(20);
                addChild(ball2);
                addEventListener(Event.ENTER_FRAME, onEnterFrame);
            private function onEnterFrame(event:Event):void {
                moveBall(ball0, mouseX, mouseY);
                moveBall(ball1, ball0.x, ball0.y);
                moveBall(ball2, ball1.x, ball1.y);
                graphics.clear();
                graphics.lineStyle(1);
                graphics.moveTo(mouseX, mouseY);
                graphics.lineTo(ball0.x, ball0.y);
                graphics.lineTo(ball1.x, ball1.y);
                graphics.lineTo(ball2.x, ball2.y);
            private function moveBall(ball:Ball,
                                      targetX:Number,
                                      targetY:Number):void {
                ball.vx += (targetX - ball.x) * spring;
                ball.vy += (targetY - ball.y) * spring;
                ball.vy += gravity;
                ball.vx *= friction;
                ball.vy *= friction;
                ball.x += vx;
                ball.y += vy;
    thanks every body's help!

    ok, thanks for your reply ! I run this code in the Flex builder 3!and the Ball class and the Chain class are all in the same AS project!
      and i changed the ball.pv property as public in the Ball class, and  the Chain class has no wrong syntactic analysis,but the AS code don't run.so this is the problem.
    2010-04-21
    Fang
    发件人: Ned Murphy <[email protected]>
    发送时间: 2010-04-20 23:01
    主 题: how  can i run this code correctly?
    收件人: fang alvin <[email protected]>
    I don't see that the Ball class has a pv property, or that you even try to access a pv property in the Chain class.  All of the properties in your Ball class are declared as private, so you probably cannot access them directly.  They would need to be public.  Also, I still don't see where you import Ball in the chain class such that it can use it.

  • I developed app in mac 10.6.8 with xcode 3.2.6.how can i run this app in ipad device

    i developed app in mac 10.6.8 with xcode 3.2.6.how can i run this app in ipad device

    actually i planned to get  provisioning profiles from apple by paying 99$ in following website
    https://developer.apple.com/programs/start/ios/ and followed by
    https://developer.apple.com/programs/start/standard/.
    but in last link,following thing were mentioned at bottom -
    Technical Requirements
    You must have an Intel-based Mac running OS X 10.8 Mountain Lion or later to develop and distribute iOS apps and Mac apps.
    but i\m using mac running OS X 10.6.8 snow leopard.
    Doubt:can't i run my app in ipad device?\
    Thank's in advance..

  • Can anyone tell me how can i optimize this query...

    Can anyone tell me how can i optimize this query ??? :
    Select Distinct eopersona.numident From rscompeten , rscompet , rscv , eopersona , rscurso , rseduca , rsexplab , rsinteres
    Where ( ( (LOWER (rscompeten.nombre LIKE '%caracas%') AND ( rscompeten.id = rscompet.idcompeten ) AND ( rscv.id = rscompet.idcv ) AND ( eopersona.id = rscv.idpersona ) )
    OR ( (LOWER (rscurso.nombre) LIKE '%caracas%') AND ( rscv.id = rscurso.idcv ) AND ( eopersona.id = rscv.idpersona ) )
    OR ( (LOWER (rscurso.lugar) LIKE '%caracas%') AND ( rscv.id = rscurso.idcv ) AND ( eopersona.id = rscv.idpersona ) )
    OR ( (LOWER (rseduca.univinst) LIKE '%caracas%)' AND ( rscv.id = rseduca.idcv ) AND ( eopersona.id = rscv.idpersona ) )
    OR ( (LOWER (rsexplab.nombempre) LIKE '%caracas%' AND ( rscv.id = rsexplab.idcv ) AND ( eopersona.id = rscv.idpersona ) )
    OR ( (LOWER (rsinteres.descrip) LIKE '%caracas%' AND ( rscv.id = rsinteres.idcv ) AND ( eopersona.id = rscv.idpersona ) )
    OR ( (LOWER (rscv.cargoasp) LIKE '%caracas%' AND ( eopersona.id = rscv.idpersona ) )
    OR ( LOWER (eopersona.ciudad) LIKE '%caracas%' AND ( eopersona.id = rscv.idpersona )
    PLEASE IF YOU FIND SOMETHING WRONG.. PLEASE HELP ME.. this query takes me aproximatelly 10 minutes and the database is really small ( with only 200 records on each table )

    You are querying eight tables, however in any of your OR predicates you're only restricting 3 or 4 of those tables. That means that the remaining 4 or 5 tables are generating cartesian products. (n.b. the cartesian product of 5 tables with 200 rows each results in g 200^5 = 320,000,000,000 rows) Then you casually hide this behind "distinct".
    A simple restatement of your requirements looks like this:
    Select eopersona.numident
      From rscompeten,
           rscompet,
           rscv,
           eopersona
    Where LOWER (rscompeten.nombre) LIKE '%caracas%'
       AND rscompeten.id = rscompet.idcompeten
       AND rscv.id = rscompet.idcv
       AND eopersona.id = rscv.idpersona
    UNION
    Select eopersona.numident
      From rscurso ,
           rscv,
           eopersona
    Where LOWER (rscurso.nombre) LIKE '%caracas%'
       AND rscv.id = rscurso.idcv
       AND eopersona.id = rscv.idpersona
    UNION
    Select eopersona.numident
      From rscurso ,
           rscv,
           eopersona
    Where LOWER (rscurso.lugar) LIKE '%caracas%'
       AND rscv.id = rscurso.idcv
       AND eopersona.id = rscv.idpersona
    UNION
    ...From there you can eliminate redundancies as desired, but I imagine that the above will perform admirably with the data volumes you describe.

  • HT201210 I am trying to update Ios7 for iPhone 4 but there is an unknown error occurred like (-23). My Laptop OS is Windows 8. Now how can i solved this query.

    Dear Sir/Madam
    I am trying to update Ios7 for iPhone 4 but there is an unknown error occurred like (-23). My Laptop OS is Windows 08.ios 7 update which can updated and remaining  30minutes are left out. Than after error which can be show as i have mentioned above.
    How can i resolved this error? So please help me.
    Thanks & Regards,
    Vatsal Desai

    Error 20, 21, 23, 26, 28, 29, 34, 36, 37, 40
    These errors typically occur when security software interferes with the restore and update process. Use the steps to troubleshoot security software issues to resolve this issue. In rare cases, these errors may be a hardware issue. If the errors persist on another computer, the device may need service.
    Also, check your hosts file to verify that it's not blocking iTunes from communicating with the update server. See the steps under the heading "Blocked by configuration (Mac OS X / Windows) > Rebuild network information > Mac OS X > The hosts file may also be blocking the iTunes Store." If you have software used to perform unauthorized modifications to the iOS device, uninstall this software prior to editing the hosts file to prevent that software from automatically modifying the hosts file again on restart.
    all of this from
    iTunes: Specific update-and-restore error messages and advanced troubleshooting

  • How can i make this query run for a form

    This query works fine for a sql report
    SELECT *
    FROM STUDENTS
    WHERE given_name||' '||family_name = :P101_USERNAME
    AND password = :P101_PASSWORD;
    But i want it to do the same thing for a form but i dont have the option like i do for the report where i can just apply the condition to the process.
    Anyone any ideas how i could do this so that when i go to the form this information is already there based on the username and password from the previous page?

    Assuming that page 101 is your login form, just lookup the primary key of the student based on the values presented in the login page fields, then set and pass this value to the form page.
    So you would create a process that runs near the very end of the the login processes on page 101, something like this:
    declare
    l_student_id students.student_id%TYPE;
    begin
    select student_id into l_student_id from students where  given_name||' '||family_name = :P101_USERNAME and password = :P101_PASSWORD;
    -- then set the value of your form page primary key field
    :P1_STUDENT_ID := l_student_id;
    end;I've done something similar and it works fine for me, although I haven't looked at it recently.
    Earl

  • How can we rewrite this query for better performance

    Hi All,
    The below query is taking more time to run. Any ideas how to improve the performance by rewriting the query using NOT EXITS or any other way...
    Help Appreciated.
    /* Formatted on 2012/04/25 18:00 (Formatter Plus v4.8.8) */
    SELECT vendor_id
    FROM po_vendors
    WHERE end_date_active IS NULL
    AND enabled_flag = 'Y'
    and vendor_id NOT IN ( /* Formatted on 2012/04/25 18:25 (Formatter Plus v4.8.8) */
    SELECT vendor_id
    FROM po_headers_all
    WHERE TO_DATE (creation_date) BETWEEN TO_DATE (SYSDATE - 365)
    AND TO_DATE (SYSDATE))
    Thanks

    Try this one :
    This will help you for partial fetching of data
    SELECT /*+ first_rows(50) no_cpu_costing */
    vendor_id
    FROM po_vendors
    WHERE end_date_active IS NULL
    AND enabled_flag = 'Y'
    AND vendor_id NOT IN (
    SELECT vendor_id
    FROM po_headers_all
    WHERE TO_DATE (creation_date) BETWEEN TO_DATE (SYSDATE - 365)
    AND TO_DATE (SYSDATE))
    overall your query is also fine, because, the in this query the subquery always contain less data compare to main query.

  • How can i construct this query without using CASE statement?

    I've a following code. I'm using this script in Hibernet. So, i cannot use CASE there. Because, hibernet doesn't support case in select statement. How can i construct the same thing which will give me the same result without using CASE?
    SELECT ofc.FLT_LCL_ORIG_DT
         , ofc.CARR_IATA_CD
         , ofc.FLT_NBR
         , ofc.ORIG_ARPT_CD
         , ofc.DEST_ARPT_CD
         , sum( ofc.CNCT_PSGR_CNT) AS BOOKED_CNCT_PSGR_CNT
         , sum( CASE WHEN o.fsdr_mrkt_cd = 'D' AND d.fsdr_mrkt_cd = 'D'           THEN '0'
            ELSE to_char(ofc.CNCT_PSGR_CNT,'99')                             END ) AS BOOKED_INTL_CNCT_PSGR_CNT
         , sum(CASE WHEN o.fsdr_mrkt_cd||d.fsdr_mrkt_cd = 'DD'
                    THEN '0'
            ELSE to_char(ofc.CNCT_PSGR_CNT,'99')
            END) AS NEW_BCNT
    FROM OPS_FLT_CNCT ofc
                        , STN o
                        , STN d
                    WHERE ofc.CNCT_ORIG_ARPT_CD = o.STN_CD
                      AND ofc.CNCT_DEST_ARPT_CD = d.STN_CD
                     -- AND TRUNC(ofc.FLT_LCL_ORIG_DT) = trunc(to_date('22-MAY-2007','DD-MON-YYYY'))
                      AND ofc.CARR_IATA_CD = 'UA'
                      AND ofc.FLT_NBR = '1218'
                      AND ofc.ORIG_ARPT_CD = upper('DEN')                AND ofc.DEST_ARPT_CD = upper('IAD')                  GROUP BY ofc.FLT_LCL_ORIG_DT
                           , ofc.CARR_IATA_CD
                           , ofc.FLT_NBR
                           , ofc.ORIG_ARPT_CD
                           , ofc.DEST_ARPT_CD ;And, the output look like this --
    FLT_LCL_O CARR FLT_N ORI DES BOOKED_CNCT_PSGR_CNT BOOKED_INTL_CNCT_PSGR_CNT   NEW_BCNT
    22-MAY-07 UA   1218  DEN IAD                    9                         0          0
    23-MAY-07 UA   1218  DEN IAD                    1                         0          0
    24-MAY-07 UA   1218  DEN IAD                    2                         1          1
    25-MAY-07 UA   1218  DEN IAD                    1                         0          0Thnaks in advance for reply.
    Regards.
    Satyaki De.
    #####

    2 ideas:
    1. Inline function to perform the CASE funcionaltity for you
    2. Piplelined function to generate the entire dataset
    Both will be slower than just using CASE in a query, but we're working around big constraints

  • How can i tune this query?

    Removed the post because of a major logical flaw. Thanks to Boneist for his great idea.
    Edited by: user10633418 on Nov 20, 2008 3:21 AM

    I think I would try rewriting the query to turn the exists clauses into full joins, like:
    SELECT mph.MANIF_NBR AS A1,
           mph.SHPR_ID AS A5,
           mph.MANIF_TYPE AS A4,
           mph.LOAD_NBR AS A21,
           mph.STAT_CODE AS A7,
           mph.CLOSE_DATE AS A10,
           mph.SHIP_DATE_TIME AS A24,
           mph.UPS_PIKUP_NBR AS A9,
           mph.WHSE AS A2,
           mph.PIKUP_REC_NBR AS A8,
           manh_carr_type_for_manif_nbr(mph.WHSE,mpc.MANIF_NBR) AS A26,
           mph.UPS_PLD_UPLOAD_INDIC AS A28,
           'PARCELMANIF_CD' AS A29
    FROM   MANIF_PARCL_HDR mph,
           MANIF_PARCL_CARTON mpc,
           PARCL_SHPMT ps
    WHERE  mph.MANIF_NBR = mpc.MANIF_NBR
    AND    mph.MANIF_NBR = ps.MANIF_NBR
    AND    mph.WHSE = 'HAN'  
    AND    ps.CD_MASTER_ID IN (1001)
    ORDER BY MANIF_PARCL_HDR.MANIF_NBR ASC,
             MANIF_PARCL_HDR.MANIF_TYPE ASCand then compare how fast that runs and what the explain plan is, etc.

  • How can i speedup this query ?

    Hi,
    have a look at this query:
    SELECT DISTINCT element_short_description
               FROM sample_test_report, test_group, test_element_master
              WHERE str_test_group_code = tgr_test_group_code
                AND str_element_code = element_code
                AND tgr_group_description = 'SINTER_CHEMICAL_ANALYSIS'
           ORDER BY element_short_descriptionThing is that total number of rows present in "sample_test_report" tables are in lakh ...around 50 lakh.Other two tables have a few rows. This query is taking around 15 seconds for completion, can this query be made faster ?
    Note that proper indexing have been done already.
    Thanks.

    SELECT DISTINCT element_short_description
    FROM sample_test_report, test_group, test_element_master
    WHERE str_test_group_code = tgr_test_group_code
    AND str_element_code = element_code
    AND tgr_group_description = 'SINTER_CHEMICAL_ANALYSIS'
    ORDER BY element_short_description
    Can you provide us with explain plan?
    I suggest you use table alias every time:
    The alias is specified in the FROM clause after each table name.
    Table aliases make your queries more readable.
    Then gather statistics your tables:
    BEGIN
    DBMS_STATS.GATHER_TABLE_STATS('OWNER','TABLE',estimate_percent=>NULL,method_opt=>'FOR ALL INDEXED COLUMNS SIZE AUTO',DEGREE=>10,CASCADE=>TRUE,granularity=>'ALL');
    END;
    if your db version < 10g
    ANALYZE TABLE employees COMPUTE STATISTICS;
    ANALYZE TABLE employees ESTIMATE STATISTICS;
    If necessary rebuild index, check indexes are use.
    Unusable indexes are made valid by rebuilding them to recalculate the pointers.
    Rebuilding an unusable index re-creates the index in a new location, and then drops the unusable index. This can be done either by using Enterprise Manager or through SQL commands:
    ALTER INDEX HR.emp_empid_pk REBUILD;
    ALTER INDEX HR.emp_empid_pk REBUILD ONLINE;
    ALTER INDEX HR.email REBUILD TABLESPACE USERS;
    Note: Rebuilding an index requires that free space be available for the rebuild. Verify that there is sufficient space before attempting the rebuild. Enterprise Manager checks space requirements automatically.
    At the end, try join table separately and then concatenate them.
    Your query will be work good.
    Look at execution plan, if indexes are not used, use HINTs : There are many Oracle hints available to the developer for use in tuning SQL statements that are embedded in PL/SQL.
    please refer to http://www.dba-oracle.com/t_sql_hints_tuning.htm and http://www.adp-gmbh.ch/ora/sql/hints/index.html
    Good luck

  • How Can I make this query run faster

    SQL> EXPLAIN PLAN FOR SELECT a.txid, a.methodid, a.serviceid, a.nodename, a.env, a.ts, a.te, a.resultcode, a.resultmessage FROM g2log.txmaster a,
    2 g2log.txlookup b WHERE b.key = 'sbcgnfttxuniquedslamportid' AND b.value = 'MTC3LS733001-1-1-2-13' AND a.txid = b.txid ORDER BY ts desc;
    Explained.
    Elapsed: 00:00:00.01
    SQL> @$ORACLE_HOME/rdbms/admin/utlxpls.sql
    PLAN_TABLE_OUTPUT
    Plan hash value: 3790334907
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 578 | 108K| 1267 (1)| 00:00:16 | | |
    | 1 | PX COORDINATOR | | | | | | | |
    | 2 | PX SEND QC (ORDER) | :TQ10001 | 578 | 108K| 1267 (1)| 00:00:16 | | |
    | 3 | SORT ORDER BY | | 578 | 108K| 1267 (1)| 00:00:16 | | |
    | 4 | PX RECEIVE | | | | | | | |
    | 5 | PX SEND RANGE | :TQ10000 | | | | | | |
    | 6 | NESTED LOOPS | | | | | | | |
    | 7 | NESTED LOOPS | | 578 | 108K| 1266 (1)| 00:00:16 | | |
    | 8 | PX PARTITION RANGE ALL | | 578 | 44506 | 109 (0)| 00:00:02 | 1 | 27 |
    | 9 | TABLE ACCESS BY LOCAL INDEX ROWID| TXLOOKUP | 578 | 44506 | 109 (0)| 00:00:02 | 1 | 27 |
    |* 10 | INDEX RANGE SCAN | TX_KEY_VAL | 578 | | 58 (0)| 00:00:01 | 1 | 27 |
    |* 11 | INDEX UNIQUE SCAN | TXMASTER_TXID_PK | 1 | | 1 (0)| 00:00:01 | | |
    | 12 | TABLE ACCESS BY GLOBAL INDEX ROWID | TXMASTER | 1 | 116 | 2 (0)| 00:00:01 | ROWID | ROWID |
    Predicate Information (identified by operation id):
    10 - access("B"."KEY"='sbcgnfttxuniquedslamportid' AND "B"."VALUE"='MTC3LS733001-1-1-2-13')
    11 - access("A"."TXID"="B"."TXID")
    25 rows selected.
    I have gathered stats on the two tables as well
    SQL> select count(*) from g2log.txmaster;
    COUNT(*)
    88812
    SQL> select count(*) from g2log.txlookup;
    COUNT(*)
    228883

    I bellieve that it is disabled as well:
    SQL> show parameter parallel
    NAME TYPE VALUE
    fast_start_parallel_rollback string LOW
    parallel_adaptive_multi_user boolean TRUE
    parallel_automatic_tuning boolean FALSE
    parallel_degree_limit string CPU
    parallel_degree_policy string MANUAL
    parallel_execution_message_size integer 16384
    parallel_force_local boolean FALSE
    parallel_instance_group string
    parallel_io_cap_enabled boolean FALSE
    parallel_max_servers integer 985
    parallel_min_percent integer 0
    parallel_min_servers integer 0
    parallel_min_time_threshold string AUTO
    parallel_server boolean TRUE
    parallel_server_instances integer 2
    parallel_servers_target integer 1024
    parallel_threads_per_cpu integer 2
    recovery_parallelism integer 0

  • How can I run this java program? Please help.

    I have jmf installed, sunone running , the file may be in the wrong directory.
    It is in some directory nowhere near the java lang dir.
    When I try to compile or build i cant. I'm off on a basic thing.
    here is the code.
    import     javax.sound.midi.InvalidMidiDataException;
    import     javax.sound.midi.MidiDevice;
    import     javax.sound.midi.MidiSystem;
    import     javax.sound.midi.MidiUnavailableException;
    import     javax.sound.midi.Receiver;
    import     javax.sound.midi.MidiMessage;
    import     javax.sound.midi.ShortMessage;
    import     javax.sound.midi.SysexMessage;
    public class MidiNote
         /**     Flag for debugging messages.
              If true, some messages are dumped to the console
              during operation.
         private static boolean          DEBUG = false;
         public static void main(String[] args)
              try {
                   // TODO: make settable via command line
                   int     nChannel = 0;
                   int     nKey = 0;     // MIDI key number
                   int     nVelocity = 0;
                   *     Time between note on and note off event in
                   *     milliseconds. Note that on most systems, the
                   *     best resolution you can expect are 10 ms.
                   int     nDuration = 0;
                   int     nArgumentIndexOffset = 0;
                   String     strDeviceName = null;
                   if (args.length == 4)
                        strDeviceName = args[0];
                        nArgumentIndexOffset = 1;
                   else if (args.length == 3)
                        nArgumentIndexOffset = 0;
                   else
                        printUsageAndExit();
                   nKey = Integer.parseInt(args[0 + nArgumentIndexOffset]);
                   nKey = Math.min(127, Math.max(0, nKey));
                   nVelocity = Integer.parseInt(args[1 + nArgumentIndexOffset]);
                   nVelocity = Math.min(127, Math.max(0, nVelocity));
                   nDuration = Integer.parseInt(args[2 + nArgumentIndexOffset]);
                   nDuration = Math.max(0, nDuration);
                   MidiDevice     outputDevice = null;
                   Receiver     receiver = null;
                   if (strDeviceName != null)
                        MidiDevice.Info     info = getMidiDeviceInfo(strDeviceName, true);
                        if (info == null)
                             out("no device info found for name " + strDeviceName);
                             System.exit(1);
                        try
                             outputDevice = MidiSystem.getMidiDevice(info);
                             outputDevice.open();
                        catch (MidiUnavailableException e)
                             if (DEBUG) { out(e); }
                        if (outputDevice == null)
                             out("wasn't able to retrieve MidiDevice");
                             System.exit(1);
                        try
                             receiver = outputDevice.getReceiver();
                        catch (MidiUnavailableException e)
                             if (DEBUG) { out(e); }
                   else
                        /*     We retrieve a Receiver for the default
                             MidiDevice.
                        try
                             receiver = MidiSystem.getReceiver();
                        catch (MidiUnavailableException e)
                             if (DEBUG) { out(e); }
                   if (receiver == null)
                        out("wasn't able to retrieve Receiver");
                        System.exit(1);
                   /*     Here, we prepare the MIDI messages to send.
                        Obviously, one is for turning the key on and
                        one for turning it off.
                   MidiMessage     onMessage = null;
                   MidiMessage     offMessage = null;
                   try
                        onMessage = new ShortMessage();
                        offMessage = new ShortMessage();
                        ((ShortMessage) onMessage).setMessage(ShortMessage.NOTE_ON, nChannel, nKey, nVelocity);
                        ((ShortMessage) offMessage).setMessage(ShortMessage.NOTE_OFF, nChannel, nKey);
                        /* test for SysEx messages */
                        //byte[] data = { (byte) 0xF0, (byte) 0xF7, (byte) 0x99, 0x40, 0x7F, 0x40, 0x00 };
                        //onMessage = new SysexMessage();
                        //offMessage = new SysexMessage();
                        //onMessage.setMessage(data, data.length);
                        //offMessage = (SysexMessage) onMessage.clone();
                   catch (InvalidMidiDataException e)
                        if (DEBUG) { out(e); }
                   *     Turn the note on
                   receiver.send(onMessage, -1);
                   *     Wait for the specified amount of time
                   *     (the duration of the note).
                   try
                        Thread.sleep(nDuration);
                   catch (InterruptedException e)
                        if (DEBUG) { out(e); }
                   *     Turn the note off.
                   receiver.send(offMessage, -1);
                   *     Clean up.
                   receiver.close();
                   if (outputDevice != null)
                        outputDevice.close();
              } catch (Throwable t) {
                   out(t);
              System.exit(0);
         private static void printUsageAndExit()
              out("MidiNote: usage:");
              out(" java MidiNote [<device name>] <note number> <velocity> <duration>");
              out(" <device name>\toutput to named device");
              out(" -D\tenables debugging output");
              System.exit(1);
         private static void listDevicesAndExit(boolean forInput, boolean forOutput) {
              if (forInput && !forOutput) {
                   out("Available MIDI IN Devices:");
              else if (!forInput && forOutput) {
                   out("Available MIDI OUT Devices:");
              } else {
                   out("Available MIDI Devices:");
              MidiDevice.Info[]     aInfos = MidiSystem.getMidiDeviceInfo();
              for (int i = 0; i < aInfos.length; i++) {
                   try {
                        MidiDevice     device = MidiSystem.getMidiDevice(aInfos);
                        boolean          bAllowsInput = (device.getMaxTransmitters() != 0);
                        boolean          bAllowsOutput = (device.getMaxReceivers() != 0);
                        if ((bAllowsInput && forInput) || (bAllowsOutput && forOutput)) {
                             out(""+i+" "
                                  +(bAllowsInput?"IN ":" ")
                                  +(bAllowsOutput?"OUT ":" ")
                                  +aInfos[i].getName()+", "
                                  +aInfos[i].getVendor()+", "
                                  +aInfos[i].getVersion()+", "
                                  +aInfos[i].getDescription());
                   catch (MidiUnavailableException e) {
                        // device is obviously not available...
              if (aInfos.length == 0) {
                   out("[No devices available]");
              System.exit(0);
    e
         *     This method tries to return a MidiDevice.Info whose name
         *     matches the passed name. If no matching MidiDevice.Info is
         *     found, null is returned.
         *     If forOutput is true, then only output devices are searched,
         *     otherwise only input devices.
         private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, boolean forOutput) {
              MidiDevice.Info[]     aInfos = MidiSystem.getMidiDeviceInfo();
              for (int i = 0; i < aInfos.length; i++) {
                   if (aInfos[i].getName().equals(strDeviceName)) {
                        try {
                             MidiDevice device = MidiSystem.getMidiDevice(aInfos[i]);
                             boolean     bAllowsInput = (device.getMaxTransmitters() != 0);
                             boolean     bAllowsOutput = (device.getMaxReceivers() != 0);
                             if ((bAllowsOutput && forOutput) || (bAllowsInput && !forOutput)) {
                                  return aInfos[i];
                        } catch (MidiUnavailableException mue) {}
              return null;
         private static void out(String strMessage)
              System.out.println(strMessage);
         private static void out(Throwable t)
              t.printStackTrace();

    Please post your code using code tags.
    When I try to compile or build i cant.What is your question? Exactly what error message do you get?

  • How can I write this query

    Customer Trans          Transaction     Invoice
    Code     Date Type      Amount
    A001     01-JAN-2004     invoice      1000
    A001     01-FEB-2004      Receipt      -1500
    A001     01-MAR-2004     invoice          2000
    A001     01-APR-2002     invoice          2500
    OUTPUT wanted to be...
    Customer Trans     Transaction     Invoice          
    Code     Date Type      Amount     Balance
    A001 01-JAN-2004 invoice 1000          1000
    A001     01-FEB-2004 receipt -1500          500     
    A001     01-MAR-2004 invoice     2000          2500
    A001     01-APR-2002 invoice     2500          5000
    Hi All,
    Please look into the above data, If analytic function LAG(),CASE expression are possible to locate the cursor position in the single query, then any one can help me out about it. I tried but could not.
    Regards,
    Neel.

    You can do this with the SUM analytic function. Taking the emp table, for example,
      1  select ename, sal, SUM(sal) OVER (order by empno)
      2    from emp
      3*  order by empno
    SQL> /
    ENAME                                 SAL SUM(SAL)OVER(ORDERBYEMPNO)
    SMITH                                 800                        800
    ALLEN                                1600                       2400
    WARD                                 1250                       3650
    JONES                                2975                       6625
    MARTIN                               1250                       7875
    BLAKE                                2850                      10725
    CLARK                                2450                      13175
    SCOTT                                3000                      16175
    KING                                 5000                      21175
    TURNER                               1500                      22675
    ADAMS                                1100                      23775
    JAMES                                 950                      24725
    FORD                                 3000                      27725
    MILLER                               1300                      29025
    14 rows selected.Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Doubt in AXIS-Exception in thread "main" . how can i run this program

    hi
    I am new to axis., I done few webservice program using Jwsdp
    i can't resolve the reason for this exception.
    I have set all the classpath and other path variable that is necessary for axis .,
    I got this example from http://javaboutique.internet.com/tutorials/Axis/index.html
    Can any one help to solve this problem.,
    **************Code***************
    import java.util.*;
    public class NHLService {
      HashMap standings = new HashMap();
      public NHLService() {
        // NHL - part of the standings as per 04/07/2002
        standings.put("atlantic/philadelphia", "1");
        standings.put("atlantic/ny islanders", "2");
        standings.put("atlantic/new jersey", "3");
        standings.put("central/detroit", "1");
        standings.put("central/chicago", "2");
        standings.put("central/st.louis", "3");
      public String getCurrentPosition(String division, String team) {
        String p = (String)standings.get(division + '/' + team);
        return (p == null) ? "Team not found" : p;
    package hansen.playground;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import javax.xml.rpc.namespace.QName;
    import java.net.*;
    public class NHLServiceClient {
       public static void main(String [] args) throws Exception {
           Service service = new Service();
           Call call = (Call)service.createCall();
           String endpoint = "http://localhost:8081/axis/NHLService.jws";
           call.setTargetEndpointAddress(new URL(endpoint));
           call.setOperationName(new QName("getCurrentPosition"));
           String division = args[0];
           String team = args[1];
           String position =
             (String)call.invoke(new Object [] {new String(division), new String(team)});
           System.out.println("Got result : " + position);
    }************ classpath***************
    :/home/sujithkr/webservices/xml-axis/java:
    /home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/axis.jar
    /home/sujithkr/webservices/xml-axis/lib/activation.jar
    :/home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/clutil.jar
    :/home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/commons-logging.jar
    :/home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/jaxrpc.jar
    :/home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/log4j-core.jar
    :/home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/tt-bytecode.jar
    ********************Error Report*******************************
    java hansen.playground.NHLServiceClient atlantic philadelphia
    Exception in thread "main" Error while compiling: /usr/local/tomcat/webapps/axis//NHLService.java
    at org.apache.axis.message.SOAPFaultBuilder.endElement(Unknown Source)
    at org.apache.axis.encoding.DeserializationContextImpl.endElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
    at org.apache.axis.encoding.DeserializationContextImpl.parse(Unknown Source)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at hansen.playground.NHLServiceClient.main(NHLServiceClient.java:21)
    suse-1:/home/sujithkr/webservices # clear
    suse-1:/home/sujithkr/webservices # java hansen.playground.NHLServiceClient atlantic philadelphia
    Exception in thread "main" Error while compiling: /usr/local/tomcat/webapps/axis//NHLService.java
    at org.apache.axis.message.SOAPFaultBuilder.endElement(Unknown Source)
    at org.apache.axis.encoding.DeserializationContextImpl.endElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
    at org.apache.axis.encoding.DeserializationContextImpl.parse(Unknown Source)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at hansen.playground.NHLServiceClient.main(NHLServiceClient.java:21)
    thank you for helping me in your hectic schedule....

    Please post your code using code tags.
    When I try to compile or build i cant.What is your question? Exactly what error message do you get?

Maybe you are looking for

  • Can't select from view even though it appears in ALL_VIEWS

    Oracle's documentation states that all_views "describes the views accessible to the user": http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2117.htm DBA_OBJECTS appears in the ALL_VIEWS, yet I get a "table or view does not exi

  • Disk Utility does not show my internal hard drive.

    Recently, my Macbook Pro crashed. THE PROBLEM 1. I turn it on, it starts normally at first, the Apple Logo Shows for several seconds 2. It changes to a no-smoking sign without the cigarette 3. If I try to boot safe mode, a folder appears with a quest

  • Buggy Safari

    Safari has in recent years deteriorated to the point of crashing at least once a day. I've seen others with similar problems and have yet to see a permanent solution, other than quitting a couple of times and emptying the cache. Both those provide te

  • FaceTime not completing "verifying"

    Am on a MacBook Pro running OSX 10.9.5. For some reason FaceTime is not logging me in, which was working fine. So when I log in using Apple ID, it asks for a verification email ID. However I don't see any email being sent to the ID provided! The 'pin

  • Yahoo! only will not load

    I have been experiencing a problem with Yahoo! ONLY for over 3 months now. No matter what I do or try, nothing seems to correct the issue. When arrive at Yahoo!'s home page (irregardless of how I arrive there) all of the content is listed on the left