SQL Sequence Pow Function

The seq_pow() function takes two sequence arguments of type double and returns a sequence of type double. The elements of sequence 1 are raised to the power of the corresponding elements of sequence 2.

Following is an example script demonstrating theseq_pow() function:

 
    INSERT INTO SimpleSequence(testNumber,dVal1,dVal2)
    VALUES(5,'{2,3}','{2,3}');
     
    SELECT dVal1,dVal2,seq_pow(dVal1,dVal2) AS "pow" FROM SimpleSequence WHERE testNumber=5;
     
    dVal1{}
    dVal2{}
    pow{}
    ---------------------------------------------------------------------
    {2.000000, 3.000000}
    {2.000000, 3.000000}
    {4.000000, 27.000000}
         

Sample script

A sample script to demonstrate this select statement using xSQL can be run from the samples/xsql/scripts/financial directory with the following command:

     
    f 3