Fetch Schema Names, Table Names and their Sizes

Certified Associate Developer

Hi Community team,

I have an requirement to fetch all the Schema Names and their associated 'Table Names with their Sizes'  to display them in the appian interface.

In order to achieve this, From the cloud database I have executed the following SQL statement which gives me the output: 

SELECT table_schema as `DB`, table_name AS `Table`, 
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS `Size` 
FROM information_schema.TABLES WHERE TABLE_SCHEMA IN ("Appian", "SchemaA", "SchemaB") ORDER BY `Size` DESC;

On executing the result: EX

DB Table Size
Appian data 30.56
Appian example 28.52
ScheamA customer 3.52
Appian document 3.52
SchemA CaptureDetails 2.64
SchemaB Controls Library 2.52

Similarly, I'm trying to implement the same functionality in Appian using Query Database Smart Service in Process Model, on the set-up tab I'm able see only one schema(Selecting Pre-defined schema ) details:

Instead of that I need to retrieve all the mentioned schema details. Kindly let me know any solution for this.

Thanks in advance,

Chandrasekhar

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Create multiple Query Database Smart Service activities within your process model, one for each schema you want to query.
    Each activity will have a static SQL statement specific to the targeted schema.
    After each activity execution, use a decision shape or appropriate logic to combine the retrieved data from each schema into a single list. You can achieve this by concatenating the output lists from each activity.

Reply
  • 0
    Certified Senior Developer

    Create multiple Query Database Smart Service activities within your process model, one for each schema you want to query.
    Each activity will have a static SQL statement specific to the targeted schema.
    After each activity execution, use a decision shape or appropriate logic to combine the retrieved data from each schema into a single list. You can achieve this by concatenating the output lists from each activity.

Children