blog/business-logic-db #433
Unanswered
Replies: 1 comment 1 reply
-
We actually have put -- 1. Variable declarations (ALL at start)
DECLARE @Name NVARCHAR(MAX), @NameInput NVARCHAR(MAX), @SubmitButton NVARCHAR(MAX), @message NVARCHAR(MAX);
-- 2. Display title
EXEC sp_api_modal_text @text = N'Welcome to TSQL.APP!';
-- 3. Create input field
EXEC sp_api_modal_input @name = N'@Name', @value = @Name OUT;
-- 4. Add submit button
EXEC sp_api_modal_button @name = N'@SubmitButton', @value = N'Submit', @valueout = @SubmitButton OUT, @class = N'btn-primary';
-- 5. Wait for Submit
IF @SubmitButton IS NULL RETURN;
-- 6. Continue with @name
SET @message=concat('Hello ',@name,', welcome to https://t-sql.app, a framework built by ux1.nl')
EXEC sp_api_modal_text @text=@message, @class=N'h2'
-- 7. Add more database logic
/*
IF @SubmitButton=N'Submit'
BEGIN
INSERT INTO (...)
SELECT ( .. FROM .. WHERE [Name]=@name)
END
*/ |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
blog/business-logic-db
A retrospective look at the "never put business logic inside the database" mantra
https://zenstack.dev/blog/business-logic-db
Beta Was this translation helpful? Give feedback.
All reactions