Re: [SQL] Doing a regexp-based search/replace?

2001-10-18 Thread Brett Schwarz
You could write a Tcl (i.e. pltcl) function, and use that to do what you want: CREATE FUNCTION remove(varchar) RETURNS varchar AS ' set input $1 regsub -- {-.*$} $input {} output return $output ' language 'pltcl'; [NOTE: untested] you may have to monkey with the reg

Re: [SQL] Holiday Calculations?

2001-09-19 Thread Brett Schwarz
I couldn't resist, so I went ahead and did all of them. I might be using these in a future app anyways. Again these are Tcl procs, but you may be able to transfer the logical to another language, if you want.  proc getTG {year} { set di \ [clock format [clock scan $year-11-30] -fo

Re: [SQL] Holiday Calculations?

2001-09-18 Thread Brett Schwarz
Based on your criteria (I never really had thought about Thanksgiving before, as far as when it hits), but here is a small Tcl proc that I think will do it. You may need to add error checking. Takes the year (i.e. 2001), and returns the day date (i.e. 22).

[SQL] Rules and transactions

2001-01-23 Thread Brett Schwarz
If I have a rule, is the rule inside a tranaction along with the table that it references. For example, if I have a rule that deletes an entry from table B, whenever an entry in table A gets deleted, then is the delete for table A and table B wrapped inside the same transaction? Same question I g

[SQL] FUNCTION returing multiple rows

2001-01-02 Thread Brett Schwarz
I have seen in the postings that it is not possible to return multiple rows from a function. However, when I look at the programmers guide (Ch. 4), it almost leads me to believe otherwise: -8<--- The following more interesting e