Hana specific code to data Flashcards

1
Q

Are keywords case sensitive in HANA native or Open SQL?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In HANA native SQL are table and column names converted to uppercase?

A

Only if they are not enclosed in double quotes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If I need to access a data source not defined in the ABAP data dictionary, what must I use?

A

HANA native SQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In HANA native SQL where must the element list be placed?

A

After the FROM clauses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the source/field separator in HNSql?

A

a period

table.field

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the difference in Schema handling between HNSql and OSql?

A

HNSql uses the default implicit (user) schema or schema name before table name
OSql can only use the default schema

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In Hana Native SQL how is the client handled?

A

It must be specified, there is no implicit client handling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference in the syntax of HNSql and OSql when it comes to limiting the number of rows selected?

A
In HNSql it is the keyword TOP
In OSql it is the phrase UP TO # ROWS
e.g
TOP 50
UP TO 50 ROWS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Does HANA Native SQL have access to CDS views?

A

Yes and no, it won’t have access to the CDS as defined in the data dictionary but it will have access to the underlying SQL view created by the CDS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are two common Open SQL clauses that are not supported in HANA native SQL?

A

FOR ALL ENTRIES

CORRESPONDING FIELDS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

There is no syntax check for HANA Native SQL in ABAP. How can a syntax check be carried out?

A

In Eclipse, use SQL Console to test the statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is difference between dats_days_between and days_between

A

the dats_ are used in open sql because dates are stored as numeric strings yyyymmdd
In hana dates are stored based on the sql standard of yyyy-mm-dd and can use standard sql functions like days_between

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the advantages of AMDPs?

A

AMDPs allow database procedures to be fully maintained and managed in ABAP.
All SQLscript syntax checking, debugging, transporting..

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How are AMDPs created?

A
As a method in a class where the method definition includes the keywords BY DATABASE PROCEDURE in the implementation.  This method then contains SQLscript instead of ABAP commands.
e.g.
METHOD my_method BY DATABASE PROCEDURE.
...sqlscript
...sqlscript
ENDMETHOD.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

If an AMDP method will be part of a class, what interface must be present in the public section of the class.

A

IF_AMDP_MARKER_HDB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What types must be used for parameters of AMDP methods?

A

Scalar types. These are SQL-92 compliant types

Or table types with scalar columns

17
Q
AMPD methods can have all types of paramters;
Import
export
changing
returning?
A

No, returning is not available

18
Q

Parameters of AMDP can refer to ABAP dictionary structures as long as the structure only contains elementary components?

A

False. You cannot use ABAP dictionary structure type regardless of their components

19
Q

Table types can be used as parameters in AMDPs?

A

Yes, but the line of the table must be simple. Nothing nested is allowed. All fields must be scalar.

20
Q

Can the parameters of the AMDP have default values?

A

Yes

21
Q

The AMDP method must be in the public section of the class?

A

Incorrect, it can be public, protected, or private

22
Q

Write an example of method that calls a AMDP

A
Method my_amdp 
   BY DATABASE PROCEDURE
   FOR hdb
   LANGUAGE sqlscript
   OPTIONS read-only   -- not required
   USING bkpf vbak
...sqlscript starts here
23
Q

AMDP methods are instance methods?

A

Yes and no. They are defined in as methods, not class-methods, but they are executed as static methods

24
Q

If the AMPD uses ABAP tables or other objects, or calls other AMDPs, these must be listed in the USING clause of the method implementation

A

True

25
Q

SQLScript statements are ended with a…?

A

Semi-colon ;

26
Q

How are comments added in SQLScript?

A

two dashes –

or a * in column 1

27
Q

In SQLScript, the host variables of SQL statements is escaped with …..

A

: a colon

28
Q

In SQLscript, there is no INTO addition for the select clause. How are records stored

A
The left hand side of the statement is the receiver structure or table.  IT DOES NOT NEED TO BE DECLARED IN ADVANCE
e.g.
my_results = 
SELECT myfld1, myfld2
FROM thetable
WHERE fld3 = :import_param
29
Q

In SQL script, how are system fields such as client accessed?

A
Using SESSION_CONTEXT('syfld')
e.g.
MANDT = SEESION_CONTEXT('CLIENT')
30
Q

within an AMPD, how would I call an existing AMPD?

A

Remember that even though they are defined as instance, they are global. So within a AMDP we would call an AMDP as CALL ‘{the class name the amdp is in}=>{ampd_method}
e.g
CALL “CL_BOB=>BOBS_AMDP( )”

31
Q

From ABAP, a AMDP is called like any other global method?

A

This is true

Call CL_CLASS=>METHOD( )

32
Q

AMDPs can be enhanced by…

A

A BADI if it was provided by the developer. In this case the BADI must be referenced in the USING clause of the BY DATABASE PROCEDURE clause

33
Q

What is ADBC used for?

A

Connecting to secondary databases

34
Q

What are the 7 steps of using an ADBC

A

1) Choose the database connection
2) Instantiate class CL_SQL_STATEMENT
3) Fill a string with the SQL
4) Call EXECUTE_QUERY of CL_SQL_STATEMENT
5) Assign a target variable for the result set calling CL_SQL_RESULT_SET method SET_PARAM or SET_PARAM_TABLE
6) Retrieve the result set calling CL_SQL_RESULT_SET method NEXT_PACKAGE
7) Close all by calling CL_SQL_RESULT_SET method CLOSE