Remote MCP Server to access an Oracle database in Claude on iOS

Image
Think of MCP ( Model Context Protocol ) as the universal adapter for AI assistants. Just like USB-C promised to connect any device to any port, MCP lets AI models connect to virtually any data source, application, or service through a standardized protocol. Whether it's a company database, a cloud service, or a local file system, MCP bridges the gap between AI and the tools you use. The buzz around MCP isn't just hype—it's solving a real problem. Until recently, getting AI to work with your specific data and workflows meant custom integrations, API wrangling, and a lot of developer headaches. MCP changes that by creating a common 'language' that AI models can use to communicate with external systems securely and efficiently. Although MCP is relatively new (created by Anthropic in November 2024), all major players are backing the protocol.  With developers rapidly building MCP servers for everything from databases to development tools, we're witnessing the birt...

Static Region Id's and Ajax Fun

More Online Store demo shenanigans for you. A bit dry this one I'm afraid.

A couple of days back I decided to export/import my Online Store demo, and whilst viewing the new imported version of the application found it to be completely kaput.  It didn't take long to realise that I had made the mistake of hard coding region id's in some of the Javascript.  Well, I thought this will be easy to fix as I can just utilise Static id's instead in my regions and in place of #REGION_ID# in templates.  So far, so good, but then I realised that the Ajax refreshing of the Products and Shopping Basket regions is done using calls to html_PPR_Report_Page and $a_report, and both these require the internal numeric region id as a parameter.  As far as I know neither recognises the Static id (please correct me if I am wrong).  Doh!

I get around this by creating hidden items (i.e. P1_PRODUCT_REGION_ID) based on a SQL query that uses the Static id to get the 'real' internal numeric ID. The following SQL does the job:

SELECT region_id
FROM   apex_application_page_regions
WHERE  static_id      = 'PRODUCTS_REP_REG'
AND    page_id        = v('APP_PAGE_ID')
AND    application_id = v('APP_ID');


All well and good I thought, but then I found another issue.  In the main Products region if the search is refined so that no rows are returned then instead of displaying the 'When No Data Found Message' wording from Report Attributes section it displayed the whole page embedded within the region.  Double Doh!

Again, it appears I had hard coded the internal region id into the 'When No Data Found Message' section, something like:

- No Products Found -

This had worked nicely in the orginal app from which the export came, as in lieu of a 'No Data Found' template, I simply copied the div and table tags that would appear if rows were returned in the Products region. But now it was useless. Therefore, I employed the following instead to fix the problem:
- No Products Found -

This simply embeds the value of the P1_PRODUCT_REGION_ID (the internal id of the product region) into the HTML. Voila. It works a treat, and no hard coding of id's in sight.

So, not a lot of visible progress on the store this week. Although, I have managed to make the site look similar and work the same way in IE, FF and Chrome.

Hopefully next week I can start to look at improving the look of the store. I also want to change the templates to be Div based as per the new APEX 4.0 theme.

Comments

Patrick Wolf said…
Hi Paul,

a quick tip. Always use bind variables in your SQL statement instead of the V function. Because that can have cause performance problems. Have a look at http://www.inside-oracle-apex.com/drop-in-replacement-for-v-and-nv-function/ for details.

Regards
Patrick
Paul Brookes said…
Thanks Patrick,

Good point!

Now updated to use bind variables instead.

Cheers,

Paul.

Popular posts from this blog

Visualising AI Embeddings in APEX

Remote MCP Server to access an Oracle database in Claude on iOS

Fun with Bubbles!