QUESTION POSED ON: 10 February 2008 In a dynamic SQL statement embedded in an RPG program, is it possible to substring a character field on a join statement? One of the join files has two fields -- one is numeric 3.0 and the other is numeric 4.0. Is it possible to join that file with one that has matching data in a 7-byte character field?
>
EXPERT RESPONSE
Yes, the SQL join criteria can contain expressions such as the following: SUBSTR(1,3,T1Col1)=T2Col
You could define an SQL view with this substring expression to simplify the SQL that's coded into your application.
Search and Browse the Expert Answer Center Search and browse more than 25,000 question and
answer pairs from more than 250 TechTarget industry experts.
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.