Result of the query restriction based on the length of the field

Hello

I want to restrict the output of the query according to the length of a field (in fact, the length of the contents of a field).
Ex: only those records where the length of the data in a field is more than 20 characters.

Is it possible, can you give some advice on this subject...

Thank you

Hello

Example:

Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
Connected as hr

SQL> select to_date('16/8/2009 11:21:46','DD/MM/YYYY HH24:MI:SS') from dual;

TO_DATE('16/8/200911:21:46','D
------------------------------
16/08/2009 11:21:46

SQL> select first_name from employees where length(first_name) > 20;

FIRST_NAME
--------------------

SQL> select first_name from employees where length(first_name) > 10;

FIRST_NAME
--------------------
Christopher
Jose Manuel

SQL> 

Kind regards

Tags: Database

Similar Questions

  • search results in the item field.

    Hello, I just started apex...

    I created the report and the application form, and I want to make the search form... I want to display the search results in the fields of element of...
    How to do this?

    You should think about your ad before posting.

    1. you said that you need something like in my example

    2. Once you tell me that you do not use a LOV, but you tell me that you use

    3. you mentioned a task - what? When you describe your job?

    Help you first and others will be more than happy to help you.

    ;)

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

  • Result of the query based on the form of the parameter

    Good morning people. I really couldn't come up with a smart enough subject line, but I'll try and make up the body.

    I currently have a report that accepts parameters on the parameter form. They are extra employees and Number of Copies. The employee ID is stored in the Employee table, but the number of copies is not.

    The output of the report shows all the different addresses and phone numbers, the employee a. lets say, Employee ID 0001 has two addresses - home and office. In the report of my request, he'll give me two records in the repeating group. However, I have another parameter and the ID of the employee who is the number of Copies. In this case, if the number of Copies to be printed is 1, so it isn't a problem. However, if the Number of Copies is entered by the user is 4, I think in this case 4 x 2 = 8 pages of report output (4 with the address of the House) and 4 with the address of the office.

    I know there is a way to do this using a temporary table in AfterPForm and then using the results of the query by joining my request to the temporary table, but I was really hoping to avoid this situation if it can be treated through the query.

    Main request:
    SELECT    e.emp_no,
              e.saln||e.first_name||' '||e.last_name emp_name,
              a.street,
              a.city||' '||a.province||' '||a.postal_code city,
              '('||a.tel_area||') '||a.tel_number telephone
    FROM      employee e, emp_address a
    WHERE     e.emp_no = a.emp_no
    AND       e.emp_no = :P_EMP_NO;
    Any help is appreciated. Thank you!

    Hello

    Since you started a new thread in the forum SQL and PL/SQL {message identifier: = 10470358}, please mark this thread as "Answered" right away.

  • Query MySQL or the CF code to 'Flag' a group of results from a query based on a common value?

    I have the following query that examines customer accounts:

    SELECT    ACCOUNT_ID, SUBSCRIBER_ID, PKG_CODE    
    FROM   Accounts   
    WHERE  ACCOUNT_DESC LIKE '%Eye%'   
    GROUP BY  ACCOUNT_ID

    Gives me the following result...

     1. ACCOUNT_ID,  SUBSCRIBER_ID, PKG_CODE  
    2. ---------- -------------- -------   
    3. 11016869,    10016598,      N 
    4. 11015922,    10015713,      N 
    5. 11015062,    10014878,      N 
    6. 11018312,    10017973,      Y 
    7. 11018310,    10017973,      N 
    8. 11018309,    10017973,      N 
    9. 11018308,    10017973,      N

    Question: How can I display a '1' in a column of flag if 'someone' of the 'SUBSCRIBER_ID' have a "O" value in the PKG_CODE column?

    Here are the results of the query that I'm trying to do for this example (note that the last 4 reviews should be marked with a '1' because one of them had a 'Y' for PKG_CODE and SUBSCRIBER_ID correspondent...)

    1. ACCOUNT_ID, SUBSCRIBER_ID, PKG_CODE, FLAG
    2. ---------- -------------- ------- -----
    3. 11016869,10016598, N
    4. 11015922,10015713, N
    5. 11015062,10014878, N
    6. 11018312,10017973, Y, 1
    7. 11018310,10017973, N-1
    8. 11018309,10017973, N-1
    9. 11018308,10017973, N-1

    I tried the following, but it only reports the recordings of 'Y '? I need to check also the SUBSCRIBER_ID' column value...

    SELECT    ACCOUNT_ID, SUBSCRIBER_ID, PKG_CODE  
    , IF(PKG_CODE = 'Y', "Y", "N") AS FLAG   
    FROM   Accounts   
    WHERE  ACCOUNT_DESC LIKE '%Eye%'   
    GROUP BY  ACCOUNT_ID

    If this can be done on the page of the CF, which would work as well instead of in the query... I just need the Flagged values to display next to each record.

    SELECT ACCOUNT_ID, SUBSCRIBER_ID, PKG_CODE, IF(SUBSCRIBER_ID IN)

    (SELECT SUBSCRIBER_ID

    Accounts

    WHERE ACCOUNT_DESC LIKE '% eyes %' AND PKG_CODE = 'Y'), 1, 0) AS flag

    Accounts

    WHERE ACCOUNT_DESC LIKE '% % eyes '.

    ACCOUNT_ID GROUP

  • assign the value to a selection of the result of a query control

    I want to assign a value to my controls with the result of the query.

    It works for CFINPUT TEXT, but it does not work to SELECT

    I want to know are there any way tp affect my drop-down list value based on the result of questy.

    I have CFSTOREPROC as follows:

    < cfstoredproc procedure = "PSP" >

    < cfprocparam value = '#form. "IDNumber #" CFSQLTYPE = "cf_sql_integer" >

    < name cfprocresult = resultset "spResult" = "1" >

    < / cfstoredproc >

    < type CFINPUT = 'text' id = "txtIDNumber" value = "" #spResult.IDNumber # "/ >"

    I am able to name a TEXT of ENTRY CF as above the code value,

    < select id = "lstNumber" value = "#spResult.lstNumber #" > < / select >

    but it does not affect the value of my result of the query to SELECT entry.

    Is it possible to assign a value to the query result SELECTION control?

    I tried to use JavaScript that works if I pass a number, but it does not work if I pass a query result,

    Your help is very appreciated,

    Kind regards

    Iccsi,

    @Iccsi,

    My bad!  Yes, you will either need to the CFOUTPUT tag (that you commented out in your code) but without specifying a query or change the CFLOOP query CFOUTPUT = "Notes".  If one of these should work:

    OR

    -Carl V.

  • Select a table returned in the result of the query

    Hi, I'm trying to find a way to query a table name that I'm back to a different query. I am doing this in pure SQL and PL/SQL, if I can.

    Here's the situation. I have a table called FILES, a table called TYPE and an unknown number of different reference tables with different names.

    Each entry in the FILE has a reference to a TYPE id, and each entry type is a varchar that contains the name of a table reference, such as PHOTO_INFORMATION, PDF_INFORMATION or XML_INFORMATION.

    I want to be able to extract the data from the reference table for any data file. So with a file id, I question TYPE to get the name of the reference table (IE, "PHOTO_INFORMATION" back) then the request it is at this table for all of its columns, using the reference id in the FILE table.

    The thing is that I wish it were generic, so that I can just add an entry to AA_TYPE and a new table for this type, and then I can ask her but I want, through the FILE table. The reason is that there are some data that is common for all files, and I would like to that data in one place.

    Here is my paintings, I have two reference tables of the sample to the bottom "AA_FILETYPE1" and "AA_FILETYPE_PHOTO".
    CREATE TABLE  "AA_FILES" 
       (     "FILE_ID" NUMBER, 
         "FILE_NAME" VARCHAR2(4000), 
         "FILE_TYPE" NUMBER, 
         "REFERENCE_ID" NUMBER, 
          CONSTRAINT "AA_TEST_FILE_PK" PRIMARY KEY ("FILE_ID") ENABLE
       )
    /
    
    CREATE TABLE  "AA_TYPE" 
       (     "TYPE_ID" NUMBER NOT NULL ENABLE, 
         "REFERENCE_TABLE" VARCHAR2(4000), 
          CONSTRAINT "AA_TYPE_PK" PRIMARY KEY ("TYPE_ID") ENABLE
       )
    /
    
    CREATE TABLE  "AA_FILETYPE1" 
       (     "REFERENCE_ID" NUMBER, 
         "DATE_MODIFIED" DATE, 
         "SUMMARY" VARCHAR2(4000), 
         "TOTAL_VALUE" NUMBER(5,2), 
          CONSTRAINT "AA_FILETYPE1_PK" PRIMARY KEY ("REFERENCE_ID") ENABLE
       )
    /
    
    CREATE TABLE  "AA_FILETYPE_PHOTO" 
       (     "REFERENCE_ID" NUMBER NOT NULL ENABLE, 
         "DATE_TAKEN" DATE, 
         "CAMERA_NUMBER" VARCHAR2(4000), 
         "WEATHER_CONDITIONS" VARCHAR2(4000), 
         "CONSULTANT_NAME" VARCHAR2(4000), 
          CONSTRAINT "AA_FILETYPE_PHOTO_PK" PRIMARY KEY ("REFERENCE_ID") ENABLE
       )
    /
    Here's an example query I would use:
    select * from (select REFERENCE_TABLE from AA_TYPE where TYPE_ID = AA_FILES.FILE_TYPE) where REFERENCE_ID = AA_FILES.REFERENCE_ID;
    So who withdrew all the columns in the reference given in AA_TYPE table based on an entry in AA_FILES.

    I'm not entirely sure how to do this, or if this is possible even without using PL/SQL.

    I'm open to suggestions on how to achieve what I want with a different design of table, I am a student and I'm not really experienced in database design. (My first design of database class isn't until next year!)

    Thank you very much!

    Hello

    [email protected] wrote:
    Sorry about the confusion about file_id = 3, I meant the insert in the third I've included. I did not indicate the id_fichier in my inserts since it is the main key and it auto increments.

    It is important to post of the CREATE TABLE and INSERT statements that work. All those who want to help you to will want to recreate the problem and test solutions. Also, do not use strings for all entries. If the column is a NUMBER, use a NUMBER in the INSERT statement. If the column is a DATE, use a DATE or a function that returns a DATE.
    So you should post something like:

    insert into AA_FILES(FILE_ID, FILE_NAME, FILE_TYPE, REFERENCE_ID) values (1, 'test-photo-1.jpg',  1,  1);
    insert into AA_FILES(FILE_ID, FILE_NAME, FILE_TYPE, REFERENCE_ID) values (2, 'test-xml-1.jpg',    2,  2);
    insert into AA_FILES(FILE_ID, FILE_NAME, FILE_TYPE, REFERENCE_ID) values (3, 'test-photo-2.jpg',  1,  2);
    -- The value file_type=1 immediately above was not in your original data, but seems to be what you meant.
    
    prompt =====  AA_TYPE Table:  =====
    
    insert into AA_TYPE(TYPE_ID, REFERENCE_TABLE) values (1, 'AA_FILETYPE_PHOTO');
    insert into AA_TYPE(TYPE_ID, REFERENCE_TABLE) values (2, 'AA_FILETYPE1');
    
    prompt =====  AA_FILETYPE1 Table:  =====
    
    insert into AA_FILETYPE1 (REFERENCE_ID, DATE_MODIFIED,                 SUMMARY,                                    TOTAL_VALUE)
           values           (1,           TO_DATE ('01-01-02', 'MM-DD-RR'), 'An XML file that has some information about something', '14');
    
    prompt =====  AA_FILETYPE_PHOTO Table:  =====
    
    insert into AA_FILETYPE_PHOTO (REFERENCE_ID, DATE_TAKEN,                 CAMERA_NUMBER, WEATHER_CONDITIONS, CONSULTANT_NAME)
                    values            (1,          TO_DATE ('01-01-01', 'MM-DD/RR'), 'abc123',      'rainy!',         'John Smith');
    insert into AA_FILETYPE_PHOTO (REFERENCE_ID, DATE_TAKEN,                 CAMERA_NUMBER, WEATHER_CONDITIONS, CONSULTANT_NAME)
                    values            (2,          TO_DATE ('01-01-02', 'MM-DD/RR'), 'def456',      'slightly cloudy',  'Jane Jones');
    commit;
    

    To give you my workplace, I'm applying in Application Express. A user has entered the number '3' the file_id (I'm not worried about the distinction between passing in the id_fichier and the name of the file, I just my application one application or the other).

    Now, run a query that will get related data which table it is stored in. I don't know the name of the table at design time, as that particular file may be of any type (each of which has a different table name). However, with a the file_id, I have a file_type (in aa_files) which refers to an entry in aa_type.

    I see. You could add even add new tables after this query is written. As long as the new table has a column named reference_id, and there is a line for the new table in aa_files, the following query should work.

    >

    select FILE_TYPE
    from AA_FILES
    where FILE_ID = 3
    

    I stored the name of the table, I need to ask for the rest of the data in aa_type at design time, so using the file_type value, I can get the name of reference_table:

    select REFERENCE_TABLE from AA_TYPE where FILE_TYPE = 1
    

    In the sample data, you have validated, Type_de_fichier = 2 on the 3rd row. I've changed that in my example 1 revised data.
    Be very careful that your explanation fits your data. You talk to people who know about your application, and it is very easy for them to be induced in error or confusion.

    Now the '1' is here that the first query would return. I would like to use a subquery to combine these two queries into a single (I think?). This second query would return "AA_FILETYPE_PHOTO", which is the reference table.

    So I have the reference table, which is a name of table to another table in my database. It contains the data that I'm actually looking for. I want it for this particular file (file_id 3), and in aa_files, I have a value of "reference_id", which refers to the respective line in the reference table. File_id 3, the reference_id is 2.

    select * from AA_FILETYPE_PHOTO
    where reference_id = 2
    

    If the above query gets me my final data.

    Now, I've been watching substitution values and bind variables, here's another way to explain what I want:

    Explanation step by step below is very useful. It would be more useful if each step uniquely and gavce movement results given the sample data and an example of setting (3 in this case)

    -- get the file_type from aa_files for the desired file
    EXEC :file_type := (select file_type from aa_files where file_id = 3);
    

    That we will call the step step (a) above.
    Step (a) sets: Type_de_fichier 1 (given my corrected sample data)

    -- get the reference table from aa_types using the file_type
    EXEC :reference_table := (select reference_table from aa_type where type_id = :file_type);
    

    That we will call the step step (b) above.
    (B) sets the stage: reference_table to 'AA_FILETYPE_PHOTO '.

    -- get the reference_id from aa_files for the desired file
    EXEC :reference_id := (select reference_id from aa_files where file_id = 3);
    

    That we will call the step step (c) above.
    (C) sets the stage: reference_id 2

    -- using the reference table and reference id for the desired file, get the rest of the data
    select * from :reference_table where reference_id = :reference_id;
    

    Not sure if this makes it more clear or not.

    Yes, it helps a lot.

    Basically I have a table full of table names. How do I write a query that pulls one of these table names and it then queries?

    You need SQL dynamic, because you can't hardcode a table name in the query that you normally would be.
    How dynamic SQL works normally (and the functioning of this example) are that the query is built by using a variable. In SQL * more (as shown below), you can simply use a variable substitution instead an identifier hardcoded, and that's what it takes to make the dynamic query from SQL * more resolves the substitution variables before sending the code for the compiler. I don't know much on the Apex, but I bet there's some way to do dynamic SQL in the Apex, too.
    So the dynamic part here should include step d, since you can't hardcode the name of the table in the query.
    Until we can step (d), then, did they to us to do the steps (a) and (b) to obtain this file name. In the example blelow, I used a separate, preliminary request to get the & table_name...
    Step (c) could be made in the main query, using a subquery or a join. However, I chose to step (c) in the preliminary motion, as well as steps (a) and (b), since it's the same table same step (a). In this way, step (d) must refer to a table.

    Here's (finally) how to make this work in SQL * more:

    ACCEPT     file_id     PROMPT     "Enter the file_id (a number, e.g. 3): "
    
    -- Preliminary Query, to set table_name
    
    COLUMN     reference_id_col     NEW_VALUE     reference_id
    COLUMN     table_name_col           NEW_VALUE     table_name
    
    SELECT  f.reference_id          AS reference_id_col
    ,     t.reference_table       AS table_name_col
    FROM      aa_files     f
    JOIN     aa_type          t     ON     f.file_type     = t.type_id
    WHERE     f.file_id     = &file_id
    ;
    
    --     Main Query
    
    SELECT  *
    FROM     &table_name
    WHERE      reference_id     = &reference_id
    ;
    

    The results, account required to the data from the sample I posted above, and the & file_id 3, are:

    `                      CAMERA_    WEATHER_        CONSULTANT_
    REFERENCE_ID DATE_TAKE NUMBER     CONDITIONS      NAME
    ------------ --------- ---------- --------------- ---------------
               2 01-JAN-02 def456     slightly cloudy Jane Jones
    
  • Need to print the results of a query in a CASE statement

    I want to print the results of a query in a CASE statement:

    SELECT RUN_STATUS

    Of

    (select check BOX WHEN COUNT (ROW_WID) = 0 THEN 'NO JOBS RAN AFTER' |) (select sysdate - XXAFL_MINUTES MINUTE)

    END RUN_STATUS

    of W_ETL_RUN_SDTL

    where START_TS >

    (sélectionnez sysdate-MINUTES de XXAFL_MINUTES)) where RUN_STATUS is not null; e

    The query above subtracted 5 minutes from SYSDATE and he shoots XXAFL_MINUTES. I am doing this because we could change the number of minutes in the future. I want to print the number of minutes in the case statement.

    If I execute this statement, it throws an error stating:

    ORA-00937: not a single group group function

    00937 00000 - 'not a single-group function.

    * Cause:

    * Action:

    Error on line: 1 column: 96

    How can I include "select sysdate - MINUTES of XXAFL_MINUTES" in the CASE that it calculates the number of minutes and it prints with the results.

    Thanks in advance!

    Hey guys,.

    I found the solution:

    SELECT

    RUN_STATUS | TO_CHAR ((sélectionnez sysdate-MINUTES de XXAFL_MINUTES), 'HH24:MI:SS')

    Of

    (select check BOX WHEN COUNT (ROW_WID) = 0

    THEN "NO JOB RAN.

    END RUN_STATUS

    of W_ETL_RUN_SDTL

    where

    START_TS > (select sysdate - XXAFL_MINUTES MINUTE))

    where

    RUN_STATUS is not null;

    The output:

    NO JOBS RAN AFTER 09:07:54

    Thanks to you all!

  • Can we make several Off features in a collection of panels and how the query-off based on the example?

    Mr President.

    Can we make several Off features in a collection of panels and how the query-off based on the example?

    Concerning

    Once again, no jdev version?

    It must be really hard to remember ehich version you are working.

    Would have given a quick glance in the docs

    featuresOff java.util.Set Yes a list separated by spaces of the features by default to disable to the panelCollection. Values supported are

    That is the answer to a message.

    The second answer is that qbe is filtering tables. If you fund the table without filter you have not the qbe.

    Timo

  • How to call a taskflow based on results from the drop-down list. ?

    Hello

    I want to call a taskflow based on the results of the drop-down list, I have a drop down list with LOV, if I choose a value insofar as it must call the taskflow are entrusted to him. How to do this. ?. How to assign a taskflow for all values and how to call it. Someone please help...

    Page:

    http://Java.Sun.com/JSP/page"version ="2.1 ".

    xmlns:af ="http://xmlns.oracle.com/adf/faces/rich" >. "

    valuePassThru = 'true '.

    valueChangeListener = "#{SelectBean.onSelection}" > "

    Main.XML (TaskFlow);

    http://xmlns.Oracle.com/ADF/controller"version ="1.2">

    Choose

    Choose.JSFF

    /Web-INF/FirstTF.XML

    FirstTF

    /Web-INF/SecondTaskFlow.XML

    SecondTaskFlow

    Choose

    First

    FirstTF

    Second

    SecondTaskFlow

    Code VlaueChange Listner already told you.

    First and second pages only contain output text component in my example. I think that is not necessary

    Concerning

    Vincent

  • ORA-06504: PL/SQL: return variables of the game results or the query types do not match

    Hello!

    I have a simple object type and a proecdure in which I am trying to use it to insert into another table

    -object

    CREATE ORREPLACETYPEmt_mtg ASOBJECT

    (

    ACOL NUMBER ,

    BCOL NVARCHAR2 (100)

    );

    CREATE ORREPLACETYPEREF_MTG ASTABLEOFMt_MTG ;

    -same structure as the use of sampletbl target table in the cursor query

    create table tbl_MT_MTG

    (

    ACOL NUMBER ,

    BCOL NVARCHAR2 (100)

    );

    -procedure

    CREATE ORREPLACEINTERIORTEST_PROCEDURE1

    AS

    ref_cur sys_refcursor ;

    REFR ref_mtg ;

    BEGIN

    OPEN ref_cur FOR

    Select acol,

    BCOL

    DE sampletbl rownum<10;

    Fetch ref_cur in bulk collectintorefr;

    Insert intotbl_MT_MTG(acol,bcol)selectacol,bcol fromtable(refr);

    commit;

    CLOSE Ref_cur;

    END;

    /

    When I run this procedure fails with

    ORA-06504: PL/SQL: return variables of the game results or the query types do not match

    ORA-06512: at "TEST_PROCEDURE1", line 10

    ORA-06512: at line 2

    Any help on this please...

    Thanks to an OLD POST below

    so perfect helped me! Thank you

    Tubby

    After 5 years of more :-)

    How to store refcursor in collection How to store refcursor in collection

  • PLSQL function to return the result of the query

    Dear all,

    Oracle Database SE1 11.2.0.1

    I need to create a plsql function which should accept SQL as a parameter, execute it and return the result set.

    Is this possible?

    Madhu.149 wrote:

    I need to create a plsql function which should accept SQL as a parameter, execute it and return the result set.

    Be careful - results games indicate a set of data stored in memory. This is not what are sliders. This isn't how Oracle should be used.

    Imagine that you implement such a result set function - which, on average, requires 1 MB of memory (private server) to store the results of the SQL query. A 100 users mean a 100 MB of memory required server. This is not suitable. Not at all. Never.

    The correct back 'thing' is a handle to SQL cursor (called a ref cursor in this case). A SQL cursor is a "program" - that the appellant runs via the fetch command and generates one or more lines accordingly. Appellant repeatedly runs this slider through calls to fetch until this slider found and returns all rows affected (using consistent readings).

    If you want an abstraction interface that the client can call via PL/SQL code in the database, so this crafting optimal SQL interface, creates the SQL cursor and returns the handle of the cursor (via the ref cursor data type) to the client.

  • Procedure to export the result of the query to an excel or csv

    Hi all

    I have two identical paintings

    EMP_TEST OF THE EMP

    ID ID NAME

    1     SAM                      1        SAM

    2 JOHN 2 ROCK

    3 3 STEVE BRAND

    I need to combine the result under the query and intent to export data to excel using a procedure

    my query is

    Select 'EMP_ID', E1. EMP_ID, AND. EMP_ID from emp E1,

    emp_test AND WHERE E1. EMP_ID = AND. EMP_ID

    UNION

    Select "EMP_NAME", E1. EMP_NAME, AND. Emp E1 EMP_NAME,

    emp_test AND WHERE E1. EMP_ID = AND. EMP_ID

    but I get this error message

    ORA-01790: expression must have same type of corresponding data

    EMP_ID is a number and EMP_NAME is of type varchar.

    I need any idea or suggestion on sub queries.

    (1) I have to combine the result set in a single query.

    (2) I need to write the procedure that will export the result of the query to an excel or csv.

    Thank you.

    As PR has said, there are ways that have already been explained in this forum to write in external files. For your query condition, try this.

    SELECT CASE WHEN (REGEXP_LIKE (T1.ID,'[^ [: alpha:]] "")) THEN 'EMP_ID '.

    ELSE "EMP_NAME' END AS COL_NAME.

    T1.ID,

    T2.ID

    DE)

    SELECT CASE WHEN ID IS NULL THEN NAME ANOTHER TO_CHAR (ID) END AS ID,

    ROW_NUMBER () OVER(ORDER BY RN NULLS FIRST,ID) RN

    DE)

    SELECT ID, NULL,

    NAME,

    RN ID

    FROM EMP

    UNION ALL

    SELECT ID,

    NAME,

    RN NULL

    FROM EMP)) T1.

    (SELECT CASE WHEN ID IS NULL THEN NAME ANOTHER TO_CHAR (ID) END AS ID,)

    ROW_NUMBER () OVER(ORDER BY RN NULLS FIRST,ID) RN

    DE)

    SELECT ID, NULL,

    NAME,

    RN ID

    OF EMP_TEST

    UNION ALL

    SELECT ID,

    NAME,

    RN NULL

    OF EMP_TEST)) T2

    WHERE T1. RN = T2. RN;

    OUTPUT:

    COLUMN-NAME ID ID
    --------  ---------------
    1 1 EMP_ID
    2 2 EMP_ID
    3 3 EMP_ID
    SAM EMP_NAME MARK
    EMP_NAME JOHN JOHN
    EMP_NAME STEVE DARREN

    6 selected lines.

  • Is it possible to put the results of a query in a variable to use in the bean class?

    Hello, I am using JDeveloper 12.1.2.0.0

    I like to keep the result of my queries (the method that I created in the AppModule) in a richeTableau or another type of variable, so I can get results and I don't have to make unnecessary after queries. I don't think that the query is the problem but keeping the results.

    I tried to do in using this:

    public String testVFactSales (String conditions) {}

    PreparedStatement query = getDBTransaction () .createPreparedStatement ("" + "select * from v_fact_sales"+ conditions, 0 ");

    ResultSet rs;

    Outcome of the result set;

    Result of the richeTableau;

    String result = null;

    try {}

    query.setString (1, conditions);

    Query.Execute ();

    Query.Execute ();

    result = query.getGeneratedKeys ();

    Query.Close ();

    System.out.println ("result:" + result.toString ());

    return result.toString ();

    } catch (SQLException e) {}

    e.printStackTrace ();

    }

    Return ' ';

    }

    As you can see, I have already tried a few solutions, but so far I have only errors (cannot convert or null exception, when I try to put the result in a richeTableau in my bean class)

    Any ideas?

    It is very important for me, because it would improve the performance of my project a lot.

    Kind regards

    Frederico.

    Although the issue is not 100% responded, I used the idea that Shay told me, where you can create a method in your AppModule to set your where clause!

    Good luck to everyone who has the same problem.

    As an attack similar to what I wanted in the first place, you can check this:

    https://community.Oracle.com/thread/2619669

    Kind regards

    Frederico.

  • 4.0 ai2 - automatic adjustment does not properly in the result of the query grid

    Hello

    in 4.0 ai2 automatic adjustment does not work in the result of the query grid.

    Rather than shrink the columns to the narrower size taking into account topics and content (see 3.2), it auto ' enlarged to fit the entire grid of data query.

    She looks worse and makes it harder to see results at a glance.

    Bug and will be fixed for the release of v4.

  • HO to get the result of the script with query of 11 g

    Hello

    While doing tasks of refreshment as you need to run some select query. am so lazy to check each application one by one, so I've placed all querys in a script and I ran
    I was fine but it does not show only the result of the query, but it shows no query. Can we get the query and put query via the script out.

    Ex: one.sql
    have the script below the querys

    Select the name of database v$.
    Select count (*) from v$ datafile;
    Select count (*) from dba_db_links;
    Select the owner, db_link dba_db_links;

    can someone help me on this...

    Concerning

    Published by: 889571 on 19 may 2013 14:59
    [oracle@localhost samples]$ cat sample.sql
    set term on echo on
    select name from v$database;
    select count(*) from v$datafile;
    select count(*) from dba_db_links;
    select owner,db_link from dba_db_links;
    [oracle@localhost samples]$ sqlplus user1/user1 @sample.sql
    
    SQL*Plus: Release 11.2.0.2.0 Production on Sun May 19 16:06:20 2013
    
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select name from v$database;
    
    NAME
    ---------
    ORCL
    
    SQL> select count(*) from v$datafile;
    
      COUNT(*)
    ----------
             6
    
    SQL> select count(*) from dba_db_links;
    
      COUNT(*)
    ----------
             0
    
    SQL> select owner,db_link from dba_db_links;
    
    no rows selected
    
    SQL> 
    

Maybe you are looking for