OraException from Command.ExecuteReader with SELECT DISTINCT

Hello
I am trying to fill an OraDataReader object from a OraCommand object.
It appears that whenever the statement includes a SELECT DISTINCT, the command fails (even though the SQL statement works fine when executed e.g. in TOAD)
Dim Conn As OraConnection = New Oracle.DataAccess.Client.OraConnection("[Valid connection string]")
Conn.Open()
Dim Command As OraCommand = New OraCommand()
Command.CommandType = CommandType.Text
Command.CommandText = "select DISTINCT nvl(SUBFAMILY_COMPETENCY_ID, 0) SUBFAMILY_ID, nvl(NAME, ' ') NAME, FAMILY_COMPETENCY_ID FAMILY_ID " & _
" from TAXONOMY_RELATIONAL, COMPETENCY " & _
" where TAXONOMY_RELATIONAL.CL_ID = :1 " & _
" AND COMPETENCY.cl_id (+) = TAXONOMY_RELATIONAL.cl_id and COMPETENCY.language_id (+) = :2 " & _
" and COMPETENCY.COMPETENCY_ID (+) = TAXONOMY_RELATIONAL.SUBFAMILY_COMPETENCY_ID " & _
" order by FAMILY_ID, SUBFAMILY_ID"
Command.Parameters.Add("@CL_ID", context.Session!CLID)
Command.Parameters.Add("@LANGUAGE_ID", context.Session!LANGUAGEID)
Dim DataReader As OraDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)
An Oracle.DataAccess.Client.OraException is raised when executing the last statement, but no further details are given in the error message. The stack trace begins as follows
[OraException]()
Oracle.DataAccess.Client.OraException.HandleErrorHelper(Int32 errCode, OraConnection conn, IntPtr opsErrCtx, IntPtr opsSqlCtx, Object src, String procedure) +639
Oracle.DataAccess.Client.OraCommand.ExecuteReader(+737)
Oracle.DataAccess.Client.OraCommand.ExecuteReader(CommandBehavior behavior) +8
The exception disappears as soon as I remove the DISTINT keyword from my SQL statement.
Is this a bug or am I doing something wrong?
Thanks for help,
Bernt Fischer

This issue is same as the one mentioned in the thread with title "Problem with 'Select distinct'" and the fix would be available in the next release.

Similar Messages

  • Help! Howto use the join function in a query with select distinct ?

    Hi!
    I have 2 tables. I want to select only 1 painting of each artists.
    select distinct idartist
    from tbl_artworks
    where blah blah blah
    order by rand()
    how does the "join" function work for add: name, lastname, title, image and much more... i try... but i fail...
    tbl_artists
    idartist
    name
    lastname
    1
    Paul
    Gaugain
    2
    Vincent
    Van Gogh
    3
    Pablo
    Picasso
    tbl_artworks
    idartwork
    idartist
    title
    image
    1
    1
    days of gods
    image1.jpg
    2
    2
    sunflower
    image2.jpg
    3
    3
    Dora maar au chat
    image3.jpg
    4
    2
    Sky
    image4.jpg
    5
    3
    La vie
    image5.jpg

    Getting a single random image for each probably requires a combination of sql and cf.  It would take someone smarter than me to do it with sql alone.  I would probably try something like this:
    1.  Run a database query that gets all the images from all the artists.
    2.  Run a Q of Q that gets a distinct list of artist ids.
    3.  Loop through that list and run a Q of Q to get all the images for that artist.
    4.  Still in that loop, use randrange (1 to the recordcount) to select a random record from your Q of Q

  • Problems with "Select Distinct" Statement

    Hi... I've a little problem with my SQL Statement...
    I've a Table in a DataBase with Solds of the Month... the fields are: vta_fecha, vta_prod, vta_total, vta_mesa.
    I've to Select only the distincts fields of vta_prod... selected by vta_fecha and vta_mesa...
    My code is like this:         try{
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                conec = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/POOL/Data/BaseDat.MDB");
                state = conec.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);try{
                rec = state.executeQuery("Select DISTINCT vta_prod, vta_fecha, vta_mesa from Ventas where vta_fecha = #" + Fecha_q + "# And vta_mesa = 0");           
                rec.first();
                int x = 0;
                while (rec.isAfterLast()==false){
                    x++;
                    rec.next();
                rec.first();
                if (x > 0){
                    Productos = new String[x];
                    Total_Vta = new int[x];
                    Cant_Prod = new int[x];
                    x = 0;
                    while (rec.isAfterLast() == false){
                        Productos[x] = rec.getString("vta_prod");
                        rec.next();
                        x++;
                else{
                    Productos = new String[0];
                    Total_Vta = new int[0];
                    Cant_Prod = new int[0];
            }catch(Exception e){JOptionPane.showMessageDialog(null,e.getMessage());}Now, in the Table I have only 3 diferents vta_prod, but this Statement returns 9 Rows... and I don't know why...
    Please help me...
    Regards...

    I don�t have a complete picture because I don�t know what values you are passing in the select and I don�t know your column types but this is what I think is happening from what you have shared.
    You may have misunderstood what the DISTINCT keyword does.
    The DISTINCT keyword applies to the full set of columns in the select (not just the first column). So in your case it would be equivalent to:
    SELECT vta_prod, vta_fecha, vta_mesa
    FROM Ventas
    WHERE ...
    GROUP BY by vta_prod, vta_fecha, vta_mesa
    So, it doesn't matter that you only have 3 distinct vta_prod values if you have multiple values being returned in the other columns. The vta_mesa column can only a return a single value as �0�. That leaves the vta_fecha column which is probably a date/time column and is probably the column that is returning the three other distinct values (one date with three distinct times).
    (3 vta_prod) x (3 vta_fecha) x (1 vta_mesa) or 3x3x1 = 9 rows
    So find a way to strip the time from vta_fecha in your select statement and your SQL should return the results you expect. I�m not an Access expect but I think I remember you can use something like the �Convert� or �DatePart� functions to make that happen (check your documentation to be sure)..
    A couple of asides;
    1) You should use a PreparedStatement and rarely if ever use Statement.
    2) You should start Java variable names with lower case.

  • "connect by" problem with "select distinct"

    When I run the following SQL (using "Scott" DB):
    select *
    from emp
    where deptno = 30 or mgr is null
    start with mgr is null
    connect by prior empno = mgr
    order siblings by ename
    I get the results one would expect. The President is first and all those reporting to him/her are listed in correct sequence.
    EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO
    7839,KING,PRESIDENT,,11/17/1981,5000,10
    7698,BLAKE,MANAGER,7839,5/1/1981,2850,30
    7499,ALLEN,SALESMAN,7698,2/20/1981,1600,300,30
    7900,JAMES,CLERK,7698,12/3/1981,950,30
    7654,MARTIN,SALESMAN,7698,9/28/1981,1250,1400,30
    7844,TURNER,SALESMAN,7698,9/8/1981,1500,0,30
    7521,WARD,SALESMAN,7698,2/22/1981,1250,500,30
    However, when I run the same query but make it "select distinct" I get the following:
    EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO
    7499,ALLEN,SALESMAN,7698,2/20/1981,1600,300,30
    7698,BLAKE,MANAGER,7839,5/1/1981,2850,,30
    7900,JAMES,CLERK,7698,12/3/1981,950,,30
    7839,KING,PRESIDENT,,11/17/1981,5000,,10
    7654,MARTIN,SALESMAN,7698,9/28/1981,1250,1400,30
    7844,TURNER,SALESMAN,7698,9/8/1981,1500,0,30
    7521,WARD,SALESMAN,7698,2/22/1981,1250,500,30
    Why would adding "distinct" to the select cause the result to be sorted STRICTLY by ename (per "order siblings by...")?
    Finally, if I "select distinct" but don't specify any "order" I get this, in NO APPARENT order:
    EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO
    7499,ALLEN,SALESMAN,7698,2/20/1981,1600,300,30
    7521,WARD,SALESMAN,7698,2/22/1981,1250,500,30
    7654,MARTIN,SALESMAN,7698,9/28/1981,1250,1400,30
    7698,BLAKE,MANAGER,7839,5/1/1981,2850,,30
    7839,KING,PRESIDENT,,11/17/1981,5000,,10
    7844,TURNER,SALESMAN,7698,9/8/1981,1500,0,30
    7900,JAMES,CLERK,7698,12/3/1981,950,,30
    Thanks in advance for any insight offered!
    -Gene

    you have to specify what is going to be the distict field.No you don't. DISTINCT keyword applies to the whole SELECT list. See your own link.
    In any case this does not appear to have anything to do with what you SELECT, rather that the SORT UNIQUE caused by the DISTINCT keyword appears to prevent the ORDER SIBLINGS BY clause from working correctly.
    Not really sure why you need DISTINCT in this example, no doubt this is being applied elsewhere. Given that you have duplicates in the rowset and that hierarchical query now supports views, perhaps it would be more efficient to apply DISTINCT keyword first, something like...
    SELECT e.*
    FROM (SELECT DISTINCT e.*
    FROM emp e
    WHERE e.deptno = 30
    OR e.mgr IS NULL) e
    START WITH e.mgr IS NULL
    CONNECT BY PRIOR e.empno = e.mgr
    ORDER SIBLINGS BY e.ename;
    Alternatively you could skip ORDER SIBLINGS BY clause and use SYS_CONNECT_BY_PATH function to get your order, something like...
    SELECT e.*
    FROM (SELECT DISTINCT e.*,
    SYS_CONNECT_BY_PATH () path
    FROM emp e
    WHERE e.depno = 30
    OR e.mgr IS NULL
    START WITH e.mgr IS NULL
    CONNECT BY PRIOR e.empno = e.mgr) e
    ORDER BY e.path
    Padders

  • Need help with select distinct with group by

    RDBMS 10gr2
    I am trying achieve having a select distinct with a order by and after looking on the internet and trying different examples, I have been unsucessful.
    Here is the code working (not sorting - I wish to sort by pps.last_name however I can't seem to get it to work).
    select distinct pps.last_name || ', ' ||pps.first_name || ' ' ||pps.middle_initial || '.' d,
           emple_no r
      from cobr.vw_pps_payroll pps,
           projman pm
    where term_date is null
       and department = '0004400000'
       and pm.eid != pps.emple_no

    SQL> SELECT   ename || '-' || empno, sal
      2      FROM emp_test
      3  ORDER BY ename;
    ENAME||'-'||EMPNO                                                                         SAL
    BLAKE-7698                                                                              20000
    CLARK-7782                                                                              20000
    DAVID-7699                                                                              20000
    FORD-7902                                                                                6000
    JONES-7566                                                                               5950
    KING-7839                                                                               10000
    SCOTT-7788                                                                               6000
    7 ligne(s) sélectionnée(s).
    SQL>

  • Issue with "Select Distinct" query in Oracle 10g against Oracle 9i

    Hi,
    I would appreciate if some one help me here because it is really urgent.
    We are upgrading our database from 9i to 10g.
    There are the "Select distinct" queries in the code which populated the grid on the applications screens. We found a difference in 9i and 10g the way the result is populated for these queries. If "Select Distinct" query wihtout a order by clause is executed in 9i then the result is automatically sorted. But Oracle 10g does not do this.
    We can change the queries adding order by clause but we are almost at the end of the testing and want to know if there is any way that we can do this from database settings. Would there be any impact of these settings change on overall operation of Oracle 10g?
    I would appreciate if some one can help me here.
    Thanks,
    Dinesh

    then the result is automatically sorted.No. Oracle may have done a sort operation to perform the distinct, but it still did not guarantee the order of your results.
    In 10g and in 9i, if you want your results in a certain order you must use order by.

  • Something´s going wrong with select distinct (Oracle 10g)

    Our database is oracle 10g release 2 and the query statement is:
    select distinct last_name
    from students;
    and the query returns all of the last_names without an specific order..
    If I execute the same query in oracle 9i the query returns all of the last_name in alphabetic order.
    Why is it different on Oracle 10g?

    See also this blog entry from Mr. Kyte.
    C.

  • Invoking Forms 6i application from command line with parameters

    Hi,
    I have a java application that requires to start up and execute an existing Forms 6i application.
    I am not a java person, and I could not find any help regarding this. If anyone knows how to execute an fmx(6i) from within a java application, then please let me know. The java application has to pass in parameters so that the the Forms application opens up with the correct data.
    One alternative suggested was that the java application execute a command line invocation of the Forms application. I am looking for the correct and complete syntax to do this. The fmx can be invoked from the command line with the following entered at the dos prompt -
    c:\>OraFrm6i\Bin\ifrun60.exe<module name> <userid/password@db>. This works fine and the Forms application is executed.
    The requirement is to pass a couple of user defined parameters to the Forms application which can be used by it to query the database and display the correct information when it opens.
    Any help on this would be greately appreciated.
    Thanks
    Shailesh

    Shailesh,
    Create a parameter in your form - eg. COUNTRY_CODE and add any startup code.
    Then add the parameter to your command line (or put it in a *.bat file)
    c:\>OraFrm6i\Bin\ifrun60.exe<module name> <userid/password@db> country_code=UK
    JR

  • Startup and shutdown from command line with version 9i

    Hi, i'm an Oracle newbie. I heard it's possible to startup and shutdown an oracle (instance? or database? which one is it) from the command line.
    A little background on what it is that I want to do:
    I'm looking to backup a database by copying the files that make up the database to a location from where they will be commited to tape media. To do this I must shutdown the database, copy the files, and startup the database again.
    At the moment the backups are full exports which I find unnecessary since it is a development database which is never used at night. It is therefore not an issue if we want to shut it down and re-start it after a few minutes. (I think it would take longer to export as opposed to copy the files right?)
    I need help and advice :
    1. Is my way of going about this correct ?
    2. How do I startup/shutdown from the command line (sqlplus user/password command) or should I use another utility ?
    Thanks,
    Gabriel

    set oracle_sid=ORCL ==> your database namethis is NOT always true. It's instance name. usually, we set instance name is same as database name.But we also can set instance name is different from database name.
    for example.
    C:\>oradim -new -sid abc123
    C:\>set ORACLE_SID=abc123
    C:\>sqlplus /nolog
    SQL*Plus: Release 9.0.1.4.0 - Production on Tue Jun 20 22:40:59 2006
    (c) Copyright 2001 Oracle Corporation.  All rights reserved.
    SQL> conn / as sysdba
    Connected to an idle instance.
    SQL> startup pfile=E:\ora901DB\admin\init.ora
    ORACLE instance started.
    Total System Global Area  344748244 bytes
    Fixed Size                   282836 bytes
    Variable Size             184549376 bytes
    Database Buffers          159383552 bytes
    Redo Buffers                 532480 bytes
    Database mounted.
    Database opened.
    SQL> select name from v$database;
    NAME
    DB901
    SQL> select instance_name from v$instance;
    INSTANCE_NAME
    abc123

  • Running report from command line with multiple value for same parameter

    Hey,
    I know how to run a report from the command line specifying parameters values each time but I was wondering if someone could tell me how I would go about running the same report multiple times in a batch program but specifying a list of values to pass to a parameter each time.
    So for example if a parameter was 'School Number', how could I run a report in a batch program that would pass a school number to the report as a parameter using a list of school numbers generated for a sql statement or something. So if I had 300 school numbers in my list then I would get 300 different reports when the batch program finished.
    This leads me to another question. How can I dynamically change the name of the report generated by the batch to use the school number value passed in, so for example if the value 3 was passed in the name would be something like School 3.pdf, if 4 was passed in the name would be School 4.pdf....etc
    Any help on this?
    Thanks

    Hello,
    Bursting and Distribution may help you ....
    37 Bursting and Distributing a Report
    http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b13895/orbr_dist.htm
    Regards

  • 'Group in stack' command fails with selected photos in Lightroom 1.2

    I am a Mac user (new Intel iMac running OS 10.4.11), and have successfully been able to stack photos up until this point. Now suddenly, they will not stack. I've color labelled photos in a shoot by theme, and have been stacking them. I can't see anything different in this situation.
    I tried closing out LR, then restarting. Stacking still doesn't work. (Options in the Photo > Stacking menu are greyed out.)
    Any suggestions?

    I am not in a collection, but your question prompted me to notice that while all of the photos I am working with at the moment are from a single shoot, and therefore should be in one folder, for some reason, not all of them were showing up in the folder. I spent considerable time yesterday trying to figure out a way to locate them, and I am suspecting that I inadvertently made a mistake somewhere with keywords. I do recall seeing an unusual icon in the upper right hand corner of one of the images. When I held the cursor over it, it opened a window that told me that the metadata had been changed outside of the program (!?) and how did I want LR to handle this. I had no idea what this was referring to, how it happened, or what the implications were -- but I had to make a choice, so I chose 'overwrite'. It may be coincidental that the stacking problem started about the same time. In any case, I finally got them all back in view, and systematically went back through them making sure that each batch had the desired keywords. In the mean time -- for whatever reason -- I am once again able to operate stacking & its functions.
    As you can see, I am still very much a beginner with LR, but as I go, I am loving its power and generally more intuitive feel. I am using far more than PS at this point, although I know that there will be some things I can only do in PS.
    Thank you for your support!

  • How to undo "select distinct" in OBIEE

    Hello guys
    I found that pretty much in all the reports that we created in OBIEE, the presentation service would generate SQL that starts with "select distinct" when I view the query log..
    I'd like to know what configuration in the Admin Tool or presentation service is controlling this behavior of OBIEE. For some reason as I am tuning the performance by running the same query in DB, the same query without "distinct" can go so much faster than the original one from OBIEE.. So I'd like to configure my RPD so that certain reports will not have "select distinct". I know that by default, the BI server will always generate a "distinct", but is there a way to override this default, if not, what might be some performance tuning tactics I can use?
    Any thoughts?
    Thanks
    Edited by: user7276913 on Oct 27, 2009 8:20 PM

    BenS wrote:
    Two issues with this that I encountere:
    When I selected the first suggested option at the Physical Layer for the database, I found the "DISTINCT SUPPORTED" option. There were two columns checked: Value and Default. I was able to unselect Value but not Default.
    (1) What is the difference between Value and Default?
    (2) If I only unselect Value will it stop Answers from adding the DISTINCT to every query created?
    Second, when I selected the source from the business model mapping, it already did not have the DISTINCT box checked. Therefore, I could not limit this at the Logical layer as I would have preferred.
    If you could help me understand the first option it may clarify how to implement option # 2.
    Thanks...1) the defaults are stored in an .ini file and serve the purpose of defining the defaults when you hit the 'revert to default' button.
    If you unselect value, you are telling OBIEE that the database for which you are changing these options does not support the distinct clause, I doubt you wish to do this across the entire application.
    I think you will find that OBIEE applies the distinct :
    1) when the LTS has distinct ticked.
    2) When the column in question is not part of a dimension hierachy key (if it is, your telling the OBIEE server these should be unique, so wont issue the distinct)
    or
    3) the column forms part of a key in either logical BMM layer or as part of a physical key.
    adding the column to a Dim Hierachy wont be an option in most cases, you could try playing with just setting this column as a key on the BMM layer or Physical layer , and let us know if this helps.

  • Problem with select max(FIELD)

    I have a table with the following fields:
    PARTID     ART_TYP     AEC     SERVICE     PLANT     STATUS
    4711     A     A     2     P     230
    4711     A     B     0     P     230
    4712     A     B     2     P     230
    4713     A     B     0     P     230
    I need a sqlscript where I get the records with MAX(SERVICE)
    In this example
    4711     A     A     2     P     230
    4712     A     B     2     P     230
    4713     A     B     0     P     230
    I tried this with:
    select distinct partid,
         art_typ,
         aec,
         max(service),
         plant,
         status
    from t_msltmp
    group by partid,art_typ,aec,plant,status
    But I get both records of partid=4711
    Can someone help me with this problem
    kind regards
    Menk Slot

    ROW_NUMBER() requires explicit ORDER BY clause in OVER:
    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/functions105a.htm#86312
    SQL> select partid, art_typ, aec, mx, plant, status
      2  from(select partid,
      3                art_typ,
      4                aec,
      5                max(service) over (partition by partid) mx,
      6                row_number() over (partition by partid order by service desc) rn
      7                plant,
      8                status
      9         from t_t)
    10  where rn = 1
    11  /
        PARTID A A         MX P     STATUS
          4711 A A          2 P        230
          4712 A B          2 P        230
          4713 A B          0 P        230Rgds.
    P.S.
    Another way to get this (more tedoius):
    SQL> select partid,
      2  max(art_typ) keep (dense_rank first order by service desc) art_typ,
      3  max(aec) keep (dense_rank first order by service desc) aec,
      4  max(service) service,
      5  max(plant) keep (dense_rank first order by service desc) plant,
      6  max(status) keep (dense_rank first order by service desc) status
      7  from t_t
      8  group by partid
      9  /
        PARTID A A    SERVICE P     STATUS
          4711 A A          2 P        230
          4712 A B          2 P        230
          4713 A B          0 P        230Message was edited by:
    dnikiforov

  • How to deal with Select Menu when it can NULL or a Value with SQL

    I have a SELECT Menu(:P_55X) with:
    "NULL DISPLAY VALUE" = NULL
    "NULL RETURN VALUE" = NULL
    The Chart query is as follows.
    SELECT NULL LINK,
    START_DATE "FOR_MONTH",
    ROUND(AVG("SLA"),3) "SLA_UPTIME"
    from SLA_TIMES_ZABBIX
    LEFT JOIN (SELECT DISTINCT NODE_NAME,OS_TYPE from CMS.CMS_NODE_OS where remove_dt is NULL) OSNODE on LOWER(SLA_TIMES_ZABBIX.NODE_NAME)=LOWER(OSNODE.NODE_NAME)
    where OS_TYPE=:P55_X group by START_DATE order by START_DATE ASC;
    How can I accout for the (:P55_X) variable being NULL sometimes and not null other times. meaning I can't use the "=" when the values is null because I need a IS NULL there.
    The column in the database either has a value or is NULL.
    Thanks
    Robert

    where (OS_TYPE = :P55_X OR (:P55_X IS NULL and OS_TYPE IS NULL))

  • Test Execution hangs while executing a test from Command prompt option

    I have done the following
    1) Created a script Test driver
    2) Added different scripts as Script->Properties->Assets to the driver script
    3) Call each of this asset script from TestDriver using command getScript("<<ScrptName>>".run(1, true, true, true);
    4) Now calling this TestDriver script from command prompt with command
    e:\\OracleATS\\agent
    runScript.bat E:\\INTEGRATION_SERVICES\\Identity_management\\Automation\\Scripts\\MasterScripts\\TestDriver
    TestDriver.jwg
    The script execution hangs at "Initializing VU 1 for Script TestDriver. After few mintues of seeing this message i get error "Execution Timed Out".
    Do I need to keep openscript UI open for script execution from command line ?
    Is there any way to increase this Execution Time out ? May be it is taking time to load the internal script assets. AS other scripts are running fine on the same machine from command prompt itself.
    Complete error is as follows
    C:\Documents and Settings\oracle>e:\\OracleATS\\agent\\runScript.bat E:\\INTEGRATION_SERVICES\\Identity_management\\Automation\\Scripts\\MasterScripts\\TestDriv
    er\\TestDriver.jwg
    Running "TestDriver" ...
    Agent started. Available commands:
    stop - Stop the virtual user after it finishes the current iteration.
    abort - Abort the virtual user cleanly, before it finishes the current itera
    tion.
    exit - Terminate the process immediately
    You may type the above commands at any time.
    12:17:53,418 INFO [1] Initialized script service "oracle.oats.scripting.modules.utilities.api.UtilitiesService"
    12:17:53,418 INFO [1] Initialized script service "oracle.oats.scripting.modules.browser.api.BrowserService"
    12:17:53,418 INFO [1] Initialized script service "oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService"
    12:17:53,465 INFO [1] Initialized script service "oracle.oats.scripting.modules.webdom.api.WebDomService"
    12:17:53,856 INFO [1] Initialized script service "oracle.oats.scripting.modules.datatable.api.DataTableService"
    12:17:53,856 INFO [1] Initializing VU 1 for script TestDriver
    Execution Timed Out.

    Hi e_raja_sekar,
    You wrote:
    public static void main(String args){should be
    public static void main(String args[]){Granted, the below code was tested on Windows XP using J2SE SDK 1.4.1_02 (and not 1.2.2 like Sridhar is using), but when I compiled and executed this code:
    public class BadMain {
      public static void main(String args) {
        System.out.println("Hello World");
    }The output I got was:
    Exception in thread "main" java.lang.NoSuchMethodError: mainSo I don't think this is Sridhar's problem (but I could be wrong) since he says that he gets no error message.
    Cheers,
    Avi.

Maybe you are looking for