Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on View within the Oracle forums, part of the Databases category; I have given the following statement to create a view. CREATE OR REPLACE VIEW vw_divisiondetails ( divisioncode, divisionname) AS SELECT "divisioncode","divisionname" FROM cmsdivsionmaster It was created successfully. My doubt is ...
|
|||||||
| Oracle Oracle 9i & Oracle 10g Knowledge Base Learn and Share Oracle Technology related articles, white papers, tutorials / study materials, example codes, FAQ's, Tips and Tricks. |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
View
I have given the following statement to create a view.
CREATE OR REPLACE VIEW vw_divisiondetails ( divisioncode, divisionname) AS SELECT "divisioncode","divisionname" FROM cmsdivsionmaster It was created successfully. My doubt is how it accepted column names in double quotes? Generally we use double quotes in select statement to give alias name. But here it treats it as column name. Could any body explain how it works? |
| Sponsored Links |
|
|||
|
Re: View
Hi,
In ANSI oracle like Access the column names may contain a space. So while declaring a alias name in Oracle if you put it in a double quotes then it will recognise as a single word. SELECT "divisioncode" "division code","divisionname" "division name" FROM cmsdivsionmaster here "division code" will be treated as a single name. i think you are clear now. |
|
|||
|
Re: View
As per the ANSI sql standards when we give a column name in double quotes it will be treated as a single word either it may be an alias or the column name. As i have the example for an alias name in oracle.
|
|
|||
|
Re: View
Quote:
sqlplus-->options-->Environmnet-->select escape --> under escape option select current and in textbox give '"' and set escape on and click ok sql>set escape on now it takes double quations in column name sql > select "empno" from emp; |
|
|||
|
Re: View
hi all
@susarlasireesha well, it's ok, but can u explain what is escape and it's use? we should know the use of quotes with coloum. since we can't create a coloum name with spaces....i think ,there is no use of quotes while selecting. but in case of alias, quotes are so useful. i think there is nothing more to discuss about 'quotes with colums', except what is 'set escape....' Jaya
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to view constraints? | Bhuvana07 | Oracle | 6 | 02-13-2009 07:27 PM |
| Normal View, Materialised View and Bitmap Index | Geek_Guest | Oracle | 3 | 05-28-2008 12:59 AM |
| Not able to view the script | Geek_Guest | LoadRunner | 5 | 01-23-2008 08:15 PM |
| Materailized view | krishnaindia2007 | Oracle | 2 | 11-26-2007 10:18 AM |
| A View Doubt | krishnaindia2007 | Oracle | 5 | 11-13-2007 08:59 AM |