Home > Ask the Oracle Database / Applications Experts > Questions & Answers > Help creating a script from a view
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

Help creating a script from a view

Brian Peasland EXPERT RESPONSE FROM: Brian Peasland

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site
>
QUESTION POSED ON: 22 December 2003
To create a script from a view, I tried to use this command:
SELECT 'CREATE OR REPLACE '||view_name||' AS '||text||';' 
FROM user_views 
WHERE view_name = 'MY_VIEWNAME';

But I'm getting error "ORA-00932: inconsistent datatypes: expected NUMBER got LONG" because the "TEXT" COLUMN datatype OF USER_VIEWS in data dictionary is long. Any solutions?


>
Query from DBA_SOURCE instead. The TEXT column of DBA_SOURCE is a VARCHAR2(4000) datatype. There may be multiple rows for your view in this DBA_ view so order by the LINE column as well. Alternatively for Oracle 9i, use the DBMS_METADATA.GET_DDL stored procedure to get the information for you.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Oracle White Papers: Fusion Middleware
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts