SQL Articles - Page 11 of 12

Create User SQL in SAP HANA database

SAP ABAP Expert
Updated on 21-Feb-2020 07:52:45

3K+ Views

You can achieve this by running the below SQL query −>CREATE USER TEST password “Welcome1$$”  VALID FROM ‘2017-12-05 11:00:00’ UNTIL ‘2018-12-08 12:00:00’; CREATE USER DUMMY password “Welcome1$$”  VALID FROM NOW UNTIL FOREVER;Note that password passed in this SQL should meet password policy of SAP HANA system otherwise user creation will be failed.

Execution time while running a SQL query in HANA Studio

John SAP
Updated on 22-Jun-2020 10:49:45

835 Views

When a SQL query is executed, you can see the confirmation that the query is executed in time duration and also with server processing time. In this scenario, you can see the time taken by SAP HANA processor to create a new table in the HANA database as below −“Statement 'Create Table Demo_HANA ( ID INTEGER, NAME VARCHAR(10), PRIMARY KEY (ID) )' successfully executed in 3 ms 117 µs  (server processing time − 2 ms 458 µs) - Rows Affected − 0”

Executing a SQL query in SAP HANA Studio

John SAP
Updated on 30-Jul-2019 22:30:21

2K+ Views

To run the query, click on green arrow button on top right corner  or press F8.

Creating a new table in SAP HANA

SAP Expert
Updated on 18-Jun-2020 08:16:45

3K+ Views

New tables can be created using the two methods given below −Using SQL editorUsing GUI optionThe new table can be created using SQL Create Table statement –Create column Table Test1 (    ID INTEGER,    NAME VARCHAR(10),    PRIMARY KEY (ID) );When you run this SQL query, you get a message like this:The statement 'Create column Table Test1 ( ID INTEGER, NAME VARCHAR(10), PRIMARY KEY (ID) )' successfully executed in 5 ms 136 μs (server processing time: 4 ms 432 μs) - Rows Affected: 0To create a table using GUI, you need to right-click on any schema name -> New ... Read More

Component Name in SAP HANA architecture

SAP Expert
Updated on 18-Jun-2020 07:50:33

238 Views

The following table lists all the key server components in HANA, the corresponding services, and OS process details.

SQL Script vs Graphical Calcualtion views in SAP HANA

SAP Developer
Updated on 30-Jul-2019 22:30:22

994 Views

In SAP HANA Modeling, Graphical Information Views are faster as compared to SQLScript in almost every scenario and also Graphical Information Views are easier for others to understand, remodel and change.There are scenarios where you need SQLScript, but it shouldn’t be viewed as a general-purpose solution to modeling problems.Note:It is never recommended that you code a Calculation View with SQL Script and use it inside another Calculation View with CE Functions as it results in a very bad performance.

Manual compression of a table in SAP HANA

John SAP
Updated on 18-Jun-2020 07:27:31

1K+ Views

It is also possible to compress a table in SAP HANA system manually by executing the following SQL statement.UPDATE "table_name" WITH PARAMETERS ('OPTIMIZE_COMPRESSION' = 'YES')This results in deciding whether a compression is required or an existing compression can be optimized. In this scenario, HANA system uses most suitable compression algorithm.When you run the above SQL command, compression status remains the same. You can also force the database to reevaluate compression using the following SQL status UPDATE "AA_HANA11"."SHOP_FACTS" WITH PARAMETERS ('OPTIMIZE_COMPRESSION' = 'FORCE')

Checking Compression ratio of a table in SAP HANA

SAP Expert
Updated on 06-Mar-2020 06:10:25

1K+ Views

To check the Compression ratio for a table, you can navigate to Table Definition. Go to Runtime Information.To see Compression Ratio, go to Columns tab. You can see the compression ratio in the Main Size Compression Ratio [%] column.

Analogous to IN operator of SQL in SAP

vanithasree
Updated on 13-Feb-2020 11:31:25

175 Views

You can get similar things done in many ways. You can use an internal table usage or a range table.Let me showcase an example with an internal table for your reference.SELECT Id, Name, DOB FROM sEmployee INTO CORRESPONDING FIELDS OF TABLE result_tab FOR ALL ENTRIES IN internal_tab // internal_tab is an internal table defined with columns WHERE Id = internal_tab -Id AND Name = internal_tab –Name

Using SQL statements in ABAP Programming and Database performance

Anvi Jain
Updated on 18-Dec-2019 07:57:43

350 Views

The basic principle for performance is that there should be minimal data transferred between application server and database.For your first question, I would suggest to select only the fields that are required. So, don’t use SELECT * in case you don’t require all the fields. But in specific scenarios, if you have multiple SELECT statements at various parts of your program querying the same table but different columns, it is advisable to use SELECT * as the output is stored in a buffer till your program execute. In that case, when you come to subsequent select, the system uses the ... Read More

Advertisements