473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Oct 22 '10 #1
8 2077
rski
700 Expert 512MB
Can you show a view definition and column types wich are in that view.
Oct 23 '10 #2
Hi,

Thanks for your reply..

This is the view definition.

CREATE OR REPLACE FORCE VIEW "LOS_AT"."SERVC_MGR_REPT_V_CELL" ("MANAGERS_CID", "MANAGERS_NAME", "SERVICE", "EMPLOYEES_CID", "EMPLOYEES_NAME", "EMPLOYEES_HR_STATUS", "EMP_LOCATION", "COUNTRY", "DEPT", "CHARGED_ITEM", "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_number,sum_ytd,
avrg, curr_mnth,
NULLIF ((NVL (curr_mnth, 0) - NVL (avrg, 0)), 0) delta2monthly_avg
from (SELECT level_1, mgr_name, 'Cellphone Charges', up0_cid, up0_name,
up0_hr_stat, up0_location, up0_country, cel_emp_dept,
cel_phone_number,
get_sum_ytd_charges (up0_cid,
cel_phone_number,
cel_emp_dept,
'los_cellphone_charges'
) sum_ytd,
round(sum(cel_ebi_amount_in_dollars)/(max(REPLACE(CEL_BILLING_MONTH_YR,'/') )-min(REPLACE(CEL_BILLING_MONTH_YR,'/') )+1),2) avrg,
get_sm_month_charges
(up0_cid,
1,
cel_phone_number,
cel_emp_dept,
'los_cellphone_charges'
) curr_mnth


from los_cellphone_charges chrg,los_coredir_expld_v emp
WHERE chrg.cel_commerceid = 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_number) ;

Thanks,
Flora
Oct 25 '10 #3
amitpatel66
2,367 Expert 2GB
Try this:

Expand|Select|Wrap|Line Numbers
  1. select "MANAGERS_NAME" from SERVC_MGR_REPT_V_CELL where EMPLOYEES_NAME='Ma Stephen';
  2.  
  3.  
Oct 25 '10 #4
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
Oct 26 '10 #5
amitpatel66
2,367 Expert 2GB
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.
Oct 26 '10 #6
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
Oct 28 '10 #7
amitpatel66
2,367 Expert 2GB
I think you will need to raise an SR with oracle support on this error ORA - 00600.
Oct 30 '10 #8
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?
Nov 8 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Guy Hocking | last post by:
Hi there, I have a problem in my ASP/SQL Server application i am developing, i hope you guys can help. I have a ASP form with list boxes populated by SQL tables. When a user selects a value...
8
by: Adam Nemitoff | last post by:
Is is possible to construct a SELECT statement that contains a WHERE clause that uses the value from a column in the "next" row? ie. given a table with a single field named "myField" with the...
1
by: Sandeep | last post by:
Hello All, Is there a way to run sql select statements with column numbers in place of column names in SQLServer. Current SQL ==> select AddressId,Name,City from Address Is this possible...
3
by: tgru | last post by:
Does anyone know a select statement that would return the column names and keys and indexes of a table? Thanks, TGru *** Sent via Developersdex http://www.developersdex.com *** Don't just...
1
by: avinash | last post by:
hi my self avi i want to copy data from one table to other table,by giving certain condition and i want o use insert statement .in this i want to pass some value directly and some value from...
1
by: John Hall | last post by:
We need to read a SQL database containing a mix of English words and Chinese Characters. We think we need to use the N'xxxx' to read the Unicode. We have one place where the SELECT statement...
18
by: war_wheelan | last post by:
I am very new to Transact-SQL programming and don't have a programming background and was hoping that someone could point me in the right direction. I have a SELECT statement SELECT FIXID,...
0
by: Michael Seele | last post by:
hi! i need a list of all primary keys in my database! for this reson i build these sql-statement: /SELECT pg_class.relname AS tableName, pg_constraint.conname AS pkName, pg_constraint.conkey AS...
2
by: bhanab | last post by:
Hello, Please can someone help me with this select statement? How do I get the statement to keep the week number static? ie if there are no values then it should show up as NULL, zero or just stay...
1
by: BlackMustard | last post by:
hi all, i am currently using the following union select statement to select records from two of my tables to a gridview in asp.net: SELECT ConcertName AS Name, ConcertDate AS Date, ConcertTime AS...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.