Hide results SQL - State of the button, see the

Hello
I use APEX 4.0 with Toad for Oracle 10.5. My problem is that I need to hide the delete button based on the results of the SQL statement. When the point: P43_DEPARTMENT_ID value is entered and there is for any field below, the data will appear along the line.
SELECT (SELECT distinct department_id
             FROM tbl_department
            WHERE department_id = :P43_DEPARTMENT_ID
            AND department_id IN (SELECT SUBSTR (division_id, 0, 5)
                                          FROM tbl_division))
            AS DIVISION, 
 (SELECT distinct department_id
             FROM tbl_department
            WHERE department_id = :P43_DEPARTMENT_ID
            AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
                                          FROM tbl_grant))
            AS GRANTS,     
 (SELECT distinct department_id
             FROM tbl_department
            WHERE department_id = :P43_DEPARTMENT_ID
            AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
                                          FROM tbl_allotment))
            AS ALLOTMENT,  
 (SELECT distinct department_id
             FROM tbl_department
            WHERE department_id = :P43_DEPARTMENT_ID
            AND department_id IN (SELECT department_id
                                          FROM tbl_department_temp))
            AS DEPARTMENT_TEMP,
 (SELECT distinct department_id
             FROM tbl_department
            WHERE department_id = :P43_DEPARTMENT_ID
            AND department_id IN (SELECT SUBSTR (division_id, 0, 5)
                                          FROM tbl_division_temp))
            AS DIVISION_TEMP, 
 (SELECT distinct department_id
             FROM tbl_department
            WHERE department_id = :P43_DEPARTMENT_ID
            AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
                                          FROM tbl_grant_temp))
            AS GRANT_TEMP,     
 (SELECT distinct department_id
             FROM tbl_department
            WHERE department_id = :P43_DEPARTMENT_ID
            AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
                                          FROM tbl_allotment_temp))
            AS ALLOTMENT_TEMP
FROM DUAL
But when no data appears that there is still a blank line for the fields. That will make the hidden Delete button. I don't know how to remove this row of the grid with my results of the select statement above. The State still thinks there is a line and a value (s) appear statement.
DIVISION OF | GRANTS | ALLOTMENT | DEPARTMENT_TEMP | DIVISION_TEMP | GRANT_TEMP | ALLOTMENT_TEMP
________|_______ |___________|__________________|_____________ |____________|_________________
Can someone help me with my select statement or provide me with advice on how to remove this blank line when there is no data? I can't create a view and then add a WHERE IS NOT NULL clause because of the variable binding: P43_DEPARTMENT_ID.

Do not know if I just got it, but what about:

SELECT SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (division_id, 0, 5)
OF tbl_division))
THE DIVISION,
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
OF tbl_grant))
FORM OF GRANTS,
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
OF tbl_allotment))
AS ASSIGNMENT,.
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT department_id
OF tbl_department_temp))
AS DEPARTMENT_TEMP,
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (division_id, 0, 5)
OF tbl_division_temp))
AS DIVISION_TEMP,
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
OF tbl_grant_temp))
AS GRANT_TEMP,
SELECT (separate department_id
OF tbl_department
WHERE department_id =: P43_DEPARTMENT_ID
AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
OF tbl_allotment_temp))
AS ALLOTMENT_TEMP
OF THE DOUBLE
LESS
SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL from double

This should ensure you don't receive a "no data found" when all the columns return null.

Tags: Database

Similar Questions

  • Pinning on SQl statement in the library cache

    Hello
    Do to pin frequently used SQL statement to the shared pool...

    I know that dbms_shared_pool.keep does the job for PL/SQL, but on simple SQL statements.

    Experts from the clues?

    Thank you

    King

    See more of scripts:

    -- Get address and hash_value of SQL statement
    select address, hash_value from v$sql where sql_text like 'your query to keep';
    ------------------------------------------------------------------------------------------------
     00000000858CA2B0      2239673969
    
    exec dbms_shared_pool.keep('00000000858CA2B0, 2239673969','C');
    

    I think you want to pin the SQL statement that is specific to the moment analysis of long abovid.
    I see no reason to pin the SQL more.

    Dion Cho

  • Is it possible to make the condition depending on the sql statements in the data models

    Hi all

    Is it possible to include the condition based on sql statements in the data models.

    For example
    if (some parameter is not null)
    <sqlstatement name="STATEMENT_1">
    ...
    </sqlstatement>
    else
    <sqlstatement name="STATEMENT_2">
    ...
    </sqlstatement>
    Is something like this? Also, the good doc is available for ' how to take full advantage of the "data models" in BI Publisher?

    Thank you
    -Sookie

    Hello Sookie,
    I couldn't find the time to get a data model of demonstration of work for you, but I'll try to explain.

    First, write a PL/SQL package. Make sure that you set all the parameters of model of data such as a global variable in the default PL/SQL package.

    CREATE OR REPLACE
    package as employee
    function BeforeReportTrigger return Boolean;
    query_text varchar (2000);
    number of p_DEPTNO;
    END;
    /

    CREATE OR REPLACE
    package as body employee
    function BeforeReportTrigger return Boolean IS
    Start

    IF (p_DEPTNO = 10) THEN
    query_text: = select col1, col2, col3 from HR.
    elsif (p_DEPTNO = 20) THEN
    query_text: = select col1, col2, col3 hr_history.
    on the other
    query_text: = select col1, col2, col3 hr_history1.
    end if;
    Returns true;
    end;
    /

    Use this package in the default package in your data model. Check the "defaultPackage ="employee"in the following data model header.

    Sample data model
    ------------------------------












    --
    --
    --
    --

    Before running the query SQL, data engine reads the "before the release of the report" and all the texte_requete argument based on the p_DeptNo value. When executing the Q1, engine sqlQuery analyze the query ' & quert_text and replace it with the actual value. For example if the p_deptno = 10, the query will be "select col1, col2, col3 from HR.

    Try it...

  • FDM generated SQL statement in the log file?


    Hello everyone, hopefully a simple question:

    When you perform an import using FDM, I know that behind the scenes of a SQL SELECT statement statement composed and performed on the database server. My question: the actual SQL statement is retained in a newspaper somewhere (so that we can see it?) In our case, it's an Oracle DB server and we use the ERPI adapter; not sure if it's relevant. We would like to enter this SQL statement and use it as a starting point for other things.

    Thanks in advance for anything you can offer.

    The statement SQL is not written in the journal of the adapter.  The only things that are registered are what show in the file card log if you enable loggin to the adapter source ERPi in action 'Get Data'.

  • SQL statement for the hierarchy of the Organization

    Nice day

    I was wondering if there is a script/sql statement that would generate the hierarchy of the Organization (similar to the organization hierarchy editor) in Oracle EBS HRMS 11.5.10

    Thank you
    Elmer

    I was wondering if there is a script/sql statement that would generate the hierarchy of the Organization (similar to the organization hierarchy editor) in Oracle EBS HRMS 11.5.10

    Please see if (how to extract HR organization hierarchies in SQL? [REF 463359.1]) help.

    Thank you
    Hussein

  • SQL statement for the materialized view?

    Can someone please tell me what SQL statement creates a materialized view?

    Syntactically, Yes. Otherwise Yes too (as long as you don't mind the Cartesian join with State B).
    Why not just try and see what happens?

    Concerning

    Etbin

  • Try to run a SQL statement through the window of OEM 12 c run SQL.  Statement fails

    All,

    I have a 11g database.  When it is initially installed, I installed it in $ORACLE_BASE = / orabin/app/oracle/product and $ORACLE_HOME = $ORACLE_BASE/11gDB_R2.  This is the version 11.2.0.1 to give birth to 11.2.0.3.

    Recently, I installed 11.2.0.4 in $ORACLE_BASE/11.2.0.4.  Then, I upgraded my database at 11.2.0.4.  Everything works fine.

    All my scripts on the linux host logon changed to point my environment at $ORACLE_BASE/11.2.0.4 House and my $PATH when I connect to the linux host is: /orabin/app/oracle/product/11.2.0.4/bin:/orabin/app/oracle/product/11.2.0.4/OPatch:/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin

    On my OEM Console, the database appears as 11.2.0.4 and me can manage very well.

    However, when I try to use the window of the OEM Console to execute SQL to execute any type of SQL statement, it fails.

    The failure error is:

    Could not launch/orabin/app/oracle/product/11gDB_R2/bin/sqlplus-s/nolog: no such file or directory

    It would be a mistake since the 11gDB_R2 directory tree (the 11.2.0.3 software) has been removed from the host, now that the database is set to level and working as 11.2.0.4.

    I wonder if somewhere in the OEM software, there is always a pointer to the old ORACLE_HOME?  I can't find anything in the .bashrc or other shell scripts that are executed when a Shell session on the host computer which were still the reference to the old directory of 11gDB_R2 so I'm a bit puzzled.

    I have 8 guests, and all have been improved in the same way at 11.2.0.4.  For some databases, the OEM window run SQL is executing the SQL code.

    Someone has some ideas on this?

    Go to the Configuration of the analysis of the database (when you set the password) and update of the Oracle home.   Also do this for all targets listener on this host as well.

  • SQL statement causes the database to hang

    Guys,

    a DBA told me that there is something wrong with this SQL statement and causes a blockage of database...

    Please check.

    SELECT field1 FROM table1 WHERE Field1 LIKE ' %% ' AND field2 = '123456' ORDER BY Field2 ASC

    Tell me, what is the problem with statement above. The LIKE operator is?

    Thanks for the help!

    Are not specifically related to your question, but having a clause such as ' where Field2 ='123456 "and then you place your order on Field2 is not really going to do much for you, all values will be identical!

    Carl

  • find sql_id using the sql statement, including the carriage return and tab...

    Hello. all.

    I wonder how to find sql_id using a sql statement, including transport retrun and tab space multiple.
    To be more precise,

    My sql is:

    Select
    col_a,
    col_b,
    ..
    ..

    I usually use the following query to find the sql_id

    Select sql_id in v$ sql where sql_text like 'MY SQL STATEMENT %.

    When MY SQL STATEMENT includes carriage return and tab space multiple, how can I do?

    Thanks in advance.
    Best regards.

    Hello

    Did you look at regular expressions? Use regexp_like instead of as.

    http://www.Stanford.edu/dept/ITSS/docs/Oracle/10G/server.101/b10759/conditions018.htm

    Kind regards

  • Logging has no SQL statements using the view system

    Hello

    We would like to improve our logging of errors of logging of sql statements failed.
    in other words, when a user does something in our system that generates a sql error.
    We want to connect to the corresponding sql statement.

    to do this, we need a way to get this statement by using a sql query.
    is there perhaps something like a point system with the sql statement failed where
    I can just go get the last being?

    would be very happy for some advice.

    Yes, you need to activate the first check. Checkout:

    http://www.Oracle-base.com/articles/10G/Auditing_10gR2.php
    http://www.tiplib.com/183/enable-auditing-Oracle-database

  • Esscaping Charaters in the SQL statement in the ASP.

    I have a SQL statement that inserts a line of text that contains ('), a single quotation mark. How to escape from this server so that it don't think it's the end of the string.

    SQLStr = "UPDATE TABLE SET field = ' this is my string to insert." It does not work because of the apostrophe ' WHERE Id = 31 "

    ASP/ACCESS

    Thank you
    Jeremy

    Put two consecutive ' instead.

    SQLStr = "UPDATE TABLE SET field = ' this is my string to insert." It "s not
    work because of the apostrophe ' WHERE Id = 31 "

  • How to execute the SQL statement in the Application Module

    Hi people
    I´d would like to know how I can execute a SQL statement like "remove user" in the Module to request... prepareSession method...
    I m using Jdev 10 with ADF Faces
    Thank you

    This is possible, but you should think twice about it.
    If this can be done with an EO/VO do in this way.
    If you can't do it with an EO/VO you can yourself the DB operation (ApplicationModule.getDBTransaction ()) and use a call of createStatement (...) do what you want.

    Timo

  • insufficient privileges when using dynamic sql statements in the procedure

    Hello
    I use following script on oracle 10g. and get the error not enough privs. Please advice.

    SQL > show user
    The user is 'GRSADM '.
    SQL > create or replace procedure grsadm.test_proc as
    a varchar2 (2000);
    Start
    a: =' VIEW to CREATE or REPLACE
    TEST_VIEW
    IN SELECT
    "FLAS" one
    THE DOUBLE ';
    immediately run one;
    end;
    Created procedure.
    SQL > start
    grsadm.test_proc;
    end;
    Start
    grsadm.test_proc;
    end;
    Error on line 16
    ORA-01031: insufficient privileges
    ORA-06512: at "GRSADM. TEST_PROC', line 9
    ORA-06512: at line 2

    SQL > select * from session_privs
    where the privilege as "VIEW %.

    PRIVILEGE
    ----------------------------------------
    CREATE A VIEW
    REMOVE ANY VIEW
    CREATE A MATERIALIZED VIEW
    MODIFY A MATERIALIZED VIEW
    REMOVE ANY MATERIALIZED VIEW


    5 selected lines.

    Published by: Rous Sharma on November 24, 2011 12:00

    GRSADM has a privilege ' CREATE (all) VIEW ' live?
    And not via a role...

    SSM
    Samir,
    GRSADM is the owner of this procedure, it seems that the EXECUTE priv, that you suggested is already involved.

  • How to execute the sql statement in the file beats?

    I want to execute after the statement
    C:\ > sqlplus/nolog
    SQL > conn scott/tiger
    SQL > select * from tab;

    I know I can achieve it following test.bat and testdb.sql file
    test.bat is:
    sqlplus/nolog @testdb.sql

    TestDB.SQL is:
    Conn scott/tiger
    Select * from tab;

    Now I don't want to use the sql file, I want only use bat file, as follows:
    test.bat is:
    sqlplus/nolog
    Conn scott/tiger
    Select * from tab;

    When I run test.bat, I find only one sqlplus /nolog execute statement, do not execute other statements.
    (1) I want to know if there is a method to run the SQL file by fighting without a sql file? How to make it happen?
    (2) if I call the sql file, how to hide the password of user? Because I don't want other people to know scott password, if I use conn scott/tiger in testdb.sql, other person can see testdb.sql and the password. Is there a good way to avoid?

    Thank you!

    It works a bit different in Windows. Create a file is like this:

    (
      echo conn scott/tiger@orcl
      echo spool c:\temp\list.txt
      echo select sysdate from dual;
      echo spool off
      echo exit
    ) | sqlplus -s -l /nolog
    
  • Can we use repository variables in the SQL statement of the guest of the column?

    Hi guys,.
    This is the query
    SELECT '-End Date '. " End year"OF"The consumer sector"WHERE ("-End Date "." ") End of year' = valueof (current_year)) or ("-End Date". "") (Year-end' = valueof (current_year) - 1).
    When you use this sql prompt of criteria being of error.
    Please suggest.

    Thanks.Sri

    Appreciate if you score as correct on the suggestion

    Also your old messages, at least let us know your comments ;)

Maybe you are looking for

  • Satellite A500-132 - games does not work on the mode full screen (Windows 7 64-bit)

    everything works fine... videos, applications... everything is very good...also, I downloaded all the drivers and all work fine...but when I installed a game and wanted to play, he began not as a large screen, there was a void balck space left and ri

  • Errors by using SIF data connect?

    I'm opening a FIS (somat informtaion file) file using the plugin of FIS data on the Web site of NOR.  It works great for files less than 1 GB.  When I try to open higher than 1 GB files I get the following error. Error: Access Violation Address of th

  • SD card reader no longer works

    Hey guys,.My 7 year old has a HP 7 1800. And a week ago it stopped reading the SD card. I thought that maybe she deleted or something, but I took it out and everything is always on the Samsung 8 GB card. So I didn't know if a restart/wipe would get t

  • Audio quality in Photo Story 3

    I use profiles customized Papa John's for Photo Story 3, it says the audio is supposed to be at 320 Kbps, but when the video is finally created the audio is very fixed, is it possible to improve the audio quality until it should be? I use it for vide

  • HP ENVY m7: deactivate Touchpad on ENVY m7 Notebook PC

    Keys to touch make me life extremely difficult. How to you turn off the touchpad on this computer? I tried looking for the answer. I do NOT have a 'Device settings' tab in the 'Mouse' on the control panel option. I went to the Device Manager and unin