Re: Perl "system" command and Informix
Posted in 1998
On Tue, 04 Aug 1998 18:15:51 -0700, in article <35C7B247.407E@earthlink.net>,
Jonathan Leffler <jleffler@earthlink.net> wrote:
>Edward Villalovoz wrote:
>>
>> Can anyone tell my what i'm doing wrong? The following procedure works if i
>> hard code the $hh in as say, "12", but it won't work if i try to have it
>> read from the list. I keep getting the error,
>>
>> 1262: Non-numeric character in datetime or interval.
>> Error in line 3>> Near character position 44
>>
>> 201: A syntax error has occurred.
>> Error in line 1>> Near character position 4
>>
>> Please tell me what i'm doing wrong. Thanks in advance.
>> ============================================
>> #!/usr/local/bin/perl
>>
>> @half_hours = ("12","13","14");
>>
>> foreach $hh (@half_hours) {
>>
>> $ENV{INFORMIXSERVER} = "n36_shm";
>> system q{
>> dbaccess << 'eof'
>> database pmsys@n36;
>> SELECT *
>> FROM ama0_980714
>> WHERE EXTEND (ostime, HOUR to HOUR) = "$hh";>> eof
>> };
>>
>> print "got half hour $hh\\n";
>> #other code....
>>
>> }
>
>You're using q instead of qq, so Perl is not interpolating the value
>of $hh, so OnLine is complaining that $hh is not a valid datetime
>literal.
Hadn't noticed that. Still can't figure out why I couldn't get the dbaccess
part to work without the double dash. Hmmm. Something to check into.
--
for i in databasix primenet ; do ; gburnore@$i ; done
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | '۳'''''''ۺ''''''''''۳
| '۳'''''''ۺ''''''''''۳
DOH! | '۳'''''''ۺ''''''''''۳
| '۳ 3 4 1 4 2 '' 6 9 0 6 9 '۳
spamgard(tm): zamboni | Official Proof of Purchase
===========================================================================