Re: Backspacing in input
Posted in 1993
In article <C76M6H.111@promdist.pds.com> bill@promdist.pds.com (Bill Foote) writes:
>In article <C6yFps.85C@informatik.uni-muenchen.de> spitz@ana.med.uni-muenchen.de writes:
>>
>>One other SINIX enhancement in 2.1 that was dropped in 4.0 was the
>>load from/unload to PIPE. I really liked that nifty feature, since
>>it allowed statements like
>>
>> load from pipe "rsh remotehost file | awk 'something' | sed 'anything' ">>
>>and so on. Is there a chance to include that in future versions of
>>INFORMIX?
>
>Does SINIX have named pipes? If so, they could achieve the same effect.
>
>In case you're not familiar with them (I just learned about them myself
>from the recent thread on unattended backups :-), here's how to do what
>you want in SCO. (In SCO, named pipes are created with "mkfifo", and "rsh"
>is called "rcmd").
>
>
> <from the shell>
> mkfifo /tmp/my_fifo
> rcmd remotehost "file | awk 'something' | sed 'anything'" > /tmp/my_fifo &
> isql
> load from pipe "/tmp/my_fifo" insert into ...> <exit isql>
> rm /tmp/my_fifo
>
One more change: reader before writer in most versions of
UNIX I know.
>This is not an excuse for "load from pipe ..." not being part of isql.
One of the difficulties is in detecting the difference betwen
a char string for a file (type p) and for a _proces_pipeline:
cmd | cmd | cmd
could also be:
lokslikefileinpwd_BUT_iscmdfromPATH
... so that if you really want flexibility, you have to
distinguish the two.
I believe the choice they are making is:
1) for proces invocation use 'load from pipe'
2) for any type of file oriented input, including
named or unnamed pipe
standard in or open FD
b/c/r type device
streams pipe devices
use "load from" or "load from file"
May not be there entirely yet, but I expect you will see it son.
Also, to use streaming files properly, the code inside OL
may have to be altered to do very strict "read once sequentially";
it may in fact not do this. There are other cmds (such as tbape)
which do a doublke pump on the stream at hand; it requires very
careful coding (actually, a unifr\\orm front end IO subroutine
with buffering, pushback, etc. handled, an\\bout 10 pages of
VERY careful coding) to do these things write (errr, right)>
ANd there are some exceedingly weird situations that have to be
handled in regards to isolation, stable data and rollback.
Not completely trivial.
roy andrew crabtree
uunet!mcnc!rbdc!royc
>It seems like an obvious feature (and it should only take Informix a line
>or two of code to implement).
>--
>Bill Foote bill@pds.com
>PDS Corp, Los Angeles, CA USA uunet!promdist!bill