51
Views
6
Comments
SQL Script
Question

Hi All,

Is there any forge component or Option available to execute SQL script to create table in OutSystems DB 

2023-10-21 19-42-11
Tousif Khan
Champion

Hello @Lincy Thomson

OutSystems suggests us  not to write DDL commands- 

Avoid Data Definition Language The SQL tool should only be used to execute the following: SELECT, INSERT, UPDATE, and DELETE statements. Using Data Definition Language (DDL) statements like CREATE TABLE, ALTER TABLE, DROP TABLE, etc. might make the OutSystems metamodel inconsistent, leading to misbehavior.

Here is more details on the article  - 

https://success.outsystems.com/documentation/11/building_apps/data_management/data_operations/sql_queries/

Thanks
Tousif Khan

2019-01-07 16-04-16
Siya
 
MVP
2021-11-12 04-59-31
Manikandan Sambasivam

Hi,

  • DBCleaner API: Useful for managing tables but not for creating new ones.
  • SQLToolbox: Allows executing advanced queries but does not provide a user-friendly interface for schema management.
2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

To my knowledge, there is no such option available in OutSystems, at least not in OutSystems cloud where the database is managed by OutSystems (O11 and ODC).

If you have access from OutSystems to an external database, and with the right permissions you should be able to create tables in the external database.

Regards,

Daniel

2019-01-07 16-04-16
Siya
 
MVP

It is possible to create temporary table eg: 

CREATE TABLE #TestTable ( ID INT PRIMARY KEY, Name NVARCHAR(50) ); 

INSERT INTO#TestTable VALUES (1, 'John Doe'); 

SELECT * FROM #TestTable;

Please note that it is not possible to create normal table as mentioned by @Daniël Kuhlmann on Cloud environments using DDL statements.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.