Unix Technical Forum

Strange View in the database

This is a discussion on Strange View in the database within the Oracle Database forums, part of the Database Server Software category; --> There is this strange view in the database i am working on: "create or replace view inv_dtls as select ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-24-2008, 03:25 PM
anish
 
Posts: n/a
Default Strange View in the database

There is this strange view in the database i am working on:
"create or replace view inv_dtls as
select to_char(null) supplier_name,to_date(null) invoice_date,
to_number(null) invoice_number from dual where 1=2"
Can any body please tell why exactly such views are needed .Front end
of the application is designed using forms 6i.

Regards,
Anish

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-24-2008, 03:25 PM
Billy
 
Posts: n/a
Default Re: Strange View in the database

anish wrote:
> There is this strange view in the database i am working on:
> "create or replace view inv_dtls as
> select to_char(null) supplier_name,to_date(null) invoice_date,
> to_number(null) invoice_number from dual where 1=2"
> Can any body please tell why exactly such views are needed .Front end
> of the application is designed using forms 6i.


It could serve as a template of sorts.. but the resulting template is
- SUPPLIER_NAME varchar2 -undefined length-
- INVOICE_DATE date -zero length-
- INVOICE_NU<BER number -zero length-

And this template cannot be used for much anything SQL-wise. The zero
lenghts prohibts it from being used for create a table. Zero lengths
also does not make it very usable for PL/SQL record types.

Could be a left-over of some developer's experimentation with a
template definition for a view.. maybe dealing with disparate data sets
via a UNION and using this as the result set template.. (which is not
something that works as you cannot govern the sizes of data types using
this method).

--
Billy

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-24-2008, 03:25 PM
gazzag
 
Posts: n/a
Default Re: Strange View in the database

I agree.

It may also have been left over to ensure that a PL/SQL function or
procedure compiled successfully despite an obsolete table/view being
dropped.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:02 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com