pl/sql in the apex region

Hi all
Of sqlworkshop.
I created a view as

CREATE OR REPLACE STRENGTH SEEN IN THE VW_SUB_CL_ADD1
(select a.siteid, siteid, a.bpaadd_0 bpaadd_0, a.bpanum_0 bpanum_0,
-case when a.bpaaddlig_0 = "then '-' another a.bpaaddlig_0 end address1.
-case when a.bpaaddlig_1 = "then '-' another a.bpaaddlig_1 end address2.
-case when a.bpaaddlig_2 = "then '-' another a.bpaaddlig_2 end address3.
cases where a.bpades_0 = "then '-' other place of end of a.bpades_0,.
-case when a.cty_0 = "then '-' end of a.cty_0 to another city.
-case when a.poscod_0 = "then '-' on the other pin end a.poscod_0.
-case when b.cntnam_0 = "then '-' another b.cntnam_0 end contactname,.
-case when b.fax_0 = "then '-' another fax machine to end b.fax_0.
-case when b.MOBTEL_0 = "then '-' b.MOBTEL_0 other mobile end.
-case when b.TEL_0 = "then '-' phone on the other end b.TEL_0.
-case when b.web_0 = "then '-' other end b.web_0 site.
c.zinvcty_0 zcity, c.bpainv_0 bpainv_0, c.bpcnum_0 bpcnum_0
of lbcreport.bpaddress@info a,lbcreport.contact@info b, lbcreport.bpcustomer@info c
where (a.bpanum_0 = b.bpanum_0) and (a.cty_0 = c.zinvcty_0) and (a.siteid = c.siteid))

but when I run select * from vw_sub_cl_add1
the case does not work. '-' is not getting displayed null values even tried the nvl function it does not work

When I use this view at the Summit for the region of pl/sql to display as a table.
The problem is when there is no value in the columns of the table only shows no line and column in the proper manner.

could all help to overcome.
Thanks in advance
Good bye
Sonny_starck

Hi Sonny_starck,

Of your statement, it seems you want to retrieve data from an external data source? I had a similar problem: it's because of the driver ODBC do not recognize Null values correctly. In the end, I had to do something like:

...
case when xxx is null then '-' when xxx = ' ' then '-' when xxx = '' then '-' else xxx end xxxxx,
...

This happens especially with MS SQL databases and especially when their tables use char instead of varchar fields. The table MSSQL treats fields "empty" tank like NULL values, but the ODBC driver not - if the value IS NULL will not work on the side of Oracle and the "comparison will not always work on the side of MS SQL. This is why having to check for all the possibilities. The foregoing may be exaggerated, but it does the job!

Andy

Tags: Database

Similar Questions

  • Calling a function in the apex region

    Hello
    I want to call a function from a package in the region of Apex report, but he used to analysis
    I tested in sql dev successfully

    code example goes like this...

    SELECT DISTINCT SOR_OFFENDER. FIRST_NAME. » ' ||
    SOR_OFFENDER. MIDDLE_NAME | ' ' ||
    SOR_OFFENDER. Last_name like "Name",
    SOR_OFFENDER_DETAILS.get_offlu_url(:p216_detail) - package where the function is defined
    OF SOR_OFFENDER.
    SOR_LOCATION
    WHERE SOR_OFFENDER. OFFENDER_ID = SOR_LOCATION. OFFENDER_ID
    AND: p216_detail = SOR_LOCATION. OFFENDER_ID




    any idea/help

    Published by: Red_Bull on 8 August 2012 15:02

    I agree. Until and unless it is absolutely necessary avoid calling function in a select statement because it will degrade your performance of applications over a period of time.
    As far as I know if the query is run in SQLDeveloper, it should also work in the APEX.
    I see a syntax problem in your query. Try this.

    SELECT DISTINCT SOR_OFFENDER. FIRST_NAME. » ' ||
    SOR_OFFENDER. MIDDLE_NAME | ' ' ||
    SOR_OFFENDER. Last_name like "Name",
    SOR_OFFENDER_DETAILS.get_offlu_url(:p216_detail) url,
    OF SOR_OFFENDER.
    SOR_LOCATION
    WHERE SOR_OFFENDER. OFFENDER_ID = SOR_LOCATION. OFFENDER_ID
    AND: p216_detail = SOR_LOCATION. OFFENDER_ID

    Thank you
    Mehabub

  • How to display the pdf file in the apex region

    How to view pdf file in an apex html region. pdf files are stored in the column of type blob of a table. Please note this is not a static file. I am able to create a link to download and view the pdf in a new window. But it's not my priority. I need to see the full pdf file in the html area.

    I looked around the forums but couldn't find a good answer. All suggestions will be useful. Thank you

    Hi Alexandre-Oracle,

    Alexander-Oracle wrote:

    How to display the pdf file in an html apex region. PDF files are stored in the column of type blob of a table. Please note this is not a static file. I am able to create a link to download and view the pdf in a new window. But it's not my priority. I need to see the full pdf file in the html area.

    I looked around the forums but couldn't find a good answer. All suggestions will be useful. Thank you

    See the following thread I explained how to display PDF in the region HTML using the embed tag:

    Re: Display pdf

    I hope this helps!

    Kind regards

    Kiran

  • Question of Apex_Util.Prepare_URL due to the Apex Util advise msg

    Hello

    I have the following code in a SQL statement in an IRR:

    APEX_UTIL. PREPARE_URL (p_url = > ' f? p =' | v ('APP_ID') |) ': 398 :'|| v ('APP_SESSION'): ':NO:398:P398_IDOBJ. VIMG_SEARCH. IDOBJ:', p_checksum_type = > 'SESSION') FullImg,.

    And it works as expected. However when I run the Util Apex advise I get the following:
    Region Source attribute (identifies the source of the region, region Type of reference Source)
    Check the V function used in SQL statements
    Performance category
    Message contains V/NV/DV function call in the SQL statement (can be a performance issue).

    Do I need to worry about this? or should I change the syntaxt in the APEX_UTIL. PREPARE_URL settings?

    Thank you
    Daniel

    In SQL (PL/SQL within the APEX blocks) the notation of the bind variable must be used:

    APEX_UTIL.PREPARE_URL( p_url => 'f?p=' || :APP_ID || ':398:'||:APP_SESSION||'::NO:398:P398_IDOBJ:||VIMG_SEARCH.IDOBJ:', p_checksum_type => 'SESSION') FullImg,
    

    V (...) notation is intended for program units PL/SQL database called from APEX.

  • Is it possible to copy a part of a page from the APEX with a public procedure of APEX stored?

    The element is a grid view control and it ist does not part of each page.
    I copy the element of grid view several times. After that, I have to change a lot of settings in the copied grid views. Normally, I do this the APEX constructor GUID clicking over and clicking on...


    I would copy the perspective grid in a more comfortable way (means without clicking) in a stored procedure by calling procedures PL/SQL to the APEX (such as the GUID of the APEX Builder).


    There are all the public stored procedures to do?

    It would be preferable to this post in the forum of the APEX on OTN
    Steve

  • Search title of APEX region in text

    Is there a way to search on the APEX region titles in Oracle Text?

    Thank you
    John

    Hello
    Securities area accessed apex from the dictionary of the apex in this way:

    Select rated in apex_application_page_regions
    where application_id = ;

    If I remember correctly, you cannot build indexes full-text views, but you could probably created a materialized view based on the opinion of apex, although you will have to find a way to preserve synchronization. I'm afraid that the automatic only to do is to use a scheduled task because any other method triggers on internal tables from apex exposes you the problem of management of upgrades of the apex.
    Of course, to have the required privileges, you can even create a full text index on the inner table of the apex, but, once again, an upgrade of the apex would eliminate it.

    Anyway, maybe there is another workaround solution, that I can't think of right now.

    If you are looking for single keywords as I would go instead for a simple AS on the view from the top.

    Flavio

    --------------
    http://oraclequirks.blogspot.com

  • How to add data to the table changed in sql developer at Apex and vice versa

    Hello

    I had tables of database with sql developer. But now, I have modified the database (new tables added + changed the data in the tables). However, in the Apex, I the old database. Is it possible to get the new Apex database with the data of the table changed so this database in both places (sql and apex developer) is exactly the same... Also the other way around.

    Thank you

    The database schema that contains the tables, is it associated with the workspace even you are searching through the APEX product t development?  Why I'm asking is, if they are the same schema, the tables that you MODIFIED should be appear in the sql for APEX workshop part.  Now reports and forms will NOT see the changes (unless you have actually added or updated definitions for column).

    Can you explain what exactly you were doing the SQL Developer to the tables in your schema?

    Thank you

    Tony Miller
    Los Alamos, NM

  • The display of an image defined in an external PLSQL procedure that renders the code HTML and called in a region of the APEX

    I have an external PLSQL procedure that dynamically creates a report out of the HTML tags that I then called an anonymous block APEX PLSQL.  I'm making bad images with the following code:
    in the external procedure.  How do you get around that? (NOTE: the procedure is too big to store directly in the APEX)

    ....

    ' < style td = "width: auto;" "padding: 0px 5px 0px ' > '. spc_rec. SPC_VIABILITY_STATUS. "< table > ' |

    "< style td =" width: auto; " text-align: left; "padding: 0px 5px 0px" > ' | spc_rec. SPC_VIABILITY_REASON. "< table > ' |

    TD > < img src = "" #IMAGE_PREFIX #check2.gif "alt =" "/ > < table > '"

    ....

    Thanks in advance

    PaulP

    Hi Paul,.

    You can use the global variable of the APEX package below to get the image prefix in pl/sql. Of course, your procedure should be in APEX, schema analysis application.

    APEX_APPLICATION. G_IMAGE_PREFIX

    Kind regards

    Hari

  • Apex 5 - pl/sql, before the process of the header

    Hi all

    I have a PL/SQL process before header which read a table (with a key of the application element) and many elements of the page linked to the (authorized) db with a procedure in a package.

    In version 4.2, I could use page elements related to the column of the source table ' only when null... ", to place this items with PL/SQL, before that process the header and then submit them to update the db.

    Now in version 5, db binded items must have source "Always, replacing everything..", so how can I set this value points at a meeting with the process of pl/sql?

    I tried with the apex_util.set_session_state, but it does not work.

    Is there a way to do this without the need for dynamic action?

    Thanks in advance for your suggestions.

    Robi

    Hi Robi,

    Robi says:

    I have a PL/SQL process before header which read a table (with a key of the application element) and many elements of the page linked to the (authorized) db with a procedure in a package.

    Do you mean 'Automated line Fetch' process usually generated in the type wizard forms?

    In version 4.2, I could use page elements related to the column of the source table ' only when null... ", to place this items with PL/SQL, before that process the header and then submit them to update the db.

    Now in version 5, db binded items must have source "Always, replacing everything..", so how can I set this value points at a meeting with the process of pl/sql?

    I tried with the apex_util.set_session_state, but it does not work.

    Yes. It is newly introduced in Oracle APEX 5.0 forced a Page mapped to the DB column element should have used Source as "Always, replace the value that exists in the session state.

    You can change the Compatibility Mode of the APEX Application 4.2 to substitute the constraint.

    Reference: base Oracle: APEX 5 Source - attribute tolerates less mistakes

    Is there a way to do this without the need for dynamic action?

    If you want to stick to Oracle APEX 5.0 (and not to change the Compatibility Mode), then dynamic actions is the rest of the solution.

    Kind regards

    Kiran

  • Error ora-02019 in PL/SQL call in the apex, but not in a SQL Client

    Hello

    I encountered a strange problem. I have a process page type PL/SQL that runs on submit a form.

    This process calls a PL/SQL package function.

    When I run the PL/SQL Code from a SQL, for example SQL Navigator Client it works without problems.

    When trying to run from the APEX, it is always fails with the error:

    ORA-02019: description of the connection to the remote database not found

    It's the SAME code in both situations.

    It's the process code:

    DECLARE

    v_result INTEGER. v_result_msg VARCHAR2 (4000);

    v_ref_date DATE; v_reset INTEGER.

    BEGIN

    -Prepare the arguments

    v_ref_date: = TO_DATE (: P73_REFERENCE_DATE, ' DD/MM/YYYY');

    v_reset: =: P73_RESET;

    -Use the feature

    TRC.trc_jobs.xade_daily_job (v_ref_date, v_reset, v_result, v_result_msg);

    END;

    When I debug Apex I trace to the bottom of the error, in a job that makes a join with a table in a database link.

    It is the offending function:

    FUNCTION (p_series_name IN VARCHAR2, p_date AS get_series_cfi_code,

    p_date_active_flag in FULL)

    RETURN VARCHAR2

    IS

    v_cfi_code instrument_type.full_cfi_code@dl_herds%TYPE;

    CURSOR c_get_series_cfi_code IS

    SELECT it.full_cfi_code

    I, instrument_type@dl_herds INSTRUMENTS it

    WHERE i.series_name = p_series_name

    AND ((i.expiration_date = p_date AND p_date_active_flag = 0) OR)

    (i.expiration_date > = p_date AND p_date_active_flag = 1))

    AND i.product_id2 = it.id

    ORDER BY i.expiration_date;

    BEGIN

    OPEN c_get_series_cfi_code.

    SEEK c_get_series_cfi_code INTO v_cfi_code;

    CLOSE C_get_series_cfi_code;

    RETURN v_cfi_code;

    END get_series_cfi_code;

    No idea why this is happening?

    I think to reproduce the table locally to eliminate the use of dblink as a last resort.

    APEX Version: 4.2.4.00.08

    Database version: 12.1.0.1.0

    NLS: UTF - 8

    TIA,

    Dionisis

    Are you sure that the dblink is accessible from the scheme of the analysis of the application? Run the code in your sql client in the same pattern?

  • PL/SQL, used in application of the APEX of unit tests

    question by my client:

    I develop an Oracle Application Express application and work on unit tests for stored procedures in PL/SQL and the packages that are stored in the underlying database and used by the application of the APEX. These unit tests must run in the context of SQL Developer Unit Test.
    The problem is that the PL/SQL code stored in the database using functions such as NV('APPLICATION_ITEM') to access items in the application of the apex. They do return all values when I try to execute the PL/SQL within the unit test framework, that is to say in the backend. While it is good that the NV is not error, NULL haven't really work well in my scenario either (for example when the result of this function is inserted into a column NOT NULL in a table). I can think of a few workarounds, such as the creation of my own function NV within the schema to test return values desirable, but nothing seems a really satisfactory solution. I wonder if there is no recommendation to Oracle for this scenario - how can I run code that uses the APEX via backend-specific features. I found nothing in the documentation of the APEX for this but I would like to know if there is a recommendation how to better deal with this case.

    I use SQL Developer version 4.0.0.13.80

    Hello

    Indeed, you must set your PL/SQL function calls. This would be the cleanest solution.

    There is an alternative. Please see the following article on the creation of an APEX in PL/SQL session: Martin Giffy D'Souza on Oracle APEX: how to create a Session of the APEX in PL/SQL

    This approach allows to set the values of APEX application item before you run your unit tests. I don't know if it's possible in SQL Developer Unit Test, but it might get you further down the road.

    Good luck

    Nick

  • Execution of SQL queries based on user input in the text box on the page of the APEX

    Hello

    I am new to develop in the APEX, and I encountered a problem...

    It is even possible to do such a thing: use the text box to enter a SQL query and then run it on my schema and display the results in the report item? And if the answer is Yes, can someone give me advice on how to do this?

    Thanks in advance.

    In my example, the text is from a file in a text box. The report source is a function returning the SQL query:

    DECLARE
       v_query   VARCHAR2 (4000);
    BEGIN
    v_query := :p91_sql_query;
          RETURN v_query;
    END;
    

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    https://Apex.Oracle.com/pls/Apex/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • How to get the schema of the APEX by username in PL/SQL?

    Hey, guys:

    I have to write a PL/SQL procedure, which can become the apex (schema of the user) user group that we have defined by their Summit. I know I can get user account in reference to v (app_user), but I'm not familiar with the APEX API security management. is there a method to get the user APEX scheme providing the username as a parameter?

    Thank you.

    Sam

    lxiscas wrote:
    Hey, guys:

    I have to write a PL/SQL procedure, which can become the apex (schema of the user) user group that we have defined by their Summit. I know I can get user account in reference to v (app_user), but I'm not familiar with the APEX API security management. is there a method to get the user APEX scheme providing the username as a parameter?

    Thank you.

    Sam

    You can simply use APEX_UTIL. GET_GROUPS_USER_BELONGS_TO

  • How to hide the LOGO Apex region

    We use the apex of interactive reports that we want to integrate with a front-end web exist (window based). I want to hide the 'LOGO' region, as the end before the Wicket already takes care of the LOGO. How delete/hide the LOGO area.

    I suggest you open another thread for the other issue. You can close this thread if your question is answered.

  • Problem with LDAP in the APEX and not in sql query * more

    Hello everyone.

    Hereby, I refer to an existing thread: Query LDAP APEX

    I have a problem using LDAP in the APEX (DB version: 11.2.0.2.0;) APEX version: 4.0)

    I get "Authentication failed" by their SUMMIT. However, when I run it in SQL * more (SQL Developer) (I created it as seen in the referenced forum thread) it works! Can I use my own function, but that looks like reinventing the wheel.
        l_ldap_host := 'oursite.be';
        l_ldap_port := '389';
        l_ldap_domn := 'oursite';
        l_ldap_user := i_username;
        l_ldap_pass := i_pw;
        l_ldap_base := 'ou=oursite,dc=oursite,dc=be';
    
    
        dbms_ldap.use_exception := true;
        
        l_session  := dbms_ldap.init(l_ldap_host,l_ldap_port);
        l_retval   := dbms_ldap.simple_bind_s(l_session, l_ldap_domn||'\'||l_ldap_user, l_ldap_pass);    
        l_attrs(1) := 'name';
        l_attrs(2) := 'title';
        l_retval   := dbms_ldap.search_s(
                        l_session, 
                        l_ldap_base, 
                        dbms_ldap.scope_subtree, 
                        '(sAMAccountName='||l_ldap_user||')',
                        l_attrs,
                        0,
                        l_message
                      );
    
        l_retval := dbms_ldap.count_entries(l_session, l_message);
    We must search the sAMAccountName because that contains our login credentials (dennis.surname). The common name is just our full name (Dennis Surname)


    At the SUMMIT, I have these settings:

    * LDAP host: oursite.be
    * Port: 389
    Use SSL: No SSL
    Use exact DN: No.
    * String DN: ou = oursite, dc = oursite, dc = be
    * Search filter: sAMAccountName = % LDAP_USER %


    When I try to test it I get "Authentication failed" but I don't know why. It works very well in sql * more (in the the same pattern of course!) so I have really no idea what I'm doing wrong. In addition, the message comes instantly and sql * more it takes about a second to authenticate.

    I tried so many things! remove the 'or '. Connect with my name, change 'cn = % LDAP_USER %' filter, connect with dennis.surname and Dennis Surname, using exact DN,... and all the possible combinations of them... Nothing works.

    I can go further by using my own function, but I really want to use the settings of the APEX, because it's so much easier.

    Thanks in advance for help out me!
    Dennis

    Hi Dennis,

    Try this

    The exact use DN Yes value
    Change your DN string to

    %LDAP_USER%@domain
    

    or

    domain\%LDAP_USER%
    

    The authentication uses a simple_bind_s. You must use the same syntax in these text boxes. You actually do a single with bond

    dbms_ldap.simple_bind_s(l_session, 'sAMAccountName=' || l_ldap_user, l_ldap_pass);
    

    It does not work. It's the syntax to use in the search for search_s filter.

    Please keep in mind that the apex_040100 (for apex 4.1) user must connect the rights on the domain server.

Maybe you are looking for