System SQL functions for diagnostics
as_print allows you to check the values when executing a stored procedure. Its output is on the /start page in the admin control panel. Creates an entry in as_trace with the code print
exec as_print @str='132'
Do not leave print on a permanent basis-otherwise it will complicate the analysis of the output of as_print in the future. We checked some values and removed them from the code.
as_warning fixes possible problem situations. This is not a full-fledged error, but it can have negative effects (for example, too many files are linked to the order). Creates an entry in as_trace with the warning code.
exec [as_warning] @str =''[, @place = '', @itemID=0]
as_error - fixes the error. If there is an SQL exception, the data on the exception will also be recorded. Creates an entry in as_trace with the exception code.
exec as_error @str='132'
Stored procedure texts
as_print:
CREATE OR ALTER PROCEDURE [dbo].[as_print]
(
@str as varchar(max)
)
AS
BEGIN
insert into as_trace (code, text, created) values ('print', left(@str, 2048), getdate())
print @str
END
as_warning:
CREATE or ALTER PROCEDURE [dbo].[as_warning]
(
@str as varchar(max),
@place as nvarchar(max) = '',
@itemID int = 0
)
AS
BEGIN
insert into as_trace (code, header, text, itemID, created) values ('warning', @place, left(@str, 2048), @itemID, getdate())
print @str
END
as_error:
CREATE OR ALTER procedure [dbo].[as_error]
@str nvarchar(max)
as
begin
declare @s nvarchar(max) = isnull(@str , '') + ' '
declare @errorMsg nvarchar(max) = ERROR_MESSAGE()
if(isnull(@errorMsg, '')<>'')begin
set @s += 'Msg: ' + @errorMsg +
', Proc: '+ isnull(ERROR_PROCEDURE() , 'n/a') +
', Line: '+ isnull(try_cast(ERROR_LINE() as nvarchar) , 'n/a') +
', ErrorNumber: '+ isnull(try_cast(ERROR_NUMBER() as nvarchar) , 'n/a')
end
print @s
declare @t table(id int)
insert into @t
exec as_trace_warn
@code ='exception',
@header = @s,
@itemID =0,
@text ='',
@username = ''
- Management
- Falcon Space Foundation
- Basic components
- Falcon Space Features
- Коммуникация с пользователем
- Дизайн, стилизация
- Integrations
- Каталоги
- Навигация
- Документы
- Additional component
- Продвижение, SEO
- Системные моменты
- HOWTO
- HOWTO Tables
- HOWTO Forms
- Working with SQL SQL. Internal SQL functions and helper stored procedures SQL. How to avoid problems with naming stored procedures. SQL. Debugging stored procedures and identifying the causes of errors SQL. How to specify links in SQL SQL. The Cabinet interface is not the CRUD repository methods! System SQL functions for diagnostics Execution of arbitrary SQL queries from the administrator's cabinet Optimization of site speed. How to avoid website brakes How to improve your code-notes on the revision of the code on the Falcon Space platform
- HOWTO JS
- HOWTO Layout
- Solve problems
Falcon Space Platform
This is a reduction in the cost of ownership
at the expense of fewer people to support
This is a quick change
while using the program
This is a modern interface
full adaptation for mobile devices
- Falcon Space Video
- Platform features demo will allow you to understand how this or that component looks and works
- Have a question? Write to the chat at the bottom right