cancel
Showing results for 
Search instead for 
Did you mean: 

How to learn SQLScripting

rajarshi_muhuri
Active Participant
0 Kudos

Is there any easier way to learn SQLscripting , the SQLScript guide shows bits and pieces of pertinent information. But not helpful enough , If one is trying to learn SQLscripting from that guide.

Are there any other documentation elsewhere ( perhaps OKP10) that teaches SQLScript in a more tutorial oriented fashion ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rajarshi

It covers only SQL Script basics, but check out the [SAP HANA Development Guide|https://service.sap.com/~sapidb/011000358700001168062011] - that's more "tutorial-like"

--Juergen

rajarshi_muhuri
Active Participant
0 Kudos

Thanks Jeurgen

I did have a look at the Dev Guide , but if I had to learn the SQL script by itself , then I would need more than that.

For example in the SQLscript SP3 guide , in page 14 , It describes how to create a stored Proc , but mentions that it omitted some details . I am guessing that big_pub_ids and big_pub_books must be initialized/declared before use , so must be some of the stuff that's been omitted. but I cant be sure .

Finally most examples in the guide seems to be based on publisher , books database . but without mentioning the structure of the database and couple of lines of sample data, its really harder to understand and be sure .

Do you think , that the data-tables structure could be provided and at least 2 lines of sample data ? "well I am only asking this since you are in SAP:)

CREATE PROCEDURE getOutput( IN cnt INTEGER, IN currency VARCHAR(3), OUT output_pubs tt_publishers, OUT output_year tt_years) LANGUAGE SQLSCRIPT READS SQL DATA AS
BEGIN
big_pub_ids = SELECT publisher AS pid FROM books -- Query Q1 GROUP BY publisher HAVING COUNT(isbn) > :cnt; big_pub_books = SELECT title, name, publisher, -- Query Q2 year, price FROM :big_pub_ids, publishers, books WHERE pub_id = pid AND pub_id = publisher AND crcy = :currency; output_pubs = SELECT publisher, name, -- Query Q3 SUM(price) AS price, COUNT(title) AS cnt FROM :big_pub_books GROUP BY publisher, name; output_year = SELECT year, SUM(price) AS price, -- Query Q4 COUNT(title) AS cnt FROM :big_pub_books GROUP BY year;
END;

former_member182779
Active Contributor
0 Kudos

Rajarshi:

I agree that the available SQLScript documentation is not the best...but as I always like to say, "The best way to learn is to code...to fail and keep coding"...

I'm learning SQLScript myself too...I create my own tables, my own Stored Procedures and implement all the SQLScript available commands...when one is not clear enough...I just try and try until I manage to know how it works...after that...I know I learn it rather than just memorize it from a book or tutorial...

This might not be true for most people...but when you have love for programming, that's the best way to go... -;)

Greetings,

Blag.

rajarshi_muhuri
Active Participant
0 Kudos

Thanks Blag - but being lazy and dumb .. i seek the easy way out

former_member194739
Active Participant
0 Kudos

Hi,

search and  SQL Script videos in YOUTUBE.  like: What´s New? SAP HANA SPS 07 SQLScript (De... | SAP HANA

Regards,

Abbas.

Answers (2)

Answers (2)

0 Kudos

There are plenty videos are available online to learn

former_member3865
Product and Topic Expert
Product and Topic Expert
0 Kudos

As Syed mentions, there are a whole host of videos on SQL scripting within SAP HANA Academy.  Check these out... SQL and SQLScript - YouTube