# CONNX JDBC or SQL Gateway - Convert/Substring

**URL:** <https://techcommunity.softwareag.com/t/connx-jdbc-or-sql-gateway-convert-substring/172068>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-Add-on-Products, SQL-Access, Mainframe-Integration, CONNX\
**Created:** [July 26, 2013, 9:41pm UTC](https://techcommunity.softwareag.com/t/connx-jdbc-or-sql-gateway-convert-substring/172068 "2013-07-26T21:41:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Min\_Chai](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@Min\_Chai](https://techcommunity.softwareag.com/u/Min_Chai)\
**Post date:** [July 26, 2013, 9:41pm UTC](https://techcommunity.softwareag.com/t/connx-jdbc-or-sql-gateway-convert-substring/172068/1 "2013-07-26T21:41:02Z")

</div>

With a select statement that looks like this:

select i.case\_number as ‘caseNumber’  
, r.subject\_last\_name  
, r.subject\_first\_name  
, r.subject\_middle\_name  
, r.subject\_suffix  
from r\_report r, investigation i  
,table\_col tc1  
where  
i.case\_number = r.rkey\_case\_number  
and tc1.table\_col = 102  
and tc1.key\_col = i.investigative\_unit  
and convert  
(substring(convert(r.print\_hold\_date,char(8)),1,4) + ‘-’ +  
substring(convert(r.print\_hold\_date,char(8)),5,2) + ‘-’ +  
substring(convert(r.print\_hold\_date,char(8)),7,2), Date)  
between convert(‘2012-06-01’,Date) and  
timestampadd( SQL\_TSI\_DAY, convert( tc1.valu, integer), convert(‘2012-11-01’,Date))  
and r.report\_sid in (‘9045’,‘9046’,‘Y017’,‘D364’)

Who resolves the convert/substring function on the print\_hold\_date column? Is this criteria being processed by the CONNX JDBC Server or the SQL Gateway component on the mainframe?

Many thanks.

---

<div class="post-metadata">

**Author:** ![Larry\_McGhaw](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/larry_mcghaw/32/562_2.png) [@Larry\_McGhaw](https://techcommunity.softwareag.com/u/Larry_McGhaw)\
**Post date:** [July 26, 2013, 9:55pm UTC](https://techcommunity.softwareag.com/t/connx-jdbc-or-sql-gateway-convert-substring/172068/2 "2013-07-26T21:55:55Z")

</div>

I think your question is really whether this criteria is used in query optimization.  
You can determine this by running the query in Infonaut - and viewing the query plan.

I believe this query is a good candidate for some query optimization - I would recommend you open a support issue and we can assist you with this.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:29pm UTC](https://techcommunity.softwareag.com/t/connx-jdbc-or-sql-gateway-convert-substring/172068/3 "2021-04-02T15:29:13Z")

</div>


