Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9052

Re: drop temp tables if exist in SAP HANA query

$
0
0

Hello Justice,

 

As Florian said it would be best to use the calculation view to implement your logic. Hence I don't know what exactly your requirement just thought of sharing your code in HANA structure. Can you have a look and try expanding ?

 

CREATE PROCEDURE 'your schema name'.STAFF_RPORT  (IN Prjcode1 DATE, IN prjcode2 DATE)

DEFAULT SCHEMA 'your schema name'

AS

 

 

  tab_exists smallint := 0;

 

 

BEGIN

 

SELECT COUNT(1) INTO tab_exists

FROM TABLES

WHERE SCHEMA_NAME = 'your schema name' AND TABLE_NAME = 'test_table';

 

IF :tab_exists > 0 THEN

  EXEC 'DROP TABLE ' || 'your schema name'  || '.' || '"test_table"' ;

END IF;

 

--- add your create table logic

-- for taking the output as a table you can create a table type and assign the result into it

 

END;


Viewing all articles
Browse latest Browse all 9052

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>