Hi All,
Is there any forge component or Option available to execute SQL script to create table in OutSystems DB
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/ThanksTousif Khan
Please find a similar discussion at https://www.outsystems.com/forums/discussion/80688/sql-create-error/
Hi, @Lincy Thomson
Once check "SQL Sandbox" component
https://www.outsystems.com/forge/component-overview/5900/sql-sandbox-o11
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
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.