Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Difference between HANA SQL & HANA SQL SCRIPT

$
0
0

Hi Naga Chaitanya,

 

In sql console  we are using sql statements  and SQL script like cursors, for loops, variables, calculations and so on.

 

See in img1.

 

Sql script is used in calculation view scripted …In this sql statements(a) or CE function  (b) Are used.

 

  1. a.  BEGIN

      tab_var = select col1 from <schema>.<table>;

    END;

 

  1. b. BEGIN

      tab_var = CE_COLUMN_TABLE ("<schema>.<table>",["Col1"]);

    END;

 

See in img 2.(sql statements).

See the link http://blog.dbi-services.com/sap-hana-sql-scripting-optimization-the-ce-functions/ .(ce functions)


SQL script without CE functions is still SQL script. Similarly  SQL script without SQL or CE functions is still SQL script. Remember you could have more than just SQL statements or CE functions within a SQL script like cursors, for loops, variables, calculations (e.g. a = b+ c) so on and so on .

An example:

 

create procedure <schema>.procedurename(

          in a integer,

          in b integer,

          out c integer)

language sqlscript as

begin

c := a + b;

end;

                                                                           

The above procedure is also a SQLscript and it doesn't have a single SQL or CE function.


Regards,

Khaga.


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>