cancel
Showing results for 
Search instead for 
Did you mean: 

Database stored procedure print or message statement for tracing

Former Member

Using HANA 1.00 or 2.00.

If the feature exists, please let know which version or SP to use of HANA.

Consider this stored procedure (not SQLScript):

In a HANA stored procedure (not SQLScript) is there some tracing statement I can use to write to some log that I can look up later.

For example, consider this procedure:

CREATE PROCEDURE sp_test( p_new_TRANSID NVARCHAR( 32 ) )
AS
lv_uuid1 NVARCHAR( 40 );
BEGIN
lv_uuid1 = SYSUUID;
INSERT INTO "TTEST_SYN_VALD" ( "MANDT", "GUID", "TRANSID", "TABLE_NAME" )
VALUES( '230', lv_uuid1, p_new_TRANSID, 'T_WORKORD' );

// I want to add the UUID to some HANA trace file to view later
END

After generating the SYSUUID, I would like to print that value out into some HANA tracing file so that after the fact (14 days later) I can view this output.

The output would look something like this:

sp_test:UUID:<the generated value> TRANSID:<p_new_TRANSID>

Hopefully it would have some form at timestamp on it for later reference.

In other databases I can do this with a "MESSAGE statement" like this:

MESSAGE 'sp_test:UUID:' + string(lv_uuid1) + ' TRANSID:' + string(p_new_TRANSID) + ' when:' + string(CURRENT TIMESTAMP);

I am looking for some equivalent in HANA.

Thanks in advance for any responses.

David

Accepted Solutions (0)

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

I suppose you know that about other databases, because at one point you checked the documentation.

Let's try the same for HANA!

Then you could find the TRACE command for SQL Script.

Alternatively you could write your own logger via "anonymous transactions" (another keyword to use in the docu search)