Follow us: Connect on YouTube Connect on YouTube Connect on YouTube

Pages

Friday, 1 April 2016

SQL-Power


Power is the ability to raise a value to a given exponent.

     Syntax: power (value, exponent)     

Example:
SQL> select power(2,5), power(0,0), power(1,1), power(null,null), power(2,-5) from dual;

POWER(2,5) POWER(0,0) POWER(1,1) POWER(NULL,NULL) POWER(2,-5)
--------------  --------------      ---------------   -----------------------       ---------------
        32                    1                    1                                                     .03125




You May Like                                             
                            SQL Abs
                            SQL Sign
                            SQL Sqrt
                            SQL Mod
                            SQL NVL
                            SQL NVL2                           
                            SQL Exp
                            SQL Ln
                            SQL Log
                            SQL CEIL
                            SQL Floor
                            SQL Round
                            SQL Trunc
                            SQL Bitand
                            SQL Greatest
                            SQL Least
                            SQL Coalesce


Share this article :

2 comments:

  1. Hi Dayakar,


    Fully agree on SQL-Power. We’re seeing a lot of projects tackle big complex problems but few seem to have taken into consideration and in particular reasons to adopt.


    I want to execute the different files at the run time in the SQL PLUS

    Ex: I have two different files like ABC.SQL, XYZ.SQL,

    I had declared one bind variable to hold file_name .

    var file_name VARCHAR2(200);
    DECLARE
    sr VARCHAR2(20) :='ABC';
    BEGIN
    IF sr ='ABC' THEN
    :file_name :='ABC.SQL';
    ELSE
    :file_name :='XYZ.SQL';
    END IF;
    END;
    /
    PRINT file_name

    Now i want to execute the file which is there in :file_name bind variable

    SQL>@:file_name

    It was cool to see your article pop up in my google search for the process yesterday. Great Guide.
    Keep up the good work!



    Thanks,
    Morgan

    ReplyDelete
  2. Szia,


    What you’re saying is absolutely correct SQL-Power, but this isn’t the exact situation everywhere. Where most smart folk work on a project - why can’t you do this the Boss asks :).

    I would much appreciate to get a sample of data travelling via these steps.

    Source data to Staging server(tables) then PLSQL for data cleansing and transferring them to tbl_cleanABC or tbl_error_ABC. Checking the accuracy of data and finally PLSQL for loading to data warehouse.

    Follow my new blog if you interested in just tag along me in any social media platforms!


    Gracias
    Radhey

    ReplyDelete