Need help in sql plus

i install in my computer the oracle9i
my problem is that : i can login to sql plus
althoge i was tring all the passwords that i know
scott/tiger
sys/change_on_install
system/manager and the result is allways the same
ora-12560 error
how can i solve that problem?
did i missed somthing during the installation?

Thank you to EVERYONE!!
I have been searching every possible forum to find out how to install/run SQL *Plus on a home computer without a server/network to work within.  As most just learning, I could not figure out how to get past the SQL Plus Username/Password/Host String logon.
After much trial and error, I got through and I hope this helps a lot of people just starting out.
I used 'SYSTEM' as my username and my password created on install.
When installing I created a database and fixed the password so my default password was the password I created on install.
As long as I had those two fields filled in, I could leave the Host String blank and I could still get into the SQL Plus workspace.
Since I also created a database on install, I found that I could also use the name I gave the installed database (I didn't leave the default database name so I do not remember what the default name was, but I think the default password was 'manager' for those who were not tempted to change it).
Worst case scenario if you forgot your database name given during install, you can do a search for all of your .ora files (usually in the drive you installed Oracle on). Open the tnsnames.ora file in Notepad and you can see which database names are available on your system. The path to my file was:
D:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
You want the SERVICE_NAME = 'databasename'
I hope this reduced someone's stress...and thanks for all the helpful hints on these threads...they led me to the final outcome!!
In the end, I tried a lot of other combinations for the username/host strings with plenty of errors. You would think this information would be on page one of every Oracle install!! Or maybe it is and I am just a bit slow. : )
Thanks again to all that posted with this initial question (years ago)...
Brian Reeves
Oracle Student

Similar Messages

  • Need help with SQL*PLUS!

    I have just downloaded Oracle SQL*PLUS 9.2.0.1.0, but I am not able to use it because I do not know the "password", "user name" and "host string". Can anybody please help me with this.
    Thanks in advance,
    Flo

    The username & password are your database username & password. If you don't know these, you'll have to contact your DBA to find out.
    The host string is the alias you used when you configured TNS on your machine. Most commonly, this is done by editing the tnsnames.ora file or by using Net8 Easy Config.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com

  • Need help with SQL Query with Inline View + Group by

    Hello Gurus,
    I would really appreciate your time and effort regarding this query. I have the following data set.
    Reference_No---Check_Number---Check_Date--------Description-------------------------------Invoice_Number----------Invoice_Type---Paid_Amount-----Vendor_Number
    1234567----------11223-------------- 7/5/2008----------paid for cleaning----------------------44345563------------------I-----------------*20.00*-------------19
    1234567----------11223--------------7/5/2008-----------Adjustment for bad quality---------44345563------------------A-----------------10.00------------19
    7654321----------11223--------------7/5/2008-----------Adjustment from last billing cycle-----23543556-------------------A--------------------50.00--------------19
    4653456----------11223--------------7/5/2008-----------paid for cleaning------------------------35654765--------------------I---------------------30.00-------------19
    Please Ignore '----', added it for clarity
    I am trying to write a query to aggregate paid_amount based on Reference_No, Check_Number, Payment_Date, Invoice_Number, Invoice_Type, Vendor_Number and display description with Invoice_type 'I' when there are multiple records with the same Reference_No, Check_Number, Payment_Date, Invoice_Number, Invoice_Type, Vendor_Number. When there are no multiple records I want to display the respective Description.
    The query should return the following data set
    Reference_No---Check_Number---Check_Date--------Description-------------------------------Invoice_Number----------Invoice_Type---Paid_Amount-----Vendor_Number
    1234567----------11223-------------- 7/5/2008----------paid for cleaning----------------------44345563------------------I-----------------*10.00*------------19
    7654321----------11223--------------7/5/2008-----------Adjustment from last billing cycle-----23543556-------------------A--------------------50.00--------------19
    4653456----------11223--------------7/5/2008-----------paid for cleaning------------------------35654765-------------------I---------------------30.00--------------19
    The following is my query. I am kind of lost.
    select B.Description, A.sequence_id,A.check_date, A.check_number, A.invoice_number, A.amount, A.vendor_number
    from (
    select sequence_id,check_date, check_number, invoice_number, sum(paid_amount) amount, vendor_number
    from INVOICE
    group by sequence_id,check_date, check_number, invoice_number, vendor_number
    ) A, INVOICE B
    where A.sequence_id = B.sequence_id
    Thanks,
    Nick

    It looks like it is a duplicate thread - correct me if i'm wrong in this case ->
    Need help with SQL Query with Inline View + Group by
    Regards.
    Satyaki De.

  • 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.

  • Help with SQL*Plus COPY Command syntax

    Hello people.
    DBs are 10g
    PROD DB is a remote DB (over DB Link)
    TEST DB is where my SQL*Plus is logged in.
    LOCAL_DB_TABLE is the table I need to create to TEST DB
    REMOTE_DB _TABLE is the table that already exists in remote PROD DB
    COPY FROM replica/replica@PROD
    CREATE LOCAL_DB_TABLE@TEST
    ROW_ID,
    CREATED,
    CREATED_BY,
    UPD,
    UPD_BY
    USING SELECT
    ROW_ID,
    CREATED,
    CREATED_BY,
    UPD,
    UPD_BY
    FROM REMOTE_DB_TABLE
    WHERE ROW_ID='XXX';The error message I am getting:
    usage: COPY FROM <db> TO <db> <opt> <table> { (<cols>) } USING <sel>
      <db>   : database string, e.g., hr/your_password@d:chicago-mktg
      <opt>  : ONE of the keywords: APPEND, CREATE, INSERT or REPLACE
      <table>: name of the destination table
      <cols> : a comma-separated list of destination column aliases
      <sel>  : any valid SQL SELECT statement
    A missing FROM or TO clause uses the current SQL*Plus connection.
    CREATE LOCAL_DB_TABLE@TEST
    ERROR at line 1:
    ORA-00901: invalid CREATE commandThank you in advance for your help.

    Hi,
    I hope you are thinking of Creating a Table with the Same Structure as the remote database Table, If so.
    You can create a Table from the Existing Table using CTAS(Create Table as Select).
    Provided, you have created a Database Links between the 2 Databases. You can create a
    table in your Schema as,
    CREATE TABLE local_db_table AS
    SELECT * FROM remote_user_name.remote_db_table@dbname;Thanks,
    Shankar
    Edited by: Shankar Viji on Jul 19, 2012 11:01 PM

  • Need help in SQL (DENSE_RANK) function

    Hello All,
    I need the help in SQL.
    We have a table called status and the column are
    status_id number
    account_id number
    status_cd varchar2(10)
    created_id varchar2(10)
    created_by date
    and data is as follows
    insert into status values (1,101,'ENTER','ABC',to_date('21-JAN-2007 11:15:14','DD-MON-YYYY HH:MI:SS'));
    insert into status values (2,101,'REVIEW','DEF',to_date('21-JAN-2007 11:30:25','DD-MON-YYYY HH:MI:SS'));
    insert into status values (3,101,'APPROVE','GHI',to_date('21-JAN-2007 11:30:25','DD-MON-YYYY HH:MI:SS'));
    insert into status values (4,102,'ENTER','ABC',to_date('21-JAN-2007 11:18:14','DD-MON-YYYY HH:MI:SS'));
    insert into status values (5,102,'REVIEW','DEF',to_date('21-JAN-2007 11:33:25','DD-MON-YYYY HH:MI:SS'));
    insert into status values (6,102,'CANCEL','GHI',to_date('21-JAN-2007 11:33:25','DD-MON-YYYY HH:MI:SS'));
    insert into status values (7,103,'ENTER','ABC',to_date('21-JAN-2007 11:21:14','DD-MON-YYYY HH:MI:SS'));We have different status as follows
    1. ENTER
    2. REVIEW
    3. APPROVE
    4. CANCEL
    5. REJECT
    My requirement ..
    I need the max of created_id column for the status in ('APPROVE','CANCEL') and if there is no status in ('APPROVE','REVIEW') than it should be NULL.
    I wrote an SQL as
    select account_id,max(created_id) keep (dense_rank first order by decode(status_cd,'APPROVE',created_dt,'REVIEW',created_dt,NULL) DESC NULLS LAST,
          decode(status_cd,'APPROVE',status_id,'REVIEW',status_id,NULL) DESC NULLS LAST) last_app_rev_user
    from status
    group by account_id and gives me the output like
    ACCOUNT_ID LAST_APP_R
           101 GHI
           102 DEF
           103 ABCBut I want the Output like
    ACCOUNT_ID LAST_APP_R
           101 GHI
           102 DEF
           103 NULLAs the account 103 has no status called 'REVIEW' and 'APPROVE'
    My DB Version in 10.2.0.3.0.
    Hope I explain it properly. And if you have any other option without dense_rank still i will be happy.
    Thanks in advance for your help.
    AB
    null
    Message was edited by:
    AB

    instead of max(created_id) keep... use
    smth like max(case when status_cd in ('APPROVE','REVIEW') then created_id end) keep...

  • Need help in SQL Query: Update a row in a table & insert the same row into another table

    I want to update a row in a table say Table A and the updated row should be inserted into another table say Table B. I need to do it in a single SQL query and i don't want to do it in PL/SQL with triggers. And i tried with MERGE statement but its working with this scenario. (Note: I'm using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0).
    Thanks in Advance.

    Using Sven's code as an example, you could save the updated row in a sql plus variable. (also untested):
    SQL> var v_id number
    update tableA  
    set colB='ABC' 
    where colC='XYZ' 
    returning id into :v_id;
    insert into table A_History (ID, colA, colB, ColC)  
    select id, ColA, ColB, ColC  
    from tableA  
    where id = :v_id;   

  • NEED HELP IN SQL HOMEWORK PROBLEMS

    I NEED HELP IN MY SQL HOMEWORK PROBLEMS....
    I CAN SEND IT VIA EMAIL ATTACHMENT IN MSWORD....

    Try this:
    SELECT SUBSTR( TN,
                   DECODE(LEVEL, 1, 1, INSTR(TN, '#', 1, LEVEL-1) + 1),
                   DECODE( INSTR(TN, '#', 1, LEVEL) , 0 ,
                           LENGTH(TN) + 1, INSTR(TN, '#', 1, LEVEL) )
                   - DECODE(LEVEL, 1, 1, INSTR(TN, '#', 1, LEVEL-1 ) + 1)
           ) xxx
    FROM (
        SELECT '234123#1254343#909823#908232#12345' TN FROM DUAL
    CONNECT BY LEVEL <= LENGTH(TN) - LENGTH(REPLACE(TN,'#')) + 1
    XXX                               
    234123                            
    1254343                           
    909823                            
    908232                            
    12345
    SELECT regexp_substr(tn, '[^#]+', 1, level) xx
    FROM (
        SELECT '234123#1254343#909823#908232#12345' TN FROM DUAL
    CONNECT BY LEVEL <= LENGTH(TN) - LENGTH(REPLACE(TN,'#')) + 1
    XX                                
    234123                            
    1254343                           
    909823                            
    908232                            
    12345 

  • Need help pl/sql function body returning SQL query - Reports

    I need help with Grouping by on a report that I developed in my application.
    I have posted my Code in
    Apex.oracle.com
    workspace : c a s e _ m a n a g e m e n t
    User Id : public
    Password : public
    I need help on Page 38 Reports.
    I get blank lines when I do break by first , second and third columns on the reports attribute.
    So I think I have to write "group by " or Distinct in side the SQL query. But not sure how to do it there.
    Thank you

    Is this an APEX question, then try here:
    Oracle Application Express (APEX)
    Is this an Oracle Reports question, then try here:
    Reports
    Is this an SQL question:
    Please provide sample data and expected output. Also please show what you have tried already.

  • Need Help On SQL Statement

    I am using Sybase as my back end database. I need help on my SQL statement regarding datetime. The datetime is store as a 9 digit integer in the database (...I believe it is a Decimal(30,6) format, let me know if I am wrong).
    If I do this, "select * from mytable;" It works out fine (except I don't know what the date means e.g. 998919534)
    If I do this, "select * from mytable where datetime_col < '9/5/2002' ; I got an error. I even tried '9/5/02 11:00 000 am' but it didn't help.
    How do I specify a date or datetime in my query?
    Thanks in advance.

    I execute the sql statement
    select * from mytable where datetim_col < convert(datetime, '3/4/2002', 101) ;
    I got mix result. I got an error message "cannot convert 10375584 to a date.
    Yet, he statistics window of the I-sql says
    "estimated 493 rows in query (I/O estimate 87)
    PLan> mytable (seq)"
    It looks like I my the SQL statement is correct and then the system can't display it in the Data window.
    Any thought ?

  • Need help for sql statement

    Hi,
    Need help to write sql statement.
    create table t_dt ( dt_start date, dt_end date, amount number);
    insert into t_dt values('1-Jan-10','10-Feb-10',12);
    insert into t_dt values('11-Feb-10','10-Mar-10',10);
    insert into t_dt values('11-Mar-10','20-Apr-10',8);
    insert into t_dt values('21-Apr-10','28-Jun-10',10);
    insert into t_dt values('29-Jun-10','20-Sep-10',10);
    insert into t_dt values('21-Sep-10','10-Oct-10',10);
    insert into t_dt values('11-Oct-10','31-Dec-10',8);
    insert into t_dt values('1-Jan-11','10-Feb-11',8);
    insert into t_dt values('11-Feb-11','10-Mar-11',7);
    insert into t_dt values('11-Mar-11','20-Apr-11',6);
    insert into t_dt values('21-Apr-11','28-Jun-11',6);
    insert into t_dt values('29-Jun-11','20-Sep-11',6);
    insert into t_dt values('21-Sep-11','10-Oct-11',4);
    insert into t_dt values('11-Oct-11','31-Dec-11',8);
    Result should be like below..
    dt_start     dt_end     Amount
    1-Jan-10     10-Feb-10     12
    11-Feb-10     10-Mar-10     10
    11-Mar-10     20-Apr-10     8
    21-Apr-10     10-Oct-10     10
    11-Oct-10     10-Feb-11     8
    11-Feb-11     10-Mar-11     7
    11-Mar-11     20-Sep-11     6
    21-Sep-11     10-Oct-11     4
    11-Oct-11     31-Dec-11     8
    Just to explain the example, take a row with start date as 21-Apr-10 in the above insert statements, since it has the same amount for next two rows (i.e. with start date '29-Jun-10' and '21-Sep-10') these 3 rows should be converted to represent only 1 row in the result and the start date and end date should be changed per the result shown above.
    Thanks.

    Hello
    I think this gives yuo what you need....
    SELECT
        MIN(dt_start),
        MAX(dt_end),
        amount
    FROM
        (   SELECT
                dt_start,
                dt_end,
                MAX(marker) OVER(ORDER BY dt_start) marker,
                amount
            FROM
                    Select
                        dt_start,
                        dt_end,
                        amount,
                        CASE
                            WHEN LAG(amount) OVER(ORDER BY dt_start) <> amount THEN
                                ROW_NUMBER() OVER(ORDER BY dt_start)
                        END marker
                    from t_dt
    GROUP BY
         amount,
         marker
    order by     
         MIN(dt_start)
    MIN(DT_START)        MAX(DT_END)              AMOUNT
    01-JAN-2010 00:00:00 10-FEB-2010 00:00:00         12
    11-FEB-2010 00:00:00 10-MAR-2010 00:00:00         10
    11-MAR-2010 00:00:00 20-APR-2010 00:00:00          8
    21-APR-2010 00:00:00 10-OCT-2010 00:00:00         10
    11-OCT-2010 00:00:00 10-FEB-2011 00:00:00          8
    11-FEB-2011 00:00:00 10-MAR-2011 00:00:00          7
    11-MAR-2011 00:00:00 20-SEP-2011 00:00:00          6
    21-SEP-2011 00:00:00 10-OCT-2011 00:00:00          4
    11-OCT-2011 00:00:00 31-DEC-2011 00:00:00          8
    9 rows selected.HTH
    David
    Edited by: Bravid on Feb 23, 2012 12:08 PM
    Beaten to it by Frank! :-)

  • Need help on SQL Statement for UDF

    Hi,
    as I am not so familiar with SQL statements on currently selected values, I urgently need help.
    The scenario looks as follows:
    I have defined two UDFs named Subgroup1 and Subgroup2 which represent the subgroups dependent on my article groups. So for example: When the user selects article group "pianos", he only sees the specific subgroups like "new pianos" and "used pianos" in field "Subgroup1". After he has selected one of these specific values, he sees only the specific sub-subgroups in field "Subgroup2", like "used grand pianos".
    I have defined UDTs for both UDFs. The UDT for field "Subgroup1" has a UDF called "ArticleGroup" which represents the relation to the article group codes. The UDT for field "Subgroup2" has a UDF called "Subgroup1" which represents the relation to the subgroups one level higher.
    The SQL statement for the formatted search in field "Subgroup1" looks as follows:
    SELECT T0.[Name] FROM [dbo].[@B_SUBGROUP1]  T0 WHERE T0.[U_ArticleGroup]  = (SELECT $[OITM.ItmsGrpCod])
    It works fine.
    However, I cannot find the right statement for the formatted search in field "Subgroup2".
    Unfortunately this does NOT WORK:
    SELECT T0.[Name] FROM [dbo].[@B_SUBGROUP2]  T0 WHERE T0.[U_Subgroup1]  = (SELECT $[OITM.U_Subgroup1])
    I tried a lot of others that didn't work either.
    Then I tried the following one:
    SELECT T0.[Name] FROM [dbo].[@B_SUBGROUP2]  T0 WHERE T0.[U_Subgroup1] = (SELECT T1.[Code] FROM [dbo].[@B_SUBGROUP1] T1 WHERE T1.[U_ArticleGroup] = (SELECT $[OITM.ItmsGrpCod]))
    Unfortunately that only works as long as there is only one specific subgroup1 for the selected article group.
    I would be sooooo happy if there is anyone who can tell me the correct statement for my second UDF!
    Thanks so much in advance!!!!
    Edited by: Corinna Hochheim on Jan 18, 2010 10:16 PM
    Please ignore the "http://" in the above statements - it is certainly not part of my SQL.
    Please also ignore the strikes.

    Hello Dear,
    Use the below queries to get the values:
    Item Sub Group on the basis of Item Group
    SELECT T0.[Name] FROM [dbo].[@SUBGROUP]  T0 WHERE T0.[U_GroupCod] =$[OITM.ItmsGrpCod]
    Item Sub Group 1 on the basis of item sub group
    SELECT T0.[Name] FROM [dbo].[@SUBGROUP1]  T0 WHERE T0.[U_SubGrpCod]=(SELECT T0.[Code] FROM [dbo].[@SUBGROUP]  T0 WHERE T0.[Name] =$[OITM.U_ItmsSubgrp])
    Sub group 2 on the basis of sub group 1
    SELECT T0.[Name] FROM [dbo].[@SUBGROUP2]  T0 WHERE T0.[U_SubGrpCod1]=(SELECT T0.[Code] FROM [dbo].[@SUBGROUP1]  T0 WHERE T0.[Name] =$[OITM.U_ItmsSubgrp1])
    this will help you.
    regards,
    Neetu

  • Need help regarding sql query

    hii All
    I need help for pl/sql function.
    I build a function for monthly attendance all employees.
    but now i want to show all Sundays with 'S' and others respectively 'P' and 'A'.
    Currently Sunday also shows 'A'
    So please help
    SQL queries ... like
    SELECT DISTINCT AL.USERNAME,
    CASE WHEN DAY1 =1 THEN 'P' ELSE 'A' END DAY1,
    CASE WHEN DAY2 =1 THEN 'P' ELSE 'A' END DAY2,
    CASE WHEN DAY3 =1 THEN 'P' ELSE 'A' END DAY3,
    CASE WHEN DAY31 =1 THEN 'P' ELSE 'A' END DAY31
    FROM
    SELECT DISTINCT USERNAME, SUM(CASE WHEN
    fromdt=TRUNC(L.LOGIN_DATE) THEN
    1
    ELSE
    0
    END) DAY1
    ,SUM(CASE WHEN
    fromdt +1=TRUNC(L.LOGIN_DATE) THEN
    1
    ELSE
    0
    END) DAY2,
    SUM(CASE WHEN
    fromdt+30=TRUNC(L.LOGIN_DATE) THEN
    1
    ELSE
    0
    END) DAY31
    FROM ( SELECT DISTINCT TRUNC(LOGIN_DATE)LOGIN_DATE ,USERNAME FROM FCDM_AUDIT_TRAIL_NEW WHERE
    TRUNC(LOGIN_DATE) BETWEEN fromdt AND todt
    -- to_date( login_date, 'dd-mom-yyyy') between to_date( fromdt, 'dd-mom-yyyy') and to_date( todt, 'dd-mom-yyyy')
    ) L
    GROUP BY USERNAME
    ) AL;
    how can i show matched Sundays and show with 'SUN' or 'S'
    Regards
    vij..

    Try this way:
    SELECT USERNAME,
           MAX(CASE WHEN to_char(fromdt,'d')='1' and fromdt=TRUNC(L.LOGIN_DATE) THEN 'S'
                    WHEN to_char(fromdt,'d')!='1' and fromdt=TRUNC(L.LOGIN_DATE) THEN 'P'
                    ELSE 'A') DAY1,
           MAX(CASE WHEN to_char(fromdt+1,'d')='1' and fromdt+1=TRUNC(L.LOGIN_DATE) THEN 'S'
                    WHEN to_char(fromdt+1,'d')!='1' and fromdt+1=TRUNC(L.LOGIN_DATE) THEN 'P'
                    ELSE 'A') DAY2,
           MAX(CASE WHEN to_char(fromdt+30,'d')='1' and fromdt+30=TRUNC(L.LOGIN_DATE) THEN 'S'
                    WHEN to_char(fromdt+30,'d')!='1' and fromdt+30=TRUNC(L.LOGIN_DATE) THEN 'P'
                    ELSE 'A') DAY31
    FROM
    (SELECT DISTINCT TRUNC(LOGIN_DATE) LOGIN_DATE,
            USERNAME
       FROM FCDM_AUDIT_TRAIL_NEW
      WHERE TRUNC(LOGIN_DATE) BETWEEN fromdt AND todt
    ) L
    Group by USERNAME
    ;Max
    http://oracleitalia.wordpress.com

  • Need help with SQL retrieval for previous month till current date

    Hi ,
    Need help generating statistics from previous month from date of enquiry till current date of enquiry.
    and have to display it according to date.
    Date of enquiry : 03/02/2012
    Application Type| 01/01/2012 | 02/01/2012 | 03/01/2012 |...... | 31/01/2012 | 01/02/2012 | 02/02/2012 | 03/02/2012 |
    sample1 20 30 40
    sample 2 40 40 50
    sample 3 50 30 30
    Hope you guys can help me with this.
    Regards

    Hi,
    932472 wrote:
    Scenario
    1)If i run the query at 12 pm on 03/2/2012. the result i will have to display till the current day.
    2)displaying the count of the application made based on the date.
    Application type 01012012 | 02012012 | 03012012 | ..... 01022012| 02022012|03022012
    sample 1 30 40 50 44 30
    sample 2 35 45 55
    sample 3 36 45 55Explain how you get those results from the sample data you posted.
    It would help a lot if you posted the results in \ tags, as described in the forum FAQ. {message{id=9360002}
    SELECT     application_type as Application_type
    ,     COUNT (CASE WHEN created_dt = sysdate-3 THEN 1 END)     AS 01012012 (should be getting dynamically)
    ,     COUNT (CASE WHEN created_dt = sysdate-4 THEN 1 END)     AS 02022012
    ,     COUNT (CASE WHEN created_dt = sysdate-5 THEN 1 END)     AS 03022012
    , COUNT (CASE WHEN created_dt = sysdate-6 THEN 1 END)     AS 04022012
    FROM     table_1
    GROUP BY application_type
    ORDER BY     application_typeThat's the bais idea.
    You can simplify it a little by factoring out the date differences:WITH got_d     AS
         SELECT     qty
         ,     TRUNC ( dt
              - ADD_MONTHS ( TRUNC (SYSDATE, 'MON')
                        , -1
              ) AS d
         FROM table1
         WHERE     dt     >= ADD_MONTHS ( TRUNC (SYSDATE, 'MON')
                        , -1
         AND dt     < TRUNC (SYSDATE) + 1
    SELECT     SUM (CASE WHEN d = 1 THEN qty END)     AS day_1
    ,     SUM (CASE WHEN d = 2 THEN qty END)     AS day_2
    ,     SUM (CASE WHEN d = 62 THEN qty END)     AS day_62
    FROM     got_d
    See the links I mentioned earlier for getting exactly the right number of columns, and dynamic column aliases.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Help - Oracle SQL Plus manipulation using JAVA

    Hi ,
    I want to invoke SQL*Plus from my Java program as well want to write some queries in the same PROCess. I am able to invoke SQL Plus and login into SQL Plus, but i don't know how to proceed further and write queries etc in the same script. My code is as follows:
    import java.util.*;
    import java.io.*;
    public class ExecuteSql
    public static void main(String args[])
         String[] RunCommand = {"plus33w" , "username/password@dbaseregion" };
    try
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(RunCommand);
         int exitVal = proc.waitFor();
    System.out.println("Process exitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();
    }

    Hi Ashish,
    This forum is for the Sun Java System Message Queue
    product. It is a message server that is an implementation
    of the Java Message Service (JMS).
    It appears that your question has nothing to do with
    Java Message Service or Sun Java System Message Queue.
    You should probably check out the list of forums at:
    http://developers.sun.com/forums/
    to see which forum is best for your question.
    regards,
    -isa

Maybe you are looking for

  • How do i transfer some files and applications to and make my ssd a bootable drive

    I have a mbp 2009.  i'm using the owc data doubler - installing 250gb ssd and keeping my 250 HDD.  I want to transfer some apps and files from the HDD to the SSD and make the SSD the bootable drive.  I'm not too familiar with teh inner-workings, so i

  • Item category cannot be changed

    Hello experts, Using the transaction OVEP when you select an item category and try to change it is not possible. See note: 459285 Revenue recognition: Item category cannot be changed (but does not apply in previous version --> The problem is correcte

  • [SOLVED] C programming help

    Hello everyone, Hopefully this is the appropiate spot to post this, I need help with a C programming HW problem. I need to create a program that that finds how many repeated characters in a string. For example the word "missing" has 2 repeating chara

  • Calling a Tcode IW51 and restrict user exit

    Hi , A new validations are placed in IW51 tcode and it is woking fine. When i am calling the IW51 by using call transaction method the previous User is calling . If this TCODE IW51 is calling by using call trancaction method I should not exicute the

  • WQL Help - Win32_NetworkAdapterConfiguration

    Hi guys/girls, I can't seem to figure out how to filter out the NICs without default gateway set: More readable version: gwmi -Query 'SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE DefaultIPGateway IS NOT NULL' gwmi -Query 'SELECT IPAd