Line break pl/sql
Hello,
I am working on a script where I need to insert a database if it does not exist as well as other elements, and I cannot add a trigger on this table..
Here is the header of the code:
trigg="IF OBJECT_ID('stat_temp_"&schema&"') IS NOT NULL EXECUTE 'CREATE TRIGGER [verif_"&schema&"] ON [dbo].[stat_temp_"&schema&"] "
trigg=trigg&"AFTER INSERT AS "&vbCrLf&" DECLARE @cpt int;"&vbCrLf&" DECLARE @good int;"&vbCrLf&" DECLARE @tiers int;"
trigg=trigg&"SELECT @good=count(*) from stat_goods where code_good=(select code_good from inserted)"
trigg=trigg&" IF @good=0"
trigg=trigg&" begin"
......
So every time I concatenate, but it causes a problem that under SQL Server 2003 I cannot find the carriage return/new line symbol..
I am working on a script where I need to insert a database if it does not exist as well as other elements, and I cannot add a trigger on this table..
Here is the header of the code:
trigg="IF OBJECT_ID('stat_temp_"&schema&"') IS NOT NULL EXECUTE 'CREATE TRIGGER [verif_"&schema&"] ON [dbo].[stat_temp_"&schema&"] "
trigg=trigg&"AFTER INSERT AS "&vbCrLf&" DECLARE @cpt int;"&vbCrLf&" DECLARE @good int;"&vbCrLf&" DECLARE @tiers int;"
trigg=trigg&"SELECT @good=count(*) from stat_goods where code_good=(select code_good from inserted)"
trigg=trigg&" IF @good=0"
trigg=trigg&" begin"
......
So every time I concatenate, but it causes a problem that under SQL Server 2003 I cannot find the carriage return/new line symbol..
Configuration: Windows 2003 Firefox 2.0.0.14
2 answers
-
It's functions, you need to concatenate them in the same way you did
AFTER INSERT AS "&vbCrLf&" DECLARE
so
AFTER INSERT AS " & CHAR(13) & CHAR(10) & " DECLARE
But normally vbcrlf should do the same thing, still give it a try
--
Sportiness begins where diesel stops!
You can still watch this? Wait until the Vtec kicks in!