Structured Query Language (or SQL, pronounced "Sequel") accesses [RDBMS] instances. In principle, one uses the same SQL to interrogate and update [Oracle], [PostgreSQL], [SQLite], etc. ... databases. In practice however ... :( ---- I think SQL queries should ''look'' structured but tools like Microsoft Query make it very hard to read. So I wanted a program that I could cut and paste from the tool and as it pasted it would structure it, e.g. convert SELECT ORDERS.ORDERNUMBER, ORDERS.CUSTNUM, ORDERITEM.AMOUNT, PART.TYPE, PART.MODEL, PART.PRICE FROM VTHOMAS.ORDERITEM ORDERITEM, VTHOMAS.ORDERS ORDERS, VTHOMAS.PART PART WHERE ORDERS.ORDERNUMBER = ORDERITEM.ORDERNUM AND PART.PARTNUM = ORDERITEM.PARTNUM into SELECT ORDERS.ORDERNUMBER , ORDERS.CUSTNUM , ORDERITEM.AMOUNT , PART.TYPE , PART.MODEL , PART.PRICE FROM VTHOMAS.ORDERITEM ORDERITEM , VTHOMAS.ORDERS ORDERS , VTHOMAS.PART PART WHERE ORDERS.ORDERNUMBER = ORDERITEM.ORDERNUM and PART.PARTNUM = ORDERITEM.PARTNUM so here it is in Tcl package require Tk proc my_textPaste w { $w delete 1.0 end set txt [::tk::GetSelection $w CLIPBOARD] regsub -all {,} $txt "\n ," txt regsub -nocase -all {\sand\s} $txt "\n and " txt $w insert 1.0 $txt } text .t -width 80 -height 40 pack .t bind . <> {my_textPaste %W; break} A testament to the power of the text widget. Let me see, that many lines in Java? I'd still be putting a stream together. - Vincent Thomas ---- [Category Acronym] | [Category Database] | [Category Language]