Rob,
Thanks so much. I think this is going to be a good start to accomplish
what I want.
Mike
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Monday, March 23, 2009 3:55 PM
To: Midrange Systems Technical Discussion
Subject: Re: Selecting data between markers via SQL.
I reread it. I think it's going to be awfully tricky in SQL.
INSERT INTO QTEMP/MIKE VALUES('go &field& go') INSERT INTO QTEMP/MIKE
VALUES('go &a&, go &b&')
with t1 as(
select testchar,
locate('&',testchar) as start,
locate('&',testchar,locate('&',testchar)+1) as end from qtemp/mike where
posstr(testchar,'&')<>0) select testchar,
substr(testchar,start+1,end-start-1) as field from t1
....+....1....+....2....+....3..
TESTCHAR FIELD
t&st +++++++++++++++
go &field& go field
go &a&, go &b& a
******** End of data ********
and if you're not using a variable length text field but instead are
subfiling a bunch of 'line' rows you could have trouble with variables
that span rows like:
Listen &CNNAME&. You're a freaking deadbeat and you owe us %do llars%.
If you don't pay up by &DateDue& then big Louie is per sonally going to
rip off your %anatomy%.
Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
From:
rob@xxxxxxxxx
To:
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date:
03/23/2009 03:33 PM
Subject:
Re: Selecting data between markers via SQL.
Sent by:
midrange-l-bounces@xxxxxxxxxxxx
CREATE TABLE QTEMP/MIKE (TESTCHAR CHAR (15 ) NOT NULL WITH DEFAULT)
Table MIKE created in QTEMP.
INSERT INTO QTEMP/MIKE VALUES('test')
1 rows inserted in MIKE in QTEMP.
INSERT INTO QTEMP/MIKE VALUES('t%st')
1 rows inserted in MIKE in QTEMP.
INSERT INTO QTEMP/MIKE VALUES('t&st')
1 rows inserted in MIKE in QTEMP.
select testchar
from qtemp/mike
where posstr(testchar,'%')<>0
or posstr(testchar,'&')<>0
....+....1....+
TESTCHAR
t%st
t&st
******** End of data ********
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.