IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New HP-UX, piping problems w/ special characters.
Friend of mine is having trouble running an SQL script on a HP server. The hash-bang at the beginning of the script file says:

#!/bin/sh

Then there's a line that starts Oracle SQL Plus with some SQL-commands file as input, like so:

sqlplus userid/password@serverid < sqlcommandfilename.txt

Thing is, in sqlcommandfilename.txt, there are some lines with underscores in them, which apparently messes something up somewhere:

update sometable set somecolumn='PartOne_PartTwo'

After having run this, you'd expect there to be some records where the value of somecolumn is PartOne_PartTwo in the database... But, examination reveals, the rows that are actually created in the DB contain just PartOne!

Any hypotheses as to where this problem stems from? Does the script interpreter somehow get involved, or is it the piping-in of the SQL-command file itself that is somehow interrupted at the underscore? Or, is it not the underscore, but the apostrophes that foul thing up -- are they getting interpreted as "backticks"? (Though I thought that was Perl or something, not the basic [Bourne?] shell.)

[Edit:] It doesn't seem to be in SQL Plus itself, since the exact same statement copied from the script file and pasted into an SQL Plus window *does* insert the correct value of PartOne_PartTwo into somecolumn. That's why we're thinking it has to be something in he piping itself, somehow.

Anywhichway... not being a Unix hacker myself either, I'll be grateful for anything that might help.


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
Expand Edited by CRConrad Jan. 13, 2003, 05:25:32 AM EST
New Looks like an sqlplus problem.
Though I'd have your friend confirm that the redirection works correctly at the prompt.

FWIW, /bin/sh in any fairly recent HP-UX is something called a POSIX shell. It's quite a lot like bash, but not completely (in fact, you probably wouldn't even notice unless you do complicated shell programming). As evidenced by the name, it's the default shell. I really rather doubt the shell is interfering in file redirection like that, but it's probably worth a check. Redirection is easy to find in the man page.

Wade.

Microsoft are clearly boiling the frogs.

New Nope, that doesn't seem to be it - see edit, above.
New That's not what I asked.
I said to try the redirection that the script is doing at a command prompt. You could also try it in an alternate shell - HP-UX comes with the Korn shell, I think.

Wade.

Microsoft are clearly boiling the frogs.

New Actually, you didn't *ask* me *anything*... *I* asked! :-)
But, yeah, I got it -- "Though I'd have your friend confirm..." is a way of 'asking' without actually phrasing something as a question. :-)

And, yeah, *now* I got it, what you really meant before -- I was too locked-on to the _SQL*Plus_ prompt, and so I thought that was what you were talking about.

Will pass this one on, too.

Thanks!


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
New Check the value of the escape character?
This is coming from a few years ago when I had to work with SQL on $SOME_UNIX_VARIANT_NOT_HPUX. Anyway, [link|http://www.acronymfinder.com/af-query.asp?String=exact&Acronym=ISTR&Find=Find|ISTR] having to enter some SQL command like set escape [ so that whatever the default value is (quite possibly _) gets out of the way.

I'm not sure if it was truly "set escape" but it was something like that. Look into it, perhaps.

Also, if you don't have a login on [link|http://technet.oracle.com/|Oracle TechNet] I highly recommend it. Free as in beer.
-YendorMike

[link|http://www.hope-ride.org/|http://www.hope-ride.org/]
New Thanks! Reported it on, he's checking.
And yeah, we might of course have used Our Own Dog Food... But I just felt the zIWT Hive-Mind is so much *better*! :-)


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
     HP-UX, piping problems w/ special characters. - (CRConrad) - (6)
         Looks like an sqlplus problem. - (static) - (3)
             Nope, that doesn't seem to be it - see edit, above. -NT - (CRConrad) - (2)
                 That's not what I asked. - (static) - (1)
                     Actually, you didn't *ask* me *anything*... *I* asked! :-) - (CRConrad)
         Check the value of the escape character? - (Yendor) - (1)
             Thanks! Reported it on, he's checking. - (CRConrad)

My other car is a unicycle.
50 ms