newline data in texis queries?

rgwin
Posts: 5
Joined: Thu Jul 27, 2006 7:19 pm

newline data in texis queries?

Post by rgwin »

I'm trying to use the cmd-line texis executable to add another exclusion pattern to many search profiles at once. But I can't figure out how to specify the required newlines. Is this possible from the cmd-line? My query is something like this:

UPDATE options
SET String='the-new-content'
WHERE Name='SSc_excludepats'

I want 'the-new-content' to be three items on three lines:

/cgi-bin/
~
&printable

If I try this: "/cgi-bin/\n~\n&printable"

I get this:

100 Could not find field cgi-bin/\n~\n&printable in the function Evaluate
100 Could not update record

It seems that data must be in single quotes.

But if I try this: '/cgi-bin/\n~\n&printable'
It just updates the content with literal '\n' not a newline.

Is there a trick to this or am I out of luck?
Thanks.
User avatar
John
Site Admin
Posts: 2625
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

newline data in texis queries?

Post by John »

Just enter the newlines literally, e.g.

UPDATE options
SET String='Line 1
Line2
Line3'
WHERE ...
John Turnbull
Thunderstone Software
rgwin
Posts: 5
Joined: Thu Jul 27, 2006 7:19 pm

newline data in texis queries?

Post by rgwin »

But I can't use literal newlines in a shell command because the shell thinks I'm ending the command:

> /usr/local/morph3/bin/texis -d /usr/local/morph3/texis/testdb -h 'UPDATE options
Unmatched '.

Do I need the TSQL executable for this? How do I get that program?

Thanks,
Rob
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

newline data in texis queries?

Post by mark »

It's a broken shell that doesn't allow newlines in quoted commands. BTW, since you'll be using ' in your sql statement for the constants you need to use "" for the sql statement itself.

texis "UPDATE options
SET String='Line 1
Line2
Line3'
WHERE ..."
rgwin
Posts: 5
Joined: Thu Jul 27, 2006 7:19 pm

newline data in texis queries?

Post by rgwin »

ahh ha ha. By "a broken shell" you must mean "the c shell". I can use newlines in sh. Thanks so much, and sorry to bother you for generic unix advice.

-rob