Book a Demo

Author Topic: Document Generation: Hyperlinks in Oracle DB  (Read 7486 times)

Andreas Morgenstern

  • EA User
  • **
  • Posts: 26
  • Karma: +1/-0
    • View Profile
Document Generation: Hyperlinks in Oracle DB
« on: December 13, 2016, 02:38:48 am »
Hi,

I'd like to insert hyperlinks into a custom sql fragment within the document generator but I fail
on an oracle DB. Did anyone use a custom sql fragment on a oracle database and can
tell me what todo?

Andreas


E.g.  I've tried the following SQL-fragment taken from Sparx EA Documentation:

Code: [Select]
SELECT t_object.ea_guid CONCAT t_object.Name

     AS [BaseClassName.Hyperlink]

     FROM t_object, t_connector

     WHERE t_connector.Start_Object_ID = #OBJECTID#

     AND t_object.Object_ID = t_connector.End_Object_ID

     AND t_connector.Connector_Type = 'Generalization'

Unfortunately, what I get is (translated from german):
Keyword FROM not found at expected place ...


philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Document Generation: Hyperlinks in Oracle DB
« Reply #1 on: December 13, 2016, 07:07:06 am »
Hi

Try the following

SELECT t_object.ea_guid CONCAT t_object.Name

     AS "BaseClassName.Hyperlink"

     FROM t_object, t_connector

     WHERE t_connector.Start_Object_ID = #OBJECTID#

     AND t_object.Object_ID = t_connector.End_Object_ID

     AND t_connector.Connector_Type = 'Generalization'

Phil
Models are great!
Correct models are even greater!

hd

  • EA Administrator
  • EA User
  • *****
  • Posts: 312
  • Karma: +0/-0
    • View Profile
Re: Document Generation: Hyperlinks in Oracle DB
« Reply #2 on: December 13, 2016, 07:42:03 am »
As well as replacing the square brackets with double quotes, CONCAT could also be the problem. Maybe ...
Code: [Select]
SELECT CONCAT(t_object.ea_guid, t_object.Name)or...
Code: [Select]
SELECT t_object.ea_guid || t_object.Nameor...
Code: [Select]
SELECT t_object.ea_guid, t_object.Name

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Document Generation: Hyperlinks in Oracle DB
« Reply #3 on: December 13, 2016, 09:00:16 am »
Version 13 can help with this, as it added an escape sequence to abstract out the database dependencies for concatenation for custom sql searches and fragments. The following should work for any DB we support.

#Concat t_object.ea_guid, t_object.Name#

PS. I've asked to get this included in the help.

Andreas Morgenstern

  • EA User
  • **
  • Posts: 26
  • Karma: +1/-0
    • View Profile
Re: Document Generation: Hyperlinks in Oracle DB
« Reply #4 on: December 14, 2016, 12:39:29 am »
Hi,

thanks for your help. It works. A minimal working example that just returns a hyperlink to the currently processed object is:

Code: [Select]
SELECT (CONCAT (t_object.ea_guid,t_object.Name)) AS "Name.Hyperlink"
FROM t_object
WHERE t_object.Object_ID = #OBJECTID#

Yours

Andreas