Skip to Content
avatar image
Former Member

Database stored procedure print or message statement for tracing

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:

lv_uuid1 NVARCHAR( 40 );
lv_uuid1 = SYSUUID;
VALUES( '230', lv_uuid1, p_new_TRANSID, 'T_WORKORD' );

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

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.


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jun 13, 2017 at 06:15 AM

    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)

    Add comment
    10|10000 characters needed characters exceeded