apex_json apex 5 question

I have a region where I produce some json like this: in the header I < div class = "json" >

DECLARE

C1 SYS_REFCURSOR;

BEGIN

OPEN C1 TO SELECT CODE, NAME OF ORGANISATIONELEMENT;

apex_json.initialize_clob_output;

apex_json.open_object;

apex_json. Write (C1);

apex_json.close_object;

HTP.p (apex_json.get_clob_output);

apex_json.free_output;

END;

$("div.json").html)

It gives me:

{

[

{

'CODE': 'CLASS '.

, 'NAME': 'class '.

}

,{

'CODE': 'DIV '.

, 'NAME': 'Division '.

}

,{

'CODE': 'DIR '.

, 'NAME': "Direction".

}

,{

'CODE': "DEPT".

, 'NAME': 'Department '.

}

,{

'CODE': 'WARD '.

, 'NAME': 'Ward '.

}

,{

'CODE': 'BLINK '.

, 'NAME': 'clinic '.

}

,{

'CODE': 'NURS.

, 'NAME': 'nursing care '.

}

]

}

However, var j = $.parseJSON ($("div.json").html ()) fails to parse with "unexpected token [' ]"

edhrx wrote:

I have a region where I produce some json like this: in the header, I

DECLARE

C1 SYS_REFCURSOR;

BEGIN

OPEN C1 TO SELECT CODE, NAME OF ORGANISATIONELEMENT;

apex_json.initialize_clob_output;

apex_json.open_object;

apex_json. Write (C1);

apex_json.close_object;

HTP.p (apex_json.get_clob_output);

apex_json.free_output;

END;

$("div.json").html)

It gives me:

{

[

{

'CODE': 'CLASS '.

, 'NAME': 'class '.

}

,{

'CODE': 'DIV '.

, 'NAME': 'Division '.

}

,{

'CODE': 'DIR '.

, 'NAME': "Direction".

}

,{

'CODE': "DEPT".

, 'NAME': 'Department '.

}

,{

'CODE': 'WARD '.

, 'NAME': 'Ward '.

}

,{

'CODE': 'BLINK '.

, 'NAME': 'clinic '.

}

,{

'CODE': 'NURS.

, 'NAME': 'nursing care '.

}

]

}

However, var j = $.parseJSON ($("div.json").html ()) fails to parse with "unexpected token [']"

Hi edhrx,

I view your code of jSon object and its object shows what ever you encounter is not well formatted json object:

Please, I've corrected your code as below:

{

'objectName': [

{

'CODE': 'CLASS ',.

'NAME': 'class '.

},

{

'CODE': 'DIV ',.

'NAME': 'Division '.

},

{

'CODE': "DIR,"

'NAME': "Direction".

},

{

'CODE': "DEPT"

'NAME': 'Department '.

},

{

'CODE': 'WARD ',.

'NAME': 'Ward '.

},

{

"CODE':"BLINK. "

'NAME': 'clinic '.

},

{

'CODE': 'NURS.

'NAME': 'nursing care '.

}

]

}

So each jSon object should have a name that I have highlighted in bold as 'objectName' after you first fathoms curly opened.

{

'objectName': [

{

(2) an alternative to create a json apex objectives use following code:

DECLARE

C1 SYS_REFCURSOR;

BEGIN

OPEN C1 TO SELECT EMPNO, ENAME, JOB - EMP;

apex_json.initialize_clob_output;

apex_json. Write (C1);

HTP.p (apex_json.get_clob_output);

apex_json.free_output;

END;

Changes in your code please lines "BOLD" comment as below:

DECLARE

C1 SYS_REFCURSOR;

BEGIN

OPEN C1 TO SELECT CODE, NAME OF ORGANISATIONELEMENT;

apex_json.initialize_clob_output;

-apex_json.open_object;

apex_json. Write (C1);

-apex_json.close_object;

HTP.p (apex_json.get_clob_output);

apex_json.free_output;

END;

Please check the two json object is json online editor: JSON Editor Online - view, edit and format JSON online

and check your json object to also get to know aswer.

You don't no need here to add there a code additional two line which "BOLD".

Concerning

Raj Beauvois

Tags: Database

Similar Questions

  • characterset apex listener questions

    Hello forum help,

    I have a problem with the character set when you use the earpiece of the apex and the database oracle under windows.

    My environment in the registry (HKLM/SOFTWARE/ORACLE/HOME) is NLS_LANG = GERMAN_GERMANY. WE8MSWIN1252

    My value in the database is:
    SQL > select aufgabe dhw.auftraege where auftragsnummer = 23;

    AUFGABE
    -----------------------------------------------------------------
    Turendrucker

    My desription of connector in tomcat's server.xml file is
    < connector port = "8080" protocol = "HTTP/1.1".
    connectionTimeout = "20000".
    maxHttpHeaderSize = '32767 '.
    URIEncoding = "UTF-8" / >

    Is my description of filter in the Web.XML of my apex installation (as described in another thread)
    < filter >
    Coding of characters defined < filter-name > < / filter-name >
    < class filter > filters. SetCharacterEncodingFilter < / class filter >
    < init-param >
    < param name - > encoding < / param-name >
    UTF8 < param-value > < / param-value >
    < / init-param >
    < / filter >
    < filter mapping >
    Coding of characters defined < filter-name > < / filter-name >
    < url-pattern > / * < / url-pattern >
    < / filter-mapping >

    But the result on the Web page is:
    T_rendr_cker (underscores value is initially a small square)

    How can I solve this problem?
    What character parameters will be valid to show the same data on the html page, as recorded in the database?

    Thanks for the reply!

    Concerning

    Frank

    Hi Frank,.

    you might want to ask the following question in the [url http://forums.oracle.com/forums/forum.jspa?forumID=858] Forum listener APEX.

    brgds,
    Peter

    -----
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • 3.2 APEX update questions

    Hi guys,.

    I need to do a review on the benefits of upgrading to 3.2 and hoped for clarification on a number of things. The functionality of the Forms provides no use to us, so the point is on the [security changes | http://www.oracle.com/technology/products/database/application_express/html/3.2_new_features.html].

    Declarative encrypt session state
    Declaratively specify wait times of session for the maximum idle time and the maximum duration of session
    What do these? That means declaratively they user MUST specify? Why are they useful? What were they like before?

    New element types create password that allow users to enter passwords without ever saving their session state - why is it useful? Saves the State of session a security problem? Why it would take up to 3.2 for it be changed then: o
    Reduce the footprint exposed by reducing the privileges required by the Oracle Application Express database account - does that mean? Foot print?
    Deactivation of the service of default data monitor - if this refers to the activity of users monitor etc then why is - this good? Looks extra hassle for the admins see what users do
    Allowing administrators to require HTTPS for administration and enforcement on development - administration and development suite applications?
    Service Administrator account passwords are consistent with a strong password policy - trying to cause me trouble when deciding on a password?

    Anyone know of any other addition in addition to what is mentioned here? for example new articles, reports, themes etc.

    Thanks for help.

    Mike

    Mike,

    Some of your comments seem a bit antagonistic such as "why it would take up to 3.2 for it be changed then: o ' and 'try to cause me trouble when deciding on a password?'. It is not the best way to get answers to the questions.

    Declarative encrypt session state

    For any element that can contain sensitive data, you can say APEX to encrypt it while it is stored in the tables of State meeting of the APEX. This prevents a sys_admin to query this table and entered these values. It also keeps them out of the redo log files, etc. However, you should always deal with encryption of sensitive data when you save to your tables.

    Declaratively specify wait times of session for the maximum idle time and the maximum duration of session

    You can change a parameter indicating the sessions expire after x minutes. Declarative means there are a graphical interface, do not do it in the code.

    Create item types that allow users to enter passwords without ever saving to session state new password

    Yes, saving it session state is a security problem as a system administrator may seek in the session state tables.

    Minimize the exposed footprint by reducing the privileges required by the Oracle Application Express database account

    APEX requires less privs to run to access schemas APEX gives a hacker less energy. Think of it as SYS vs SCOTT. If you broke into the SCOTT schema, there not much damage, that you could do. However, if you walked into SYS, you could do what you wanted to do in the database.

    Disabling the default data monitor function

    This isn't the user monitor section, this is a section that allows you to display the top sql, sessions, etc. Yes, it's more complicated. It's more of a hassle for me to lock my door when I leave, but I always do.

    Service administrator account passwords are consistent with a strong password policy - trying to cause me trouble when deciding on a password?

    Let me guess, your sys / system / root / admin password is one of the following values: sys, Manager, change_on_install, oracle, host, password, enter, root, qwerty, 12345? ;)

    Tyler Muth
    http://tylermuth.WordPress.com
    [Oracle security application: development of secure database and Middleware environments | http://www.amazon.com/gp/product/0071613706?ie=UTF8&tag=tylsblo-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=0071613706]
    ! http://www.Assoc-Amazon.com/e/IR?t=tylsblo-20&l=AS2&o=1&a=0071613706!

  • Apex SQL question - weeks of the month

    I have a sql question.
    I want to create a dynamic list.

    If the user select may2009, then I want a dynamic list of show

    04/27/2009-05/03/2009
    05/04/2009-05/10/2009
    05/11/2009-05/17/2009
    05/18/2009-05/24/2009
    05/25/2009-05/31/2009

    If the user selects Jun 2009, then the list will be
    06/01/2009-06/07/2009
    06/08/2009-06/14/2009
    06/15/2009-06/21/2009
    06/22/2009-06/28/2009
    06/29/2009-07/05/2009

    Thank you.

    Using this SQL statement, you can get this list:

    SELECT w_start || ' - ' || w_end d, w_start r
      FROM (SELECT     (week_start_list + (LEVEL - 1) * 7) + 1 w_start,
                       week_start_list + (LEVEL) * 7 w_end
                  FROM (SELECT TO_CHAR (TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                               'mm'
                                              ),
                                        'IW'
                                       ) week_begin,
                               TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                      'mm'
                                     ) m_begin,
                               TO_CHAR
                                  (TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'), 'mm'),
                                   'd'
                                  ) day_month_begin,
                               TO_CHAR
                                  (TRUNC (ADD_MONTHS (TO_DATE (:my_date,
                                                               'dd.mm.yyyy'
                                                              ),
                                                      1
                                                     ),
                                          'mm'
                                         ),
                                   'IW'
                                  ) week_end,
                               TRUNC (ADD_MONTHS (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                                  1
                                                 ),
                                      'mm'
                                     ) m_end,
                               TO_CHAR
                                  (TRUNC (ADD_MONTHS (TO_DATE (:my_date,
                                                               'dd.mm.yyyy'
                                                              ),
                                                      1
                                                     ),
                                          'mm'
                                         ),
                                   'd'
                                  ) day_month_end,
                                 TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                        'mm'
                                       )
                               - TO_NUMBER
                                          (TO_CHAR (TRUNC (TO_DATE (:my_date,
                                                                    'dd.mm.yyyy'
                                                                   ),
                                                           'mm'
                                                          ),
                                                    'd'
                                                   )
                                          ) week_start_list,
                                 TRUNC
                                    (ADD_MONTHS (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                                 1
                                                ),
                                     'mm'
                                    )
                               + TO_NUMBER
                                    (TO_CHAR
                                        (TRUNC
                                              (ADD_MONTHS (TO_DATE (:my_date,
                                                                    'dd.mm.yyyy'
                                                                   ),
                                                           1
                                                          ),
                                               'mm'
                                              ),
                                         'd'
                                        )
                                    )
                               - 1 week_end_list
                          FROM DUAL)
            CONNECT BY LEVEL <=
                          (SELECT   TO_NUMBER
                                       (TO_CHAR
                                           (TRUNC
                                               (ADD_MONTHS (TO_DATE (:my_date,
                                                                     'dd.mm.yyyy'
                                                                    ),
                                                            1
                                                           ),
                                                'mm'
                                               ),
                                            'IW'
                                           )
                                       )
                                  - TO_NUMBER
                                          (TO_CHAR (TRUNC (TO_DATE (:my_date,
                                                                    'dd.mm.yyyy'
                                                                   ),
                                                           'mm'
                                                          ),
                                                    'IW'
                                                   )
                                          )
                             FROM DUAL))
    

    It is a question of SQL and has nothing to do with the Apex.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • Apex Newbie question!  HTTP Server?

    I'm newbie at the APEX. I have a background, s/n, but no experience with Oracle applications.

    I respect your time and tried to find this info on the docs, but, honestly, can't find it. And I looked everywhere, metalink, otn, gogling. I thought I'd find on these forums a form any of the FAQ, but have not found the answer :-(

    I installed the oracle 11g for windows database on my laptop, and when you install APEX 3.2, it asks me to stop the http server and... :-)

    Now, I have a question about the Oracle HTTP server, which is supposed to be isntalled with 11g, rather than the accompanying CD, that exist no longers.

    First question. We have a http server which is used by oracle control EM database, correct? I don't see a service for her on the list of Services. Installation of teh apex application requires the http server start/stop. How do we proceed? AND where the binaries of the http server located? I did a search for apache and found under C:\app\oracle\product\11.1.0\db_1\perl\site\5.8.3\lib\Apache, but not binary here, or under the ORACLE_BASE\bin either.

    That set up for windows environment ORACLE_HTTPSERVER on a brand new installation of database 11g?

    Now I see that we can get from Server HTTP installation of BEA. I was trying to prevent APEX to use a level of web server here. For me, the beauty of the APEX is not having to manage the BEA, or any other level. Keep it simple, at least for the development and keep everything on the DB, just use the native HTTP server.

    It is therefore a VERY fundamental, but how do I do this? Worries me what I can and can't do with the native HTTP server or BEA later. I just want to get this site up and running so that I can start playing with it.

    Thank you

    Henrique

    Henrique

    Looks like you can simply use the PL/SQL gateway incorporated in the database so far, but all this information is available here:

    [http://download.oracle.com/docs/cd/E14373_01/install.32/e13366/overview.htm]

    See you soon

    Ben

  • APEX 5-question format calendar change

    Hello

    I created a calendar like this page.

    Is it possible to change this color of blue background to something else or just remove the bule color?

    My eyes hurt just too with this blue.

    JonDaegu-Oracle wrote:

    Hello

    I created a calendar like this page.

    Is it possible to change this color of blue background to something else or just remove the bule color?

    My eyes hurt just too with this blue.

    An explanation of how to display events in different colors using CSS classes is given in the online help for the region of Class CSS calendar attribute. Add a column to the query of calendar that determines the color of class for the event:

    SELECT ID,

    START_DATE,

    END_DATE,

    TASKNAME,

      case STATUS

    When 'open' then 'apex-cal-green.

    When "Pending" then "apex-cal-yellow".

    When 'Closed' then 'apex-cal-red '.

    When "pending" then "apex-cal-black.

    end as css_class,

    ASSIGNED_TO as supplemental_info

    PROJECTS

    and select it in the attribute of Class CSS region.

    Built-in support exists for the following classes/colors:

    • Apex-cal-black
    • Apex-cal-blue
    • Apex-cal-bluesky
    • Apex-cal-Brown
    • Apex-cal-cyan
    • Apex-cal-blue dark
    • Apex-cal-grey
    • Apex-cal-Green
    • Apex-cal-lime
    • Apex-cal-orange
    • Apex-cal-Red
    • Apex-cal-silver
    • Apex-cal-white
    • Apex-cal-yellow

    You can also create your own combinations of colors using custom classes and CSS.

  • APEX development question form

    Running Oracle 12 c, APEX 4.2.

    I need help building a page APEX, I call it APEXLoad.  I want to make a form with three items from the list, the second of which depends on the user's selection in the first and the third is based on the user's selection in the second.  that is, a selection process list cascading

    The tables of V_ are seen in the tablespace APEX pointing to tables in another local

    tablespace.

    Step 0

    Page APEXLoad erase objects from the three previous information of the list list.

    Step 1

    Have APEXLoad do this query:

    Select V_PROJECTS.NAME, V_PROJECTS. Project of V_PROJECTS;

    and fill the object first in the list on the page APEXLoad with the names obtained by instruction select

    The user selects a name and page APEXLoad gives the corresponding project for step 2 id1

    Step 2

    Have APEXLoad do this query:

    Select V_PROJECTITEMS.NAME, V_PROJECTITEM_ID in V_PROJECTITEMS

    where V_PROJECTITEMS. Project = id1;

    and fill the second list on the APEXLoad page with the names obtained by instruction select

    The user selects a ProjectItem.name and APEXLoad page sets corresponding to step 3 PROJECTITEM_ID id2

    Step 3

    Made page APEXLoad this query:

    Select V_DATASETS.NAME, V_DATASET_ID in V_DATASETS

    where V_DATASETS. PROJECTITEM_ID = id2;

    and fill out the third list on the APEXLoad page with the names obtained by instruction select

    The user selects a Datasets.name and the APEXLoad Page sets corresponding id3

    dataset_ID and starts the script:

    SEGYLOAD. LOADDATASET (P_DATASET_ID = > 'id3',)

    P_MODE = > 'INIT')

    So, I know not how implement selections cascade or how to start the script at the end.  Does anyone have a solution for this?

    Now, it seems to work. The key point is that Javascript triggers generated cascading LOV tampered with, Action of Page handling when the value changed: submit/redirect. (sory when I suggested above, I do not see in waterfall lov handling by APEX)

    I changed the following (I hope that I forgot something):

    P38_PROJ: waterfall lov parent element: no (as it is the select toplevel)

    P38_PROJ, P38_ITEM, P38_DSET:

    Action of the page when the modified value: no

    P38_ITEM

    Read only condition type: none, or the value of point IS ZERO (instead of is not null)

    P38_DSET:

    Source: P38_ITEM no sense. Should always be null, when the current session state is null. Or some significant failure.

  • APEX installation question

    try to install Oracle HTTP Server distributed with Oracle database 12 c in preparation for the installation of the APEX.  He asked me to locate the marvel.conf or dads.conf file... Maybe I do not remember how to use find, but I can't find them.  Can I get a pointer their?

    Hi "HustlingHare"

    (1) the 'marvel.conf' file applies only to Oracle Application Server 10 g.  I guess that you are not using that.

    (2) the location of the dads.conf file is specified to the: http://docs.oracle.com/cd/E37097_01/install.42/e35123/otn_install.htm#BHAFJJDA

    (3) if it is possible, could I recommend that you consider using Oracle Data Services REMAINS instead of mod_plsql?

    Joel

  • APEX install on Oracle DB 10.2.0.4.0 - APEX listener Question

    Hello. What version of Java is required to install the APEX listener?

    We currently have:

    version Java '1.4.2 '.
    Java (TM) 2 Runtime Environment, Standard Edition (version 1.4.2)
    Classic VM (build 1.4.2 J2RE 1.4.2 IBM AIX build ca142ifx-20050119 SR1 + 80507 + 81622 (JIT enabled: jitc))

    Hello

    You must be at least JDK 1.6.0_20. For more details, take a look at the Installation and development available in the downloaded package or [url http://download.oracle.com/otn/java/appexpress/1.1/docs/AELIG/E21058_01.pdf] here Guide.

    -Udo

  • Apex report question

    Hi All-

    I have a report that displays data in a column (IE).
    Time
    --------
    08:00
    08:10
    08:20
    ...


    All the way to 16:00 hours. Is there a way to encapsulate the exit on several columns in the html table? I want the output to look like this:

    08:00 08:40 10:00
    08:10 08:50 11:00
    08:20 09:00 12:00
    08:30 09:10

    Thank you in advance for your help!

    If this answers your question, please give points where you feel appropriate and mark the thread as closed, while others know it is closed...

    Thank you

    Tony Miller
    Webster, TX

  • Integration of JQUERY within APEX

    Hi everyone and happy Christmas...

    I have a problem with jquery in the apex. I searched in previous posts, but I can't reach to make it work...
    I'm under apex 3.2.1 on linux with the apex listener.

    I want to refresh a report, and I found that it was possible to do using jQuery (...). Trigger ('apexrefresh'). So I tried to declare jquery...
    I've downloaded jquery - http://jquery.com 1.8.3.js and downloaded as static files in the components shared with apex.

    Now, I'm trying to set the file in my section of javascript like this:

    < script src = "" #APP_IMAGES #jquery - 1.8.3.js "type =" text/javascript"> < / script >"
    ....
    < script type = "text/javascript" >
    updating of the regions affected by the change in point PXX_ID_OPERATION
    Alert("#APP_IMAGES#jQuery-1.8.3.min.js");
    Alert (apex.jQuery (.jQuery));
    < /script >

    In vain the javscript in the .jquery statement (apex.jQuery).
    What was my mistake? I am certainly quite wrong, but I have not found a clear tutorial on the internet. Thank you in advance for help.

    Kind regards...

    Since you are NOT at the APEX 4.x, maybe one of them will help you:
    http://c2anton.blogspot.com/2010/02/Apex-refresh-classic-report-region-AJAX.html
    this: http://www.oracle-and-apex.com/question-how-to-refresh-an-apex-sql-report-from-javascript/
    http://blog.warp11.nl/2011/04/Oracle-Apex-report-refresh-the-easy-way/

    Happy holidays!

    Tony Miller
    Ruckersville, WILL

  • Can't access table in another account of Apex

    Hello

    In the report of the Apex, I question a table in another schema account. I have even granted select access to it. Even Apex keeps complaining that the table does not exist. Thank you.

    1 error has occurred
    Query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the generic "columns" box below the source of the region without analysis. ORA-00942: table or view does not exist

    In apex, you must add the schema for schemas available that can use the workspace. Admin workspace can do...

    Thank you

    Tony Miller
    Webster, TX

    Time passes fast like the wind, but the flies from fruits such as bananas.

    If you answer this question, please mark the thread as closed and give points where won...

  • The APEX site map

    Hello

    I am trying to build a dynamic sitemap for a website in the apex, my question is: is possible to create a query to list all public pages?

    Thanks in advance!

    Carlos Pereira

    Carlos

    You can use the views of the APEX. Don't know what version of APEX of these points of view became available. I use APEX 3.0

    select a.application_id,  a.application_name,a.page_name,  a.page_requires_authentication
    from apex_application_pages a
    where page_requires_authentication='No';
    

    CITY

  • Create a Page item: stop and start the HTML Table presentation - location?

    Where is the "Create Item-> stop and start HTML Table Layout Page" located at? I can't find it.

    kilo1-1 wrote:
    Where the "create point Page--> stop and start HTML layout table" is located at? I can't find it.

    4.2 elements 'Stop and start in HTML table' are replaced by setting new Start grid in grid presentation properties of each element.

    (Please always indicate which version APEX your question relates to.)

  • need to trigger when updating a column then sysdate record on another column

    Hello
    Gurus

    I have a table named RTV_PLAN
    And it has two columns,
    FORCE_KEYIN_FLAG VARCHAR (2)
    DATE OF FORCE_KEYIN_DATE

    I want when FORCE_KEYIN_FLAG get a value
    Then FORCE_KEYIN_DATE save the sysdate

    Please kindly give help

    Thank you very much

    Saven

    Florian wrote:
    You can check out what they have another error?

    Relaxation compile? I don't see obvious syntax errors. If you get a compile error, see the error.
    What is the trigger that is supposed to do? It is impossible for anyone to tell you if your trigger does what you want it to do. You would have to tell us what it is supposed to do. Since you have the tables and the application of the APEX in question, you would have to tell us if it does not have what you want in some specific cases.

    Justin

Maybe you are looking for