Line break pl/sql

fidjy5 Posted messages 10 Status Membre -  
fidjy5 Posted messages 10 Status Membre -
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..
Configuration: Windows 2003 Firefox 2.0.0.14

2 réponses

Mimiste Posted messages 1159 Status Membre 206
 
```html Pour le retour a la ligne normalement il faut que tu concatène le caractère 13 et 10 donc a la fin d'une ligne t'ajoute

CHAR(13) & CHAR(10)

--
La sportivité commence là où le diesel s'arrête !
You can still watch this? Wait until the VTEC kicks in! ```
1
fidjy5 Posted messages 10 Status Membre
 
Well, if I do something like
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 CHAR(13) & CHAR(10) DECLARE @cpt int;"&vbCrLf&" DECLARE @good int;"&vbCrLf&" DECLARE @tiers int;"&vbCrLf
trigg=trigg&"SELECT @good=count(*) from stat_goods where code_good=(select code_good from inserted)"
trigg=trigg&" IF @good=0"

to test this, it does not give me any line breaks.
0