Display a column in the SQL results as a link to an FTP site

One of the columns I am returning from a SQL query is an link to a file on a FTP server.  Is there a way I can make the results be a hyperlink to the file?  I am using the Bob Swift SQL add-on

2 answers

1 accepted

Easiest thing to do is use wiki notation and output=wiki for the field:

select '[link text|' || link_field || ']' ...

or 

select '[' || text_field || '|' || link_field || ']' ...

Hi!

I am using the described solution and it works fine but... the link text in my case is long and it dos not look so nice in my table.

My query:
select top 1 '[http://rem002/arsys/servlet/ViewFormServlet?form=HPD%3aHelp+Desk&server=REM001.politiet.master.net&eid=' + Entry_ID + ']' as test from sql008.arsystem.dbo.HPD_Help_Desk

My result:
http://rem002/arsys/servlet/ViewFormServlet?form=HPD%3aHelp+Desk&server=REM001.politiet.master.net&eid=INC000000002460

The result I would like to have:
INC000000002460

Is there a way to make the link shorter?

Yes, put in link text indicated in the answer. So something like: '[' || Entry_ID || '|' || ...

Finaly I got time to look at this again....

Thanks a lot for the feedback, I made some adjustment and now it works as expected.

Is there a easy way to force the link to open in a new window? I have been googling around found that a link can open a new window using javascript in a html-macro but I don' t see how I can use this together width the SQL-macro.

That seems a bit heavy handed, but you can use any macro for a column. Since you are already doing ouput=wiki, then the column would be like: 

select '{html} ... {html}' ...

 

 

Thanks a lot, this solved my problem smile

Gp Singh I'm New Here Feb 14, 2018

Hi...can you please share what you did....I have the same issue using hyperlink link in an SQL

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

101 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you