how to get a particular column alone in select statement?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vinarashi
    New Member
    • Sep 2010
    • 11

    how to get a particular column alone in select statement?

    Hi,

    I have given a "select *" statement for a view. It gives all the values for the "where" condition mentioned. But when I give "select column_name " for the same "where" condition, I am getting an error.
    e.g.
    if I give "select * from SERVC_MGR_REPT_ V_CELL where EMPLOYEES_NAME= 'Ma, Stephen';", I am getting all the values.

    But if I give "select MANAGERS_NAME from SERVC_MGR_REPT_ V_CELL where EMPLOYEES_NAME= 'Ma, Stephen';", it gives an error. The error message is "ORA-00600: internal error code, arguments: []......"

    Just for information "SERVC_MGR_REPT _V_CELL" is a view.

    can anyone please help me out in this issue?

    Thanks,
    Flora
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    Can you show a view definition and column types wich are in that view.

    Comment

    • Vinarashi
      New Member
      • Sep 2010
      • 11

      #3
      Hi,

      Thanks for your reply..

      This is the view definition.

      CREATE OR REPLACE FORCE VIEW "LOS_AT"."SERVC _MGR_REPT_V_CEL L" ("MANAGERS_CID" , "MANAGERS_NAME" , "SERVICE", "EMPLOYEES_CID" , "EMPLOYEES_NAME ", "EMPLOYEES_HR_S TATUS", "EMP_LOCATI ON", "COUNTRY", "DEPT", "CHARGED_IT EM", "YTD", "AVG", "CURR_MNTH" , "DELTA2MONTHLY_ AVG") AS
      select level_1, mgr_name, 'Cellphone Charges', up0_cid, up0_name, up0_hr_stat,
      up0_location, up0_country, cel_emp_dept, cel_phone_numbe r,sum_ytd,
      avrg, curr_mnth,
      NULLIF ((NVL (curr_mnth, 0) - NVL (avrg, 0)), 0) delta2monthly_a vg
      from (SELECT level_1, mgr_name, 'Cellphone Charges', up0_cid, up0_name,
      up0_hr_stat, up0_location, up0_country, cel_emp_dept,
      cel_phone_numbe r,
      get_sum_ytd_cha rges (up0_cid,
      cel_phone_numbe r,
      cel_emp_dept,
      'los_cellphone_ charges'
      ) sum_ytd,
      round(sum(cel_e bi_amount_in_do llars)/(max(REPLACE(CE L_BILLING_MONTH _YR,'/') )-min(REPLACE(CEL _BILLING_MONTH_ YR,'/') )+1),2) avrg,
      get_sm_month_ch arges
      (up0_cid,
      1,
      cel_phone_numbe r,
      cel_emp_dept,
      'los_cellphone_ charges'
      ) curr_mnth


      from los_cellphone_c harges chrg,los_coredi r_expld_v emp
      WHERE chrg.cel_commer ceid = emp.up0_cid
      GROUP BY level_1,
      mgr_name,
      up0_cid,
      up0_name,
      up0_hr_stat,
      up0_location,
      up0_country,
      cel_emp_dept,
      cel_phone_numbe r) ;

      Thanks,
      Flora

      Comment

      • amitpatel66
        Recognized Expert Top Contributor
        • Mar 2007
        • 2358

        #4
        Try this:

        [code=oracle]
        select "MANAGERS_N AME" from SERVC_MGR_REPT_ V_CELL where EMPLOYEES_NAME= 'Ma Stephen';

        [/code]

        Comment

        • Vinarashi
          New Member
          • Sep 2010
          • 11

          #5
          Hi Amit,

          Thanks for you reply..
          I have tried the above statement. If i give the value of EMPLOYEES_NAME as something which is not available in the table, it gives 0 rows.

          Whereas if I give the value of EMPLOYEES_NAME as any of the data which is available in the table under EMPLOYEES_NAME column, its gives an error. The error message is "ORA-00600: internal error code, arguments: []......"

          Dont know where the actual mistake in the view.

          can you please guide me??

          Thanks,
          Flora

          Comment

          • amitpatel66
            Recognized Expert Top Contributor
            • Mar 2007
            • 2358

            #6
            Can you Drop and recreate a view and also if possible dont give double quotes to the column names while creating a view.

            And remove the FORCE option from the CREATE VIEW statement and then create a view.

            Comment

            • Vinarashi
              New Member
              • Sep 2010
              • 11

              #7
              Hi Amit,

              I have tried in that way also. Still its not working.
              For "select * ", I am getting all the values. But "select <column_name> " getting error as ORA-0600 - Internal error code.

              Thanks a ton Amit.

              Regards,
              Flora

              Comment

              • amitpatel66
                Recognized Expert Top Contributor
                • Mar 2007
                • 2358

                #8
                I think you will need to raise an SR with oracle support on this error ORA - 00600.

                Comment

                • Sandeep M

                  #9
                  Its an internal error happened in ORACLE. we cudnt do nothing in this regard.

                  anyway we cud bypass this by tricks :).

                  select MANAGERS_NAME FORM (select * from SERVC_MGR_REPT_ V_CELL where EMPLOYEES_NAME= 'Ma, Stephen')

                  will it solve?

                  Comment

                  Working...