Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sqlplus wrapper for history & editing

Re: sqlplus wrapper for history & editing

From: <bryan_w_taylor_at_my-deja.com>
Date: Mon, 06 Nov 2000 20:14:27 GMT
Message-ID: <8u73er$r99$1@nnrp1.deja.com>

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)

---

> if(dup2(fildes[1], 0) == -1)
205c205 < return(fildes[1]); ---
> return(fildes[0]);
Sent via Deja.com http://www.deja.com/ Before you buy.
Received on Mon Nov 06 2000 - 14:14:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US