---
title: "How to retrieve data with single quotes from Oracle database fields"
canonical: "https://support.appfire.com/space/SUPPORT/89141070/How%20to%20retrieve%20data%20with%20single%20quotes%20from%20Oracle%20database%20fields"
format: markdown
---
<span style="color: #000000">This article explains how to retrieve data that are in single quotes from the Oracle database using the </span>*<span style="color: #000000">Run Self-Service Reports</span>*<span style="color: #000000"> and the </span>*<span style="color: #000000">SQL for Confluence</span>*<span style="color: #000000"> apps.</span>

## <span style="color: #000000">Instructions</span>

<span style="color: #000000">First, you must ensure that the table you want data from has data with single quotes. You can perform the following steps to check the data of a specific table:</span>

1. <span style="color: #000000">Log in to your Confluence instance.</span>
2. <span style="color: #000000">Navigate to the required page and click</span>> Macro (inline-media-image)

.
3. <span style="color: #000000">Insert </span>*<span style="color: #000000">SQL Query</span>*<span style="color: #000000"> macro, click </span>**<span style="color: #000000">Edit</span>**<span style="color: #000000">, and enter a query as follows:</span>
4. Click **Save settings** and **P****<span style="color: #000000">ublish</span>**<span style="color: #000000"> the page. In this example, details from the </span>*<span style="color: #000000">customer</span>*<span style="color: #000000"> table is displayed on the page as:</span>  
> Macro (inline-media-image)

<span style="color: #000000">Now, to retrieve data with single quotes from a table on the relevant Confluence page, you can:</span>

1. <span style="color: #000000">Insert </span>*<span style="color: #000000">Run with a user form and parameters </span>*<span style="color: #000000">macro to build the form and click </span>**<span style="color: #000000">Edit </span>**<span style="color: #000000">to open the macro settings window.</span>  
> Macro (inline-media-image)
2. > Macro (anchor)

<span style="color: #000000">Enter the following details in the </span>*<span style="color: #000000">Field settings </span>*<span style="color: #000000">and </span>*<span style="color: #000000">Display settings</span>*<span style="color: #000000"> tabs:</span>  
> Macro (inline-media-image)

  
> Macro (inline-media-image)
3. <span style="color: #000000">Click </span>**<span style="color: #000000">Save settings</span>**<span style="color: #000000"> and </span>**<span style="color: #000000">Save </span>**<span style="color: #000000">the page. The form is displayed as follows:</span>  
> Macro (inline-media-image)
4. <span style="color: #000000">Edit the page, and then, edit the </span>*<span style="color: #000000">Run with a user form and parameters</span>*<span style="color: #000000"> macro. </span>
5. <span style="color: #000000">Insert an </span>*<span style="color: #000000">SQL Query </span>*<span style="color: #000000">macro inside the</span>*<span style="color: #000000"> Run </span>*<span style="color: #000000">macro and </span>**<span style="color: #000000">Edit</span>**<span style="color: #000000"> the macro.</span>  
> Macro (inline-media-image)
6. <span style="color: #000000">Select the </span>*<span style="color: #000000">Data source profile </span>*<span style="color: #000000">as</span>*<span style="color: #000000"> Oracle </span>*<span style="color: #000000">and enter the </span><span style="color: #000000">required</span><span style="color: #000000"> SQL statement </span><span style="color: #000000">based on the </span>*<span style="color: #000000">Field Key </span>*<span style="color: #000000">mentioned in </span>[<span style="color: #000000">step 2</span>](#HowtoretrievedatawithsinglequotesfromOracledatabasefields-Run_FieldKey)<span style="color: #000000">. In this example, the </span>*<span style="color: #000000">Field Key</span>*<span style="color: #000000"> used was </span>*<span style="color: #000000">num</span>*<span style="color: #000000">, and so, the following query is used:</span>  
> Macro (inline-media-image)
7. <span style="color: #000000">Click </span>**<span style="color: #000000">Save settings </span>**<span style="color: #000000">and</span>**<span style="color: #000000"> Publish </span>**<span style="color: #000000">the page</span>**<span style="color: #000000">.</span>**
8. <span style="color: #000000">Enter the values </span><span style="color: #000000">to be retrieved from the database</span><span style="color: #000000"> in the </span>*<span style="color: #000000">Data</span>*<span style="color: #000000"> field and click </span>**<span style="color: #000000">Run</span>**<span style="color: #000000">.</span>  
> Macro (inline-media-image)

<span style="color: #000000">In this example, the retrieved data is</span><span style="color: #000000"> displayed as follows</span><span style="color: #000000">:</span>

![image](media://8da8e623-5b97-46d2-a677-2df6aadc19c6)

> ℹ️ <span style="color: #000000">The queries and steps mentioned in this article also works with the MySQL database.</span>