View with subquery loss precision and scale

Hello

Is it possible to preserve (or force somehow) precision number of column in a view with a subquery? Seem CAST does not work in the subquery with NUMBER type...

I was following the situation (10 g 2):

create or replace view abc as
Select cast (1 as number (2)) C1, "A" C2, (select cast (1 as number (2)) from dual) as c3
Double;



SQL > desc abc
Name Null? Type
----------------------------------------- -------- ----------------------------
C1 NUMBER (2)
C2 CHAR (1)
C3 NUMBER

SQL >

CAST does not seem to work in C3.

Thank you.

Pass the cast outside the subquery.

ME_XE?create or replace view abc as
  2  select
  3     cast(1 as number(2)) as c1,
  4     'A' as c2,
  5     cast((select 1 from dual) as number(2)) as c3
  6  from dual;

View created.

Elapsed: 00:00:00.21
ME_XE?desc abc
 Name                                                  Null?    Type
 ----------------------------------------------------- -------- ------------------
 C1                                                             NUMBER(2)
 C2                                                             CHAR(1)
 C3                                                             NUMBER(2)

ME_XE?

Tags: Database

Similar Questions

  • Validation of the numerical value of precision and scale

    Hi all

    IAM using ADF with EJB.
    I have an inputText field that accepts numeric values (of type java.lang.Double). Due to data constraints, I want to validate the input on its accuracy and scale value.
    I put a label of f: convertNumber under the inputText and set the MaxIntegerDigits and MaxFractionDigits properties with the values you want.
    I also set the ApplyValidation of the attribute in the file pagedef property. However, no validation has worked.
    I did the same test with af:ConvertNumber without result too.

    I know it's easy to put these constraints at the level of the entities with BC4J.

    Is there a neat way to set validation or I need to write code in the bean to support?

    How about using a regular expression validator:
    http://blogs.Oracle.com/Shay/2007/12/regular_expression_validation.html

  • create a view with subquery generating insufficient privileges!

    Hello
    I want to create a view by a DB user with DBA role, the view is based on a query that extracts data from 2 users, next to the query contains the subquery. When I run the query itself - without clause CREATE VIEW - it works and gets the data, but when I try to create a view based on this request, it generates ORA-01031: insufficient privileges pointing to the subquery.
    Any suggestion.

    Saad,

    Hello

    To use the table in a view, privileges must be granted directly to the owner of the view (or public). Privileges granted to a role are not enough to use the table in a view.

  • set values for numbers in the precision and scale

    Hello.

    I have a column named total amount by which the total showed up as 999. I want to show resembles 999.99.

    Amount total is a database column.

    My query:

    Select

    p.PRODUCT_ID,

    PN.product_name,

    p.PRODUCT_QTY,

    p.unit_price,

    p.TOTAL_AMOUNT

    OMS_SHIP_CART_DETAIL p, pn OMS_PRODUCT

    where p.product_id = pn.product_id

    and user_id = 1

    Run it below and check the last column.

    Select

    p.PRODUCT_ID,

    PN.product_name,

    p.PRODUCT_QTY,

    p.unit_price,

    TO_CHAR (p.TOTAL_AMOUNT, '99999999999999.99') Total_amount

    OMS_SHIP_CART_DETAIL p, pn OMS_PRODUCT

    where p.product_id = pn.product_id

    and user_id = 1

    In running this you can print your 999.00 value, if the value of your database is 999.

    Is there a reason why you want to do like 999.99, which would be incorrect according to the value of the database

  • What is the point of accuracy and scale to Type Number?

    Version: 11.2

    What is the point of having the precision and the SCALE type number? If you create the column with just NUMBER ie.without
    specify the precision or scale, you can enter numbers with a precision and scale.


    SQL> select * From v$version where rownum < 2;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    
    
    SQL> create table t1 (col1 number);
    
    Table created.
    
    SQL> insert into t1 values (223.9939394);
    
    1 row created.
    
    SQL> insert into t1 values (88.228384);
    
    1 row created.
    
    SQL> insert into t1 values (9.34);
    
    1 row created.
    
    SQL> insert into t1 values (000.00);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select * from t1;
    
          COL1
    ----------
    223.993939
     88.228384
          9.34
             0
    Do you already have a scenario where a numeric column should store only values with a fixed precision and scale?

    Omega-3 wrote:
    Version: 11.2

    What is the point of having the precision and the SCALE type number? If you create the column with just NUMBER ie.without
    specify the precision or scale, you can enter numbers with a precision and scale.

    SQL> select * From v$version where rownum < 2;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    
    SQL> create table t1 (col1 number);
    
    Table created.
    
    SQL> insert into t1 values (223.9939394);
    
    1 row created.
    
    SQL> insert into t1 values (88.228384);
    
    1 row created.
    
    SQL> insert into t1 values (9.34);
    
    1 row created.
    
    SQL> insert into t1 values (000.00);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select * from t1;
    
    COL1
    ----------
    223.993939
    88.228384
    9.34
    0
    

    Do you already have a scenario where a numeric column should store only values with a fixed precision and scale?

    Plenty of needs of the company for specific details and scales.

    An age can the persons required to be stored as whole not more 3-digit numbers.
    A sum of money may have to be stored with no more than 2 decimal places of accuracy for example the books of GB Pence or US Dollars and Cents
    A unit of length may need to be stored in meters with 2 decimals of centimetres
    A size may have to be stored with a decimal for half sizes
    etc.
    etc.

    Yes, you can create simply as a generic NUMBER data type, but their design with precision and scale can provide additional information on the limitations for the stored values, especially for things like tools that can use the specified precision and scale to determine how to display the automatically (default) values of reporting.

    If you start to question "what is the point?" then you may as well say what's the point of having a NUMBER data type when we can store numbers in a VARCHAR2 data type? or what's the point of having a DATE data type, when we can stored dates as VARCHAR2 data type? etc.

    No need to ask such a question because there is almost always a point to these things (and if not what they get deprecated in future versions).

  • Images disappear after loading another view with webview

    Okay, so at the beginning I had an old bar which was signed and I put that on the playbook to see what features it had. This bar has worked exactly how it was supposed to. I got the source and I had to change something, but first I had to update the sdk because I do not have the old sdk that it was built with, built when air 2.5 was outside. Everything I've done has been 3.1 the air version and the update includes the blackberry tablet sdk. He compiled and loaded on the perfectly good playbook, but after that I click on an image which acts as a button that goes to a view with a webview inside, and return to the original view, all the images in the initial view disappeared and I can't click on any one of them.

    It's weird, I remember what happens a long time ago and it has to do with something on the change of AIR/SDK, but I just do not remember what is the cause... If anyone knows what could cause the webview make the images disappear on a reload of a DIFFERENT opinion, let me know. BTW, webview was destroyed on the previous view.

    It was a problem with webview I suppose, very unstable object implementation...

  • VMware VIew 6 (PCOIP): Windows Client and web browser connects, Android and Ubuntu - don't

    Hello colleagues!

    VMware Horizon Client 3.4.0 build-2769709

    VMware View 6.1.1 construction-2769403

    VMware vSphere 6.0.0 2776511

    That's what's wrong: used SecurityServer and connecting to the server. External connection - via a router. When it is connected to a vmware PCOIP Protocol (Internet) outside of the view with a Windows client and a web browser, it works fine. But when connecting from Android or Linux (Ubuntu 14) load the desktop does not occur. Android immediately displays the message 'connection to server lost', Ubuntu delivers all messages - I'll be back on the screen to select a pool table.

    Which connection via MS RDP connection protocol is correctly to all customers.

    In the settings ConnectionServer in PCOIP Security Gateway set up the external address of the router.

    Redirect them router ports:

    -TCP 80,443,8443,4172,32111

    -UDP 4172,32111

    Any ideas?

    In security settings server in 'URL of PCOIP' was FQDN, but it must be the IP address.

  • I play internet checkers, and when I win and choose to leave the games, you people are saying that if I do, you will charge me with a loss in my SEO. What would be the reason?

    Why would you say that I'll be charged with a loss in my SEO if I choose to leave internet checkers

    ??????????????????????????????????????????

    Doesn't have the game actually finished all the way as it normally would?

    If the game is completely finished and his quiet passing, you can leave your comments here:

    http://mymfe.Microsoft.com/Windows%207/feedback.aspx?formid=195

  • Hi, I'm developing a simple mobile app in DW CC 2015 using JQuery Mobile. LIKE I need the list view with description of the product, functionality and image, I would like to connect with database instead of "writing" all the tables in the bearings inside

    Hi, I'm developing a simple mobile app in DW CC 2015 using JQuery Mobile. LIKE I need the list view with description of the product, functionality and image, I would like to connect with database instead of "writing" all the tables in the bearings inside the Jquery page. In the future I would also be able to add, to remove the DB records. Any help, tutorial... Thanks TG

    I would like to connect with the database instead of "writing" all the tables in the bearings inside the Jquery page

    This is usually done with a CMS (content management system). There are commercial products CMS like WordPress, Joomla and perch. You create one or several layouts and then create pages of these page layouts using the CMS. In this way, it is possible to have hundreds of pages, each with unique content, but a page layout that can be managed in a place of sharing.

    CMSs on shelf don't require programming skills. Otherwise, some of us write our own CMS with custom functions, but this requires back-end, as with PHP programming.

  • Problems with. OST file and view 5.0 Linked Clones

    Hello world

    I have a 5.0 view installation in my environment and am currently using only dedicated related clones. I use management Persona to display instead of disks, persistent and plan to stick with this configuration. The problem I see with the few users we currently using pools, is that sometimes (and I don't know immediately the cause) when the user opens their Outlook 2010, they get a message from outlook using an older version of their. OST file and they should remove the current on and outlook it will rebuild at the next opening. We redirect the AppData folder to their character in the hope that the mail will stay with them through the log offs, restarts, redials, etc.. Everything in this aspect seems to work except in those circumstances where it appears that the. OST file is broken.

    Y at - it an idea what could be causing this or another way to put in place to make it work? Thanks for your suggestions.esx

    We had this same problem.  The conclusion we came to was that when the. OST file is large, view Persona management cannot move this file down from the server of persona in computer display to the user in a timely.  Outlook has finally times out waiting for the file to copy and gives you the error.  The solution arrived at was to use Microsoft Folder redirection for these records.  This gives users instant access to their OST files and fixed the problem of the copy of the data.  What we did was to create a new action on the character called roaming server containing these data roaming.  It takes no less or no matter what more space than persona management and provides the same utility without interrupting the other actions ensuring the management of the persona. Adm files already exist on your server to connect to C:\Program View\Server\extras\GroupPolicyFiles from VMware and I have attached a copy of what looks like one of our GPO.

  • problem with the Finder - files and folders displaying incorrectly

    After acquiring a new iMac, I noticed a problem with the Finder - files and folders are displayed wrong (see table).

    This is what happens always after the files have been transferred from one folder to another. I was reminded of my days of using Mac OS in the 1980s when automatic setting of files was not so "automatic." I use Mac OS for decades and I don't remember the last time I had to think about GUI problems like that.

    Other problems in the graphical display of files and folders were introduced, such as when you have hundreds of files in a single folder, you end up deleting about 30 to 40 of them say in a particular section, and you end up with gaps of the ChartSpace where files used to be, that is the remaining files automatically rearrange themselves (fill in these gaps) - never. A week later, you open the folder, and the gap of GUI is still there.

    I decided to do a clean install of the operating system but nothing works.

    Is there some setting in Prefs I'm missing?

    Hi there highland99,

    Looks like your folder icons are not accommodating themselves automatically you plan to do. To me, this indicates that you have organize by the None value in the view menu. You can change the way files and folders are prepared automatically by clicking on view > reorganize by and selecting how you would like that fixed.

    Thank you for using communities of Apple Support.

  • The default tables generated views (UUT_RESULT, STEP_RESULT... and more)

    Hello

    I need an overview of the measured data, which is logical and this catalogue is put to use for further processing.
    My question is: is there the prepared tables views (UUT_RESULT, STEP_RESULT... and more) that are generated by default to the database on the SQL Server?

    Thanks for the help

    Machulda

    Machulda,

    No, he gave no views with TestStand patterns, at least I'm aware of none.

    My guess is that the views are first, perhaps according to the data provider and the actual database configuration. The schema defines the minimum configuration of the database to record data from TS, but the database can be much more complex.

    A second point is that the display of the data leaves to be desired in a different way about the use case. A table is appropriate? A graph? Don't forget that if NEITHER would provide such a view-interface, it should cover all of these options. He would become so, essentially, a new comprehensive tool like frontend for your custom database.

    I'm not saying it's impossible, but it would be much too hard to provide as an addon to 'general '...

    Norbert

  • I keep getting failed to install with error codes 643 and 646 on my Vista, when I install updates for Windows... What should I do?

    I keep getting failed to install with error codes 643 and 646 on my Vista, when I install updates for Windows... What should I do?

    Hello

    Try this 1st to see if it helps, and it should:

    Description of the Patch registration cleanup tool
    http://support.Microsoft.com/kb/976220/

    ------------------------------------------------------

    If necessary :

    Try this - Panel - Windows Updates - on every update that will not be installed - click on the important updates
    or the update itself - double click a view more information (or click top then discovers on the right)

    Those who will take you to a page where you can download the update.

    Or go here and the KBxxxxxx number to download it.

    Download Center - mount the KBxxxxxx.

    Microsoft Download Center
    http://www.Microsoft.com/downloads/en/default.aspx

    Download - SAVE - go to where you put them - click on - RUN AS ADMIN

    Then you can right click on the update in the updates Windows and HIDE.

    If you get an error Installer install this version:

    Windows install 4.5 Redistributable
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=5A58B56F-60B6-4412-95B9-54D056D6F9F4&displaylang=en

    ----------------------------------------------------

    Then run this:

    How to reset the Windows Update components? -a Mr Fixit
    http://support.Microsoft.com/kb/971058

    Description of the system for Windows Vista, Windows Server 2008, update tool and
    for Windows 7
    http://support.Microsoft.com/kb/947821

    ------------------------------------------------------------
    Because these are all Office updates you might get more information if necessary in the Agency of those groups that
    may have experienced the same problem.

    Office newsgroups
    http://www.Microsoft.com/Office/Community/en-us/FlyoutOverview.mspx

    Microsoft.public.office.misc discussions
    http://www.Microsoft.com/communities/newsgroups/list/en-us/default.aspx?DG=Microsoft.public.Office.misc&cat=en_us_01cb749f-c998-4762-8099-df71793c11c7&lang=en&CR=us

    ------------------------------------------------------------

    If necessary you can incident free get reports however the above should take care of it for you.

    Windows updates - free Incident report

    Go here and click on-> Windows Update fails while searching, downloading or installation of updates
    http://support.Microsoft.com/GP/wusupport#tab3

    The security updates, you can get free support Incident report
    http://www.Microsoft.com/protect/resources/support.aspx

    I hope this helps.

    Rob - bicycle - Mark Twain said it is good.

  • How will I know if I have KB926044 on my XP with SP3 & IIS installed and all updates installed

    Re: ESET Antivirus Rescue CD & KB926044

    The above application requires that I have the Windows Automated Installation Kit (Windows AIK) installed and that KB926044 is installed on my XP with SP3 & IIS installed and all updates installed.

    Is there a way I can check that KB926044 is installed?

    Hello

    I want you to know that the Services IIS and IIS can be installed only on Windows XP Professional. Microsoft Windows XP Home edition users are not given the ability to add IIS in the typical method. Using the method "Add / Remove Programs' in the control panel would be nice, but only the XP Professional edition allows.

    View a list of updates installed on your computer, follow these steps.

    Open Add or remove programs.

    At the top right, select the Show updates check box. All installed updates appear at the top of your list of programs.

    Notes: To open Add / Remove Programs, click Start, click Control Panel, and then double-click on Add / Remove Programs.

    You can also view your history for installation on the Windows Update Web site (http://www.microsoft.com).

    You can contact Eset customer service here: http://go.eset.com/us/support/contact/s1/#

    I hope this helps.

  • Help! Records is 'My Computer' are more grouped separately, like a normal folder view with icons appearing one after another

    I have Windows XP Pro SP3, after I shut down my computer one day and handed back upward, the look has changed to 'MY COMPUTER', they were prominent groups such as "Shared folders", "Hard drive" and "devices with removable storage".  Now, the Group disappeared and all that remains is the drives and folders in a page layout, like how a regular all types one after the other.  How to get back the old look with them separate?

    Click view > rearrange icons by > Type and view > rearrange icons by > show in groups .

Maybe you are looking for

  • Firefox buttons appear to be different sizes between computers

    I'm developing a web application, and I see the difference in behavior between instances of Firefox. My computer is running the same version as a co-worker, and yet the behavior a button seems correct on his and seems wrong on mine. I tried to reset

  • Tecra S2 no sound

    I forgot how to turn off the speakers, but I can't turn it back on. (1) mic seem to work(2) set the volume to maximum and all activated in the volume control.(3) I tried Fn Esc(4) no! in Device Manager, I see Realtek AC97 Audio(5) there is no audio p

  • Clean install of windows 7 - How to install the USB drivers?

    I bought a Toshiba Satellite C50 loaded with windows 8, but want to go back to windows 7. I downloaded the drivers needed and have mounted the .exe files on a USB pen for installation. Before proceeding to clean windows 8, I would like to know - if I

  • Satellite A10 - CD burning 800 MB extension

    Hello worldI would like to record a video of 750 MB on a CD.How can I change the settings of the burner that got a maximum of 700 mb?Thanks a lot for your help...Matt.

  • KB976325 error code 800719E4 installation problem

    HelloI recently had trouble with an update called "Cumulative security update for Windows Internet explorer 8 for Windows Vista" or KB976325.Each time it downloads and supposedly settled and then asks to restart the laptop. I do and it goes through t