Reg expression ISQL output

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Mark

Reg expression ISQL output

Post by Mark »

I regularly use Textpad to compile SQL into MS SQLServer using the ISQL tool.
If there is an error I get a message lke:

"Msg 133, Level 15, State 1, Server MARKTELE, Procedure p_RPO_Intraday_PreProcess, Line 261
A GOTO statement references the label 'TheEnddd' but the label has not been declared.

Tool completed with exit code 1"

I have tried in vain to get Textpad to jump to (in this case) Line 261 of the document that was being compiled. The RegExes I've tried include:

^.* Line \([0-9]+\)
Line \([0-9]+\)

and also (after setting Use POSIX regular expression syntax):

Line ([0-9]+)


However I always get "Cannot jump to item under cursor"

I have set the register for Line =1 and the others blank.


Can anyone help?

Thanks

Mark
Ed

Re: Reg expression ISQL output

Post by Ed »

I think that the problem here is that you have no file name for TextPad to refer to. When attempting to jump from the current "file" (which must be Command Results) it has no way of knowing which file caused the problem. You know and I know but how to tell TextPad...
Mark

Re: Reg expression ISQL output

Post by Mark »

But in the docs it says:
"In general, each line must include a file name, but there is one special case: if the output specifies only the corresponding line numbers (and optional column numbers), the file name is assumed to be that of the document that was active when the tool was started."
Ed

Re: Reg expression ISQL output

Post by Ed »

My apologies. - I should have read the help.
Ed
Mark

Re: Reg expression ISQL output

Post by Mark »

No worries! Thanks for taking a look! :)
Andreas

Re: Reg expression ISQL output

Post by Andreas »

I just played around with that using a dummy tool, a perlscript which just writes some lines:

SomeStuff Line 32 Someotherstuff
SomeStuff Line 64 Someotherstuff
SomeStuff Line 128 Someotherstuff
SomeStuff Line 256 Someotherstuff


Using
.*Line \([0-9]+\).*
worked, it did not work when I removed one or both of the .*

for POSIX, just remove the \
.*Line ([0-9]+).*
(I did not test the POSIX variant, only the non-Posix)

It seems like the Regex has to match the whole line...
HTH
Andreas
Mark

Re: Reg expression ISQL output

Post by Mark »

Thanks!! Works perfectly
Post Reply