Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: sqlplus wrapper for history & editing
A breakthrough getting the wrapper to work...
It turns out that the subscripts are reversed for the file descriptor array that manages the pipe between parent and child. Swap 0 and 1 at lines 193 and 205. A diff is below.
The thing now works, but has some obvious flaws. It doesn't really handle multiline input well (it puts in a "SQL> " prompt where it doesn't belong on continuation lines) and the history is line by line.
However, it is working GPL code, so maybe someone will try to fix it. If everything you do is on one line, then it works great if you set sqlprompt to "".
[oracle_at_adib sqlplusplus]$ diff sqlpp_new.c sqlpp_orig.c
193c193
< if(dup2(fildes[0], 0) == -1)
---Received on Mon Nov 06 2000 - 14:14:27 CST
> if(dup2(fildes[1], 0) == -1)
205c205 < return(fildes[1]); ---
> return(fildes[0]);
Sent via Deja.com http://www.deja.com/ Before you buy.