It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

SQL macro default, no results and formatting help

Eugene Domingo Oct 31, 2014

I'm using the SQL macro for inventory purposes.  I'm very new to database queries.  I pieced this together from examples and previous work by others.  I was going to use Play SQL but the dynamic user field has been removed on the Confluence pages.  I was looking into PocketQuery but I can't get the LIKE matching to work (question posted here as well).  I have three questions:

  1. I can't seem to figure out how to make the default values blank without the query being interpreted as a blank (waiting for user input).  So, I just put NULL in the field for now.
  2. If the query comes back with no results, it displays the query for some reason.  Is there a way to hide that and only display "The query has returned no data."?
  3. A third question but it's not too important.  My query below uses LIKE.  But if an exact match comes up, is there a way to highlight the value green? 


1 answer

0 votes
Davin Studer Community Leader Oct 31, 2014

Using LIKE '%NULL%' will not work. The way you work with NULLs is below ...


a.asset_description is NULL or i.itemnumber is NULL
Eugene Domingo Oct 31, 2014

The NULL is just an arbitrary value I placed in the value default. It's actually the string called "NULL" and not the value of NULL. Because I can't figure out how to allow SQL Macro to have a default value that is blank without an error, I just place the string "NULL" in the default value field.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

964 views 0 19
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you