Urgent-Help in SQL

Hi All
I have used the Case statement in my select query which is as:
SELECT LOTNO,CHIPTYPE,QUANTITY,CASE WHEN (LOTSIZE-QUANTITY)>=0 THEN to_char(LOTSIZE-QUANTITY) ELSE 'Error in Lot Size Entry' END AS REMAINING FROM TEMP_QTYCHIPWISE ORDER BY LOTNO
This query is working fine in Oracle9i but giving error in 8i.
What could be reason behind it.
Regards
Manpreet

This is pasted direct from my sqlplus window:
Connected to:
Oracle8i Release 8.1.7.0.0 - Production
JServer Release 8.1.7.0.0 - Production
SQL> select case when dummy = 'X' then 1 end from dual;
CASEWHENDUMMY='X'THEN1END
1
What error are you getting ?
Is your sql embedded in another tool ? Tools do not always support the latest database features.

Similar Messages

  • Need URGENT help in SQL

    I have two tables a and b with one column each (data type number) with NO relationship between them.I want to create anew table with two coloumns with data from table a in the first column and data from table b in the second column.like below:
    Table A
    366
    42
    88
    Table B
    99
    100
    2345
    table c
    366 99
    42 100
    88 2345
    This is very urgent and I request anyone to help me.
    Thanks
    Srichakra

    Going by your description (and not your posted example) I get this:
    SQL> select a.only_col a_only_col
      2        ,b.only_col b_only_col
      3  from
      4  (select only_col
      5         ,row_number() over (order by only_col) rn
      6   from   A
      7  ) A
      8  ,
      9  (select only_col
    10         ,row_number() over (order by only_col DESC) rn
    11   from   B
    12  ) B
    13  where A.rn = B.rn
    14  order by a.only_col
    15  ;
              A_ONLY_COL           B_ONLY_COL
                      42                 2345
                      88                  100
                     366                   99

  • Very Urgent Help , ABAP SQL Query

    Guys,
    Please suggest.I have a table(custom_table1) with a field say A which is of date type = c and length = 9. And i want to query this table.Following is the query.
    Select substr(A,0,5) B C into itab From table custom_table1
    where b = ( select b from cusstom_table2 )
    and substr(A,0,5) = Input_A.
    That is i want to equate an Input_A (which is of 5 character length) with field A (only first 5 character of the 9 length). But it seems the query is wrong. Kindly help ,very urgent
    Thanks

    Thanks guys, U have helped me to fill up the where condition as
    but what about the column A in the select query ?I need only 5 characters from the field populated into Itab.
    CONCATENATE  srch_str '%' INTO srch_str.  -- bcos i want it to be 'InputA%'
    Select Substr(A,0,5) , B C Into Itab From CustomTable 1 where B = (Select B from customtable2) and A Like SrchStr
    Is there any means i can populate only the 5 characters from the select field A into Itab without using Substr (becos it doesnt work) ? Please help.

  • URgent: Help regarding SQL Query

    Hi ,
    I need help regarding an sql query.
    Sample Data:
    ITEM_TYPE  ITEM_NUM   UNIT_PRICE QUANTITY       LINE_TOTAL
    ITEM         1            5         10           50
    ITEM         2           10         5            50
    ITEM         1            5          5            25
    ITEM                       2         10           20
    TAX                                               16.5
    TAX                                              -3.5I would like to display the data as
    ITEM_TYPE ITEM_NUM  UNIT_PRICE          QUANTITY          LINE_TOTAL
    ITEM       1          5                 15               145
                  2         10                  5 
                              2                 10
    TAX                                                          13.0
    Line_total = unit_price * QuantityThanks in Advance
    G.Vamsi Krishna
    Edited by: user10733211 on Aug 5, 2009 7:42 AM
    Edited by: user10733211 on Aug 5, 2009 7:49 AM
    Edited by: user10733211 on Aug 5, 2009 8:12 AM
    Edited by: user10733211 on Aug 5, 2009 8:22 AM
    Edited by: user10733211 on Aug 5, 2009 8:24 AM

    Hi,
    Try this, use some analytics:
    SQL> with t as (
      2  select 'item' item_type, 1 item_num, 5 unit_price, 10 quantity, 50 linetotal from dual union all
      3  select 'item', 2, 10, 5, 50 from dual union all
      4  select 'item', 1, 5, 5, 25 from dual union all
      5  select 'item', null, 2, 10, 20 from dual union all
      6  select 'tax', null, null, null, 16.5 from dual union all
      7  select 'tax', null, null, null, -3.5 from dual
      8  ) -- actual query starts here:
      9  select item_type
    10  ,      item_num
    11  ,      unit_price
    12  ,      sum_qty
    13  ,      case when sum_lt = lag(sum_lt) over ( order by item_type, item_num )
    14              then null
    15              else sum_lt
    16         end  sum_lt
    17  from ( select item_type
    18         ,      item_num
    19         ,      unit_price
    20         ,      quantity
    21         ,      sum(quantity) over  ( partition by item_type, item_num ) sum_qty
    22         ,      sum(linetotal) over ( partition by item_type )           sum_lt
    23         ,      row_number() over ( partition by item_type, item_num  order by item_type, item_num ) rn
    24         from   t
    25       )
    26  where rn=1;
    ITEM   ITEM_NUM UNIT_PRICE    SUM_QTY     SUM_LT
    item          1          5         15        145
    item          2         10          5
    item                     2         10
    tax                                           13
    4 rows selected.
    edit
    And please use the code tag, instead of clunging with concats.
    Read:
    http://forums.oracle.com/forums/help.jspa
    Edited by: hoek on Aug 5, 2009 5:15 PM
    edit2
    Also nulls for item_type:
    ops$xmt%OPVN> with t as (
      2  select 'item' item_type, 1 item_num, 5 unit_price, 10 quantity, 50 linetotal from dual union all
      3  select 'item', 2, 10, 5, 50 from dual union all
      4  select 'item', 1, 5, 5, 25 from dual union all
      5  select 'item', null, 2, 10, 20 from dual union all
      6  select 'tax', null, null, null, 16.5 from dual union all
      7  select 'tax', null, null, null, -3.5 from dual
      8  ) -- actual query starts here:
      9  select case when item_type = lag(item_type) over ( order by item_type, item_num )
    10              then null
    11              else sum_lt
    12         end  item_type
    13  ,      item_num
    14  ,      unit_price
    15  ,      sum_qty
    16  ,      case when sum_lt = lag(sum_lt) over ( order by item_type, item_num )
    17              then null
    18              else sum_lt
    19         end  sum_lt
    20  from ( select item_type
    21         ,      item_num
    22         ,      unit_price
    23         ,      quantity
    24         ,      sum(quantity) over  ( partition by item_type, item_num ) sum_qty
    25         ,      sum(linetotal) over ( partition by item_type )           sum_lt
    26         ,      row_number() over ( partition by item_type, item_num  order by item_type, item_num ) rn
    27         from   t
    28       )
    29  where rn=1;
    ITEM_TYPE   ITEM_NUM UNIT_PRICE    SUM_QTY     SUM_LT
           145          1          5         15        145
                        2         10          5
                                   2         10
            13                                          13
    4 rows selected.If you really need a space instead of nulls, then simply replace the nulls by a space....
    Edited by: hoek on Aug 5, 2009 5:18 PM

  • URGENT HELP ON SQL LOADER CONTROL FILE

    Dear All,
    Please find my control file below. I need two leading zeros for the coulmn DDA_CLEARING_NUMBER. Presently its loading 18 characters. position is (0791:0808). Now i need this to be loaded with two leading zeros to the left. I need padding two zeros in front of the 18 characters. HOW CAN I DO THAT? PLEASE HELP ME IN IT.
    OPTIONS (DIRECT=FALSE,
    ROWS=30000,
    BINDSIZE=3000000,
    READSIZE=3000000,
    SKIP_UNUSABLE_INDEXES=TRUE)
    LOAD DATA
    INFILE '/xxx/xxx/xxx.dat'
    BADFILE '/xxx/xxx/xxx.bad'
    DISCARDFILE '/dev/null'
    APPEND
    INTO TABLE AAA
    WHEN MONTH_END_STATUS = 'O'
    TIME_PERIOD POSITION (0079:0086) DATE "YYYYMMDD",
    SERVICE_TYPE POSITION (0077:0078) CHAR,
    ACCOUNT_NUMBER POSITION (0001:0020) CHAR,
    MONTH_END_STATUS POSITION (0060:0060) CHAR,
    CIF_BANK POSITION (0066:0069) CHAR,
    CIF_BRANCH POSITION (0070:0074) CHAR,
    PLAN_CODE POSITION (0075:0076) CHAR,
    DDA_CLEARING_NUMBER POSITION (0791:0808) CHAR,
    TAX_ID POSITION (0516:0524) CHAR)

    Dear peterson,
    When i do what you said, its inserting nothing. not even space. Please help me in it what to do?
    thanks and regards

  • Urgent help in sql plz

    hi
    i need to genarate sql query for 1 table
    X id   Yid Day
    1 a 11/12/2006
    1 a 11/12/2006
    1 p 11/12/2006
    1 a 3/12/2006
    1 p 3/12/2006
    2 a 11/12/2006
    2 p 11/12/2006
    I need to genearte report in follwoing format
    X_id y_id Day day count
    1 a 11/12/2006 2
    1 p 11/12/2006 1
    toal count for x_id 3
    2 a 3/12/2006 1
    2 p 3/12/2006 1
    totla count for x_id 2
    3 a 11/12/2006 1
    3 p 11/12/2006 1
    totla count for x_id 2

    i am not very good at rollup and grouping :-(, but i used analytics hope this can give you some hints and you can accommodate "break" in there,
    Create Table test As
    Select 1 X_id , 'a' y_id, to_date('11/12/2006','dd/mm/rrrr') "Day" From dual Union All
    Select 1, 'a', to_date('11/12/2006','dd/mm/rrrr') From dual Union All
    Select 1, 'p', to_date('11/12/2006','dd/mm/rrrr') From dual Union All
    Select 1, 'a', to_date('3/12/2006','dd/mm/rrrr') From dual Union All
    Select 1, 'p', to_date('3/12/2006','dd/mm/rrrr') From dual Union All
    Select 2, 'a', to_date('11/12/2006','dd/mm/rrrr') From dual Union All
    Select 2, 'p', to_date('11/12/2006','dd/mm/rrrr') From dual
    SQL>
    SQL> Select x_id, y_id, "Day", cnt , Sum(cnt) over (Partition By x_id,"Day" Order By x_id) tot_cnt From
      2  (
      3  Select Unique x_id, y_id, "Day", Count(*) over (Partition By x_id, y_id, "Day") cnt
      4  From test
      5  );
          X_ID Y_ID Day                CNT    TOT_CNT
             1 a    12/3/2006            1          2
             1 p    12/3/2006            1          2
             1 a    12/11/2006           2          3
             1 p    12/11/2006           1          3
             2 p    12/11/2006           1          2
             2 a    12/11/2006           1          2
    6 rows selected
    SQL>
    My first try at break and compute command,
    SQL> break on x_id
    SQL> compute sum of cnt on x_id
    SQL> Select Unique x_id, y_id, "Day", Count(*) over (Partition By x_id, y_id, "Day") cnt
      2  From test
      3  /
          X_ID Y Day              CNT
             1 p 03-DEC-06          1
               a 03-DEC-06          1
    sum                             2
             2 a 11-DEC-06          1
               p 11-DEC-06          1
    sum                             2
             1 a 11-DEC-06          2
               p 11-DEC-06          1
          X_ID Y Day              CNT
    sum                             3
    6 rows selected.Message was edited by:
    Nicloei W

  • Need urgent help in SQL *PLUS

    I downloaded Oracle10g on my computer it was workink fine until I opened my registry editor then I couldn't open SQL PLUS for Oracle10g I receive this massages Error6 initializing SQLPLUs , Massage file sp1<lang>.msb not found
    and sp2-0750: you may need to set Oracle_Home to your Oracle software directory.

    Try to use the Windows System Restore to repair the registry:
    start->All Programs->Accessories->System Tools->System Restore.
    You need to log in as administrator.
    Jack
    &#36335;&#28459;&#28459;&#20854;&#20462;&#36828;&#20846;&#65292;&#21566;&#23558;&#19978;&#19979;&#32780;&#27714;&#32034;&#12290;
    The way ahead is long; I see no ending, yet high and low I’ll search with my will unbending.

  • Urgent HELP required on forming the Matrix of data using PL/SQL

    Hi All,
    I'm new to this thread and require your urgent help in this regard.
    I've got a requirement for building a 5000 X 5000 matrix using PL/SQL. My original data tables have 5000 rows each and I need to do a correlation analysis using this data and need to store in a physical table and not in-memory. Is this feat achievable using mere PL/SQL? I understand that Oracle DB has a limitation of 1000 columns(but not sure) and hence I'd like to know whether there is any work-around for such scenarios. If not, what are the other alternative method(s) to achieve this feat? Do I need to use any 3rd party tools to get this done? An early reply from the experts is highly appreciated.
    Thanking you all Gurus in advance.
    Rgds
    Sai

    Welcome to OTN!
    I'll get to your quesiton in a moment, but first some welcome information. Many OTN posters consider it impolite to mark threads as "urgent". We are volunteers and have jobs of our own to do without people we don't know making demands. You are brand new and deserve some patience but please understand this. It is very likely before I finish this post someone will complain about the word "urgent" in your subject.
    On to more interesting things :)
    You can do the matrix, but are out of luck with a 5000 x 5000 table because Oracle only allows 1000 columns per table. There are ways to work around this.
    How do do the matrix depends on what you want to do. You can do this different ways. You can create a table beforehand and use PL/SQL or simple SQL to populate it, or use the CREATE TABLE AS syntax to create and populate it in one step if you can get the underlying SQL to work the way you want, something like
    create table my_table as
      select a.*, b.*
        from table1 a, table2 bcan populate a matrix from 2 tables with an intentional cartesian join (the WHERE clause was left out intentionally, provided your data is already in the data base.
    If not you can use a PL/SQL routine to populate the data.
    There are a couple of ways to solve the 1000 column limit. The easiest way might be to have 5 collections of 1000 columns each. A more complicated but more elegant soltion would be to have nested collections, allowing 2 colliections that you can loop through - a collection of collections. Nested collections can be hard to work with. A third way would be to use nested tables in the database but I personally do not like them and the insert, update, and delete statements for nested tables are hard to use.
    I'm not going to give a code example because I am not sure which solution is best for you. If you have further questions post them.

  • Urgent help needed... PL/SQL Insert statement

    Hi...
    I need some urgent help on this project. I have a 2 column table with values that need to be inserted into another existing table which has a sequence.
    This is the 2 column table:
    FUND YEAR
    29587 05
    29587 07
    Existing table:
    Name Null? Type
    LIST_ID NOT NULL NUMBER(6) -- This is a sequence
    WEB_USER_ID NOT NULL VARCHAR2(10)
    RESOURCE_TYPE NOT NULL VARCHAR2(8)
    LIST_TYPE NOT NULL VARCHAR2(10)
    LIST_NAME NOT NULL VARCHAR2(50)
    LIST_CODE_1 NOT NULL VARCHAR2(6) -- FUND from table above
    LIST_CODE_2 NOT NULL VARCHAR2(6) -- YEAR from table above
    LIST_CODE_3 NOT NULL VARCHAR2(6)
    LAST_UPDATED_DT NOT NULL DATE
    LAST_UPDATED_BY NOT NULL VARCHAR2(10)
    LIST_CODE_4 NOT NULL VARCHAR2(20)
    The columns from table 1 (FUND, YEAR) correspond to columns (LIST_CODE_1, LIST_CODE_2) in table 2. The column LIST_ID is a sequence. I can put in sysdate for LAST_UPDATED_DT and my initials SN for LAST_UPDATED_BY. This is going to be for 2 unique WEB_USER_IDs which would be in the WHERE clause. I will be inserting 2200 rows for each id. A single insert statement would look like this -
    INSERT INTO EXISTING_TBL (list_id,web_user_id,resource_type,list_type,list_name,list_code_1,list_code_2,list_code_3,list_code_4,last_updated_dt,last_updated_by) VALUES ('470027','WEBUSER','GL','FUNDFYF',' FUND BALANCE SUM','12010','01',' ',' ',{ts '2010-5-19 10:16:9'},'SN')
    How would I do this to insert the 2200 values from my 2 column table to the existing table?
    All help is greatly appreciated!!
    SN

    Hello ,
    I think this will work
    INSERT INTO TABLE2
         LIST_ID,
         WEB_USER_ID,
         RESOURCE_TYPE,
         LIST_TYPE,
         LIST_NAME,
         LIST_CODE_1,
         LIST_CODE_2,
         LIST_CODE_3,
         LIST_CODE_4,
         LAST_UPDATED_DT,
         LAST_UPDATED_BY
    SELECT
         SEQ.NEXTVAL,
         FUND,
         YEAR,
         <VALUE FOR RESOURCE_TYPE>,
         <VALUE FOR LIST_TYPE>,
         <VALUE FOR LIST_NAME>,
         <VALUE FOR LIST_CODE_1>,
         <VALUE FOR LIST_CODE_2>,
         <VALUE FOR LIST_CODE_3>,
         <VALUE FOR LIST_CODE_4>,
         SYSDATE,
         'SN'
    FROM
         TABLE1
    REGARDS
    Rahul Sharma

  • Urgent help needed for XML Tags using XMLForest()

    Folks
    I need some urgent help regarding getting use defined tag in your
    XML output.
    For this I am using XMLElement and XMLForest which seems to work fine
    when used at the SQL prompt but when used in a procedure throws and error
    SQL> Select SYS_XMLAGG(XMLElement("SDI",
                                       XMLForest(sdi_num)))
         From sdi
         where sdi_num = 22261;- WORKS FINE
    But when used in a procedure,doesnt seem to work
    Declare
        queryCtx  DBMS_XMLQuery.ctxType;
        v_xml     VARCHAR2(32767);
        v_xmlClob CLOB;
        BEGIN
        v_xml:='Select SYS_XMLAGG(XMLElement("SDI",
                                             XMLFOREST(sdi_num)))
        From sdi
        where sdi_num = 22261';
        queryCtx :=DBMS_XMLQuery.newContext(v_xml);
        v_xmlClob :=DBMS_XMLQuery.getXML(queryCtx);
        display_xml(v_xmlClob);
    End;
    CREATE OR REPLACE PROCEDURE  display_xml(result IN OUT NOCOPY CLOB)
    AS
         xmlstr varchar2(32767);
         line varchar2(2000);
    BEGIN
         xmlstr:=dbms_lob.SUBSTR(result,32767);
         LOOP
         EXIT WHEN xmlstr is null;
         line :=substr(xmlstr,1,instr(xmlstr,chr(10))-1);
         dbms_output.put_line('.'||line);
         xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
         END LOOP;
    end;
    SQL> /
    .<?xml version = '1.0'?>
    .<ERROR>oracle.xml.sql.OracleXMLSQLException: Character ')' is not allowed in an
    XML tag name.</ERROR>
    PL/SQL procedure successfully completed.
    SQL>HELP is appreciated as to where I am going wrong?

    Hi,
    if you want to transform something to something else, you should declare, what is your source.
    I would prefer to use plain XSL-Transformations, because you have a lot more options to transform your source and you can even better determine, how your output should looks like.
    Kind regards,
    Hendrik

  • Urgent help needed BARS

    Guys i have a v simple question but i cnat get my head around it.....i have a running environment (cluster) of call managers....now i want to relplicate it in my lab same topology....now i m using BARS as well....i have already build the call managers (in lab)...now i dont remenber the SQL passwords or other passwords for the live CCM cluster....now if i take a back up and put it in the lab will it work??? or the the passwords have to be same on lab to th elive environment......guys urgent help is needed.....reagrds

    You can restore the node in the lab with the tar file you got from the back up. The restore will override the passwords and assign the ones taken from the back up. I hope that helps!

  • Urgent help needed; Database shutdown issues.

    Urgent help needed; Database shutdown issues.
    Hi all,
    I am trying to shutdown my SAP database and am facing the issues below, can someone please suggest how I can go about resolving this issue and restart the database?
    SQL> shutdown immediate
    ORA-24324: service handle not initialized
    ORA-24323: value not allowed
    ORA-01089: immediate shutdown in progress - no operations are permitted
    SQL> shutdown abort
    ORA-01031: insufficient privileges
    Thanks and regards,
    Iqbal

    Hi,
    check SAP Note 700548 - FAQ: Oracle authorizations
    also check Note 834917 - Oracle Database 10g: New database role SAPCONN
    regards,
    kaushal

  • URGENT HELP REQUIRED!

    I am having problems implementing a username validaion bean for my login system. Every time I click my login icon on my main JSP page the login JSP page does not appear except one of the error JSP pages.
    How can I correct this problem?
    Does the code below look correct?
    Below is the codes for the Username Validation Bean :
    LOGIN.JSP
    <%@ page import="java.io.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="com.mysql.jdbc.*"%>
    <%@ page errorPage="badLogin.jsp"%>
    <%@ page import="gcd.UserNameValidationBean"%>
    <%
    Class.forName("com.mysql.jdbc.Driver");
    java.sql.Connection connection=java.sql.DriverManager.getConnection("jdbc:mysql://localhost/gcdBB_db");
    java.sql.Statement statement = connection.createStatement();
    Enumeration parameters = request.getParameterNames();
    if(parameters.hasMoreElements())
    String usernameValue = request.getParameter("username");
    String passwordValue = request.getParameter("password");
    statement.executeUpdate("INSERT INTO users (username,password) VALUES ('"+usernameValue+"','"+passwordValue+"')");
    %>
    GOODLOGIN.JSP
    <%@ page errorPage="badLogin.jsp"%>
    <%@ page import="gcd.UserNameValidationBean"%>
    <% UserNameValidationBean validationBean = new UserNameValidationBean();
    if(request.getParameter("username")!=null)
    validationBean.validateUserNameBean(request.getParameter("username"));
    %>
    <%=request.getParameter("username")%>
    USERNAMEVALIDATIONBEAN.JAVA
    package gcd;
    public class UserNameValidationBean
    public UserNameValidationBean(){}
    public boolean validateUserName(String userName) throws InvalidUserNameException
    if(userName.length() < 32)
    throw new InvalidUserNameException("User Name Invalid: " + userName);
    return true;
    INVALIDUSERNAMEEXCEPTION.JAVA
    package gcd;
    public class InvalidUserNameException extends Exception
    public InvalidUserNameException(String message)
    super(message);
    I need urgent help to get this working!

    Here is code for badLogin.jsp and badLoginWithExceptonObject:
    BADLOGIN.JSP
    <HTML><HEAD><TITLE>Login Failure</TITLE></HEAD>
    <BODY bgcolor="#FF9900">
    <H1></H1>
    <font face="Arial" size="3">Sorry but you either entered an incorrect username
    or password </font>
    <P><font face="Arial" size="3">Try Again</font>
    </BODY></HTML>
    BADLOGINWITHEXCEPTIONOBJECT.JSP
    <HTML><HEAD><TITLE>Check User Login Against Parameters</TITLE></HEAD>
    <BODY bgcolor="#FF9900">
    <%@ page isErrorPage = "true"%>
    <P><font face="Arial" size="3">Error =</font> <%= exception.getMessage()%> <% PrintWriter writer = new PrintWriter(out); %>
    <P><font face="Arial" size="3">Stack =</font> <% exception.printStackTrace(writer); %>
    <P><font face="Arial" size="3">Try Again</font>
    </BODY></HTML>

  • Your urgent help will be very much appreciated

    I have a problem whenever I connect my database and need your urgent help. the sample source code is below
    import java.sql.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    public class Table extends JFrame
    private Connection con;
    private JTable table;
    public Table()
         String url = "jdbc:odbc:Books";
         String username="";
         String password="";
         try{
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         con = DriverManager.getConnection(url, username, password);
         catch(ClassNotFoundException cnfex)
         System.err.println("Failed to load JDBC/ODBC driver.");
         cnfex.printStackTrace();
         System.exit(1);
         catch(SQLException sqlex)
         System.err.println("Failed to connect");
         sqlex.printStackTrace();
         getTable();
         setSize(45,150);
         show();
    public void getTable()
         Statement state;
         ResultSet result;
         try{
         String query="Select * from Author";
         state=con.createStatement();
         result=state.executeQuery(query);
         displayResult(result);
         state.close();
         catch(SQLException sqlex)
         sqlex.printStackTrace();
    public void displayResult(ResultSet rs)throws SQLException
    boolean moreRecord=rs.next();
    if (!moreRecord)
    JOptionPane.showMessageDialog(this, "ResultSet contained no record");
    setTitle("No records to display");
    return;
    setTitle("Author table from Books");
    Vector columnHeads=new Vector();
    Vector rows=new Vector();
    try{
    ResultSetMetaData rsmd=rs.getMetaData();
    for (int i=1; i<=rsmd.getColumnCount(); i++)
    columnHeads.addElement(rsmd.getColumnName(i));
    do{
    rows.addElement(getNextRow(rs, rsmd));
    }while(rs.next());
    table=new JTable(rows, columnHeads);
    JScrollPane scroller=new JScrollPane(table);
    getContentPane().add(scroller,BorderLayout.CENTER);
    validate();
    catch(SQLException sqlex)
    sqlex.printStackTrace();
    public Vector getNextRow(ResultSet rs, ResultSetMetaData rsmd)
              throws SQLException
    Vector currentRow=new Vector();
    for (int i=1; i<=rsmd.getColumnCount(); i++)
    switch (rsmd.getColumnType(i))
    case Types.VARCHAR:
         currentRow.addElement(rs.getString(i));
         break;
         case Types.INTEGER:
         currentRow.addElement(new Long(rs.getLong(i)));
         break;
    default:
    System.out.println("Type was: "+rsmd.getColumnTypeName(i));
    return currentRow;
    public void shutDown()
         try{
         con.close();
         catch(SQLException sqlex)
         System.err.println("Unable to disconnect");
         sqlex.printStackTrace();
    public static void main(String args[])
         final Table app=new Table();
         app.addWindowListener( new WindowAdapter()
         public void windowClosing(WindowEvent e)
              app.shutDown();
              System.exit(0);

    Thank you for your help. When I compile it, it is fine, the problem happens when run it.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6d448d54
    Function name=(N/A)
    Library=C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\hotspot\jvm.dll
    NOTE: We are unable to locate the function name symbol for the error
    just occurred. Please refer to release documentation for possible
    reason and solutions.
    Current Java thread:
    at sun.jdbc.odbc.JdbcOdbc.driverConnect(Native Method)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at Table.<init>(Table.java:26)
    at Table.main(Table.java:145)
    Dynamic libraries:
    0x00400000 - 0x00405000 C:\WINNT\system32\java.exe
    0x77F80000 - 0x77FFB000 C:\WINNT\System32\ntdll.dll
    0x77D90000 - 0x77DED000 C:\WINNT\system32\ADVAPI32.dll
    0x77E60000 - 0x77F35000 C:\WINNT\system32\KERNEL32.DLL
    0x786F0000 - 0x78761000 C:\WINNT\system32\RPCRT4.DLL
    0x78000000 - 0x78046000 C:\WINNT\system32\MSVCRT.dll
    0x60000000 - 0x6003A000 c:\program files\rising\rav\ApiHook.dll
    0x05000000 - 0x0502E000 c:\program files\rising\rav\MemMon.dll
    0x77DF0000 - 0x77E55000 C:\WINNT\system32\USER32.dll
    0x77F40000 - 0x77F7C000 C:\WINNT\system32\GDI32.DLL
    0x75E00000 - 0x75E1A000 C:\WINNT\System32\IMM32.DLL
    0x6D420000 - 0x6D4F7000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\hotsp
    ot\jvm.dll
    0x77530000 - 0x77560000 C:\WINNT\system32\WINMM.dll
    0x6D220000 - 0x6D227000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\hpi.d
    ll
    0x6D3B0000 - 0x6D3BD000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\verif
    y.dll
    0x6D250000 - 0x6D266000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\java.
    dll
    0x6D3C0000 - 0x6D3CD000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\zip.d
    ll
    0x6D020000 - 0x6D12A000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\awt.d
    ll
    0x777C0000 - 0x777DE000 C:\WINNT\system32\WINSPOOL.DRV
    0x75010000 - 0x75020000 C:\WINNT\system32\MPR.DLL
    0x77A30000 - 0x77B25000 C:\WINNT\system32\ole32.dll
    0x6D1E0000 - 0x6D21B000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\fontm
    anager.dll
    0x6DD30000 - 0x6DD36000 C:\WINNT\System32\INDICDLL.dll
    0x37210000 - 0x3723D000 C:\WINNT\DOWNLO~1\CnsMin.dll
    0x77C50000 - 0x77C9A000 C:\WINNT\system32\SHLWAPI.dll
    0x777E0000 - 0x777E7000 C:\WINNT\system32\VERSION.dll
    0x75950000 - 0x75956000 C:\WINNT\system32\LZ32.DLL
    0x6D290000 - 0x6D29A000 C:\Program Files\JavaSoft\JRE\1.3.1_05\bin\JdbcO
    dbc.dll
    0x1F7F0000 - 0x1F825000 C:\WINNT\system32\ODBC32.dll
    0x76AF0000 - 0x76B2D000 C:\WINNT\system32\comdlg32.dll
    0x77B30000 - 0x77BB9000 C:\WINNT\system32\COMCTL32.DLL
    0x78F90000 - 0x791D6000 C:\WINNT\system32\SHELL32.DLL
    0x1F8E0000 - 0x1F8F6000 C:\WINNT\system32\odbcint.dll
    0x77900000 - 0x77923000 C:\WINNT\system32\imagehlp.dll
    0x72960000 - 0x7298D000 C:\WINNT\system32\DBGHELP.dll
    0x687E0000 - 0x687EB000 C:\WINNT\system32\PSAPI.DLL
    Local Time = Tue Feb 25 21:33:38 2003
    Elapsed Time = 7
    # HotSpot Virtual Machine Error : EXCEPTION_ACCESS_VIOLATION
    # Error ID : 4F530E43505002BD
    # Please report this error at
    # http://java.sun.com/cgi-bin/bugreport.cgi
    # Java VM: Java HotSpot(TM) Client VM (1.3.1_05-b02 mixed mode)
    # An error report file has been saved as hs_err_pid1792.log.
    # Please refer to the file for further information.
    #

  • Need urgent help with database startup

    dear all,
    i am using oracle 10g on windower server 32 bit.
    i try to startup my database today, and it give me error, and it is my production database,
    i need very urgent help from you.(i have no rman backup , and the data is not so necessory, since it is for student practice.)
    SQL> startup open
    ORACLE instance started.
    Total System Global Area  524288000 bytes
    Fixed Size                   790180 bytes
    Variable Size             250343772 bytes
    Database Buffers          272629760 bytes
    Redo Buffers                 524288 bytes
    Database mounted.
    ORA-01110: data file 34: 'G:\ORACLE\DATAFILES_ACADEMY\ACADEMY'
    ORA-01115: IO error reading block from file 34 (block # 1)
    ORA-27070: async read/write failed
    OSD-04016: Error queuing an asynchronous I/O request.
    O/S-Error: (OS 23) Data error (cyclic redundancy check).regards.

    Maahjoor wrote:
    Hi dears,
    i need further assistance from your side, i have restarted the server, but the same problem.
    as there a way to drop and re-create a system tablespace? since the file 34 belong to system tablesapce.
    regardsNo.
    So just create a new database. That will take all of ten minutes. And tell your students to create new tablespaces. That will take them two minutes.

Maybe you are looking for

  • Hard drive problems on new macbook pro

    I have a brand new macbook pro with very few applications and music and the "Other" section of my hard drive is 80/120GB? Can I reduce this? If so how?

  • What happended to "Save As" in the SQL Worksheet?

    I am using 14.22 in Windows XP. In the previous version 13.43 I used to: 1) Open a new SQL Worksheet. 2) Type in statements. 3) Press Ctrl-S to save the contents of the SQL Worksheet panel to a new file, an "Open File" dialog appeared. 4) Enter file

  • No Signal/Searching.. possible solution??

    I just received my second iPhone 4 yesterday, activated, synced... Everything was fine until this morning when I came to work. Again, it immediately went from 5 bars on Edge to Searching. Restarted phone, no change. Turned on/off Airplane mode, no ch

  • How to create Listening Channel for XML/web services repsonse

    Hi , I am new to B2B 11g, wish to ask tht, I followed the B2B tutorial by using Generic File and it working fine. However, if I wish to receive XML from trading partner thought web server, how should i configure the listening channel, which protocol

  • Premiere Pro CC Crashes when changing to certain workspace layouts

    When I try to switch to "Assembly" workspace, the entire interface stops responding and I can't do anything until I force quit.