Transforming an SQL Query into JSON format using Oracle 11g in Oracle Application Express (APEX)

In my Oracle APEX v4.2 project, I am dealing with a sizable table containing about 40 columns and up to 50 rows. My goal is to use SQL to fetch the data from this table and convert each row into a JSON object.

Operating on Oracle 11gR2, I require this JSON object for JavaScript purposes, specifically to fulfill certain graphing needs.

Given that the varchar2(4000) limitation in Oracle SQL queries within APEX poses a challenge, how can I successfully convert all rows into JSON format? My desired outcome would be similar to the following example structure, which could then be utilized in JavaScript:

[{"col1": "value1", "col2": "value2", ....., "col40": "value40"}, {"col1": "value21", "col2": "value22", ....., "col40": "value400"}, etc]

Answer №1

I developed a function that dynamically generated my JSON object by utilizing a cursor, then passed it back to an Oracle APEX page item using varchar2(32767) in my pl/sql function.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The initialization of Firebase is not being completed before it is being called in other files

I am currently working on a vue project and I am attempting to integrate firebase. However, I have encountered an issue where my other JavaScript files like auth.js are utilizing firebase before it is properly initialized in my main.js file (which acts as ...

React.js - keeping old array intact while using array map

I am currently experiencing an issue where I have two arrays, and I need to map through one of the arrays when navigating the page. However, instead of replacing the old array with the new one, it is just keeping the old array and adding the new one. Here ...

I'm seeking assistance in understanding the malfunction of this particular function

I am struggling to create a basic function that is supposed to check whether a value is a number and not greater than 100. I'm confused as to why it's not working. Can someone explain if mixing jQuery and JavaScript is causing the issue? $(' ...

Tips for centering a div horizontally when it exceeds the width of a mobile screen

My challenge is to create a circular div element that is wider than the mobile screen and perfectly centered. This circular div needs to be an exact circle, specifically targeted for mobile screens. I've attempted to achieve this using the code in th ...

Disabling GPS with HTML5/phonegap: A step-by-step guide

Looking to create a function that can toggle GPS on and off for both iPhone and Android devices ...

Filtering data in AngularJS by parsing JSON records

I have a JSON file containing restaurant information and I need to display the data by grouping them based on their respective address fields. For example, all restaurants with the address 'Delhi' should be shown first, followed by those from &ap ...

Verifying a checkbox selection within an Autocomplete feature using MUI

[ { label: 'First', checked: false }, { label: 'Second', checked: true } ] Here is a brief example of how the data may be structured. I am utilizing Material UI's Autocomplete feature to enable searching based on labels. Thes ...

When it comes to the CSS `:visited` pseudo-class, I have

I'm having trouble changing the color of the anchor tag and blurring the image after visiting the link. Despite my CSS code, only the color is changing and the image remains unchanged. Here's my CSS code: <style> .image123{ paddin ...

Why is it that comparing the childNodes of two identical nodes results in false, while comparing their innerHTML yields true?

Currently, I am in the process of developing a simple function in Node.js that compares two DOMs. My goal is to not only identify any differences between them but also pinpoint the exact variance. Interestingly, upon reconstructing identical DOMs using jsd ...

Verifying the contents of a variable for a specified string in Python

I am working on processing data from the twitch API to determine whether a channel is live or not. Here is an example of how I'm doing it using a JSON list: import requests import json r = requests.get("http://some-api/api", params) rdata = r.json( ...

What is the best way to handle JSON parsing and writing in C++?

Can someone provide guidance on reading and writing a JSON file in C++? I am planning to use the file to store player information and settings for a simple number guessing game I'm developing. It's a basic console game, but it will help me learn ...

Identifying the precise image dimensions required by the browser

When using the picture tag with srcset, I can specify different image sources based on viewport widths. However, what I really need is to define image sources based on the actual width of the space the image occupies after the page has been rendered by th ...

Having trouble extracting JSON from the HTTP response?

Currently, I'm struggling to find a solution in order to properly extract and process the JSON data from . While my code has no issues decoding the JSON data retrieved from , it always returns empty or zero values when directed towards the CoinMarketC ...

What is happening with the arrangement of $scope in Angular 1.x?

In my controller, I am loading content using ajax and want a spinner to appear while it's loading. The code snippet is as follows: <i class="fa fa-2x fa-spin fa-spinner" ng-show="isLoadingContent"></i> Accompanied by the following JavaSc ...

the onreadystatechange function is not being triggered

When trying to call the show_Message function, I expected an alert box to appear. However, the onreadystatechange is not working as expected. All other alert boxes are functioning properly. Below is my JavaScript function: function send_Message(){ var ...

testing exceptions with Jest: a step-by-step guide

As a beginner with Jest, I am currently working on a program to delve deeper into JavaScript. While my tests are functioning properly, I'm wondering if it would be better to replace the try/catch blocks with exceptions. I feel like there might be a mo ...

Removing a row from a table seamlessly without the need to reload the page

I am having an issue with my page that displays a list of orders. When a user clicks on a button to delete a row from the table, it only removes the first row successfully. However, when attempting to delete the second or third row, it does not work. Can s ...

reveal.js: Upon a fresh installation, an error has been encountered: ReferenceError - 'navigator'

Currently, I am attempting to integrate reveal.js into my React.js/Next.js website using the instructions provided at However, upon implementation, I encountered the following error: Server Error ReferenceError: navigator is not defined This error occurr ...

When I try to post using the raw feature in Postman in Node.js, the post ends up empty

My API is supposed to receive data for saving in the database. However, when I call the PUT method, my req.body.nome returns empty. It works fine with form-urlencoded, but I've tried using body-parser and it's deprecated. Here is my request usin ...

Adjust the color of each list item depending on an array of strings

Within my perspective, I possess a collection of different statuses. <ul> <li>FIRST_STATUS</li> <li>SECOND_STATUS</li> <li>THIRD_STATUS</li> </ul> To continuously update the statuses in my contr ...