concatenate the output of two sqls.

Hi all

I'm trying to concatenate the output of two sqls

It should be fairly simple, but somehow I find it hard today.

Here's the sql code.

< code >

Select (select to_char (sysdate, 'YYYYMMDD') of double) | "| (select the CHILD_SEQ.nextval of the double) of the double

< code >

I'm working on Oracle 11 g.

Kindly help.

use

What's the problem with just doing...

SQL > create the sequence child_seq;

Order of creation.

SQL > ed
A written file afiedt.buf

1 * select to_char (sysdate, 'YYYYMMDD') | The double CHILD_SEQ.nextval
SQL > /.

TO_CHAR (SYSDATE, 'YYYYMMDD') | CHILD_SEQ. NEXTVAL
------------------------------------------------
201408131

SQL >

I hope you're not uing a primary touch well and trying to 'reset' the sequence every day.  This is not recommended and not scalable; keep primary keys simple by simply using a sequence and treat sysdate as a piece of data and other data.  If you need to get "sequences" for a particular day you can create them on the fly using row_number() over (partition by primarykeycolumn order datecolumn) where your datecolumn is the cut off date (trunc (sysdate)) and the primary key column is just the value of sequence assigned to the record.

Tags: Database

Similar Questions

  • How to synchronize the analog input and the output of two different USB data acquisition boards

    Hi all

    I have two tips very different USB NI USB 6008 case, which I use to acquire the data (analog input) and a USB of NI 9263 is a output analog only site I use to route a signal (in this case a square pulse). The reason why I use the outputs analog 6008 is because I need to deliver negative tension and need the full +/-10 v range.

    Looking at similar positions, I'm pretty sure that I can't use an external trigger or a common clock, I also tried to use the timed synchronization of the structures but no cigar.

    I'm including a quick vi I whipped showing how the jitters because of the lack of synchronization signal. The OD of the 9263 connects to AI in the 6008 in this example.

    I talked to a specialist in the phone and tols me that's not possible.

  • How to format the output of a .sql script that has select statements.

    Hello

    I have a .sql script which is having several select statements. Each Select statement is to have hundreds of Table columns.

    When we run the .sql script, we are unable to read the output.

    Please let know us the commands that we include for better readable output format.

    You work with the lin standard set 80.
    Increase this setting to set lin 3000 or more.

  • How to display the output of PL/SQL and difficulty package below error (please help)

    -PACKAGE SPECIFICATION AND met with success, but I see no way out, an error is also here... Please help. How do I solve this problem
    -with the code

    CREATE OR REPLACE PACKAGE package_variables
    -Declare the components of a package.
    Established PROCEDURE (VARCHAR2 value);
    Public FUNCTION get RETURN VARCHAR2;
    END package_variables;
    /



    CREATE OR REPLACE PACKAGE BODY package_variables
    -Declare the package-scoped variable.
    variable VARCHAR2 (20): = "initial value";
    -Define the function
    Get function RETURN VARCHAR2 IS
    BEGIN
    RETURN variable;
    END get;
    -Define the procedure.
    PROCEDURE set(value VARCHAR2) IS
    BEGIN
    variable: = value;
    The END value;
    END package_variables;
    /



    Result VARIABLE VARCHAR2 (20)
    CALL package_variables.get () IN: result;
    SELECT: result AS result FROM dual;


    RUN package_variables.set ("new value '");
    CALL package_variables.get () IN: result;
    SELECT: result AS result FROM dual;

    /*

    OUTPUT


    PACKAGE compiled package_variables.
    PACKAGE compiled package_variables BODY.

    Error at startup on line 2 of the command:
    CALL package_variables.get () IN: results
    Error report:
    SQL error: ORA-01008: not all variables
    01008 00000 - "not all variables.
    * Cause:
    * Action:
    RESULTS
    --------------------------------


    1 selected lines

    anonymous block filled

    Error at startup on line 2 of the command:
    CALL package_variables.get () IN: results
    Error report:
    SQL error: ORA-01008: not all variables
    01008 00000 - "not all variables.
    * Cause:
    * Action:
    RESULTS
    --------------------------------


    1 selected lines

    */

    The package name is package_variables (note the 's'. Plural.) But using package_variable (in the singular) in your call.
    Also select in as a SQL statement seems to be not valid. You encapsulate a begin - end around her block.

    SQL> begin
      2  select package_variables.get into :outcome from dual;
      3  end;
      4  /
    
    PL/SQL procedure successfully completed
    outcome
    ---------
    Initial Value
    
  • How to limit the lines on the union of two sqls

    Hi all

    The sql below returns two lines when the column value 3 (VALUE2) has a value other than 0 in the second sql.

    I want that the result set to return the second row, when there is a match in the first row.

    Thanks for you help,
    Hozy

    ---------------------------

    with options like
    (
    Select the PROPERTY 'AUDIT_CREATE_ROLE', "CREATE ROLE" VALUE, VALUE2 0 in union double
    Select the PROPERTY 'AUDIT_DROP_ANY_ROLE', 'DROP ANY ROLE' VALUE, 0 VALUE2 to double union
    Select the PROPERTY 'AUDIT_EXECUTE_PROCEDURE', 'PROCEDURE' VALUE, VALUE2 0 in double union
    Select the PROPERTY 'AUDIT_SELECT_ANY_DICTIONARY', "SELECT ANY DICTIONARY" VALUE, 0 union double VALUE2
    Select the PROPERTY 'AUDIT_GRANT_ANY_OBJECT', 'GRANT ANY OBJECT' VALUE, 0 VALUE2 to double union
    Select the PROPERTY 'AUDIT_CREATE_LIBRARY', 'CREATE LIBRARY' VALUE, VALUE2 0 in union double
    Select ' AUDIT_AUD$ ' PROPERTY 'AUD$ ' VALEUR0, VALUE2 to double union
    Select the PROPERTY 'AUDIT_ALTER_ANY_TABLE', 'ALTER ANY TABLE' VALUE, 0 VALUE2 to double union
    Select the PROPERTY 'AUDIT_ALTER_USER', 'ALTER USER' VALUE, VALUE2 0 in union double
    Select the PROPERTY 'AUDIT_CREATE_USER', "CREATE USER" VALUE, VALUE2 0 in union double
    Select the PROPERTY 'AUDIT_CREATE_SESSION', "CREATE SESSION" VALUE, VALUE2 0 in double union
    Select the PROPERTY 'AUDIT_DROP_ANY_PROCEDURE', 'DROP ANY PROCEDURE' VALUE, 0 VALUE2 to double union
    Select the PROPERTY 'AUDIT_DROP_ANY_TABLE', 'DROP ANY TABLE' VALUE, 0 VALUE2 to double union
    Select the PROPERTY 'AUDIT_GRANT_ANY_PRIVILEGE', 'GRANT ANY PRIVILEGE' VALUE, 0 VALUE2 to double union
    Select the PROPERTY 'AUDIT_GRANT_ANY_LIBRARY', 'CREATE ANY LIBRARY' VALUE, 0 double VALUE2
    )

    Select the PROPERTY VALUE, value2
    one of the options
    Union
    SELECT "AUDIT_ | REPLACE (audit_option, ", '_') as a PROPERTY.
    audit_option as VALUE, COUNT (*) as VALUE2 - how can I get this information from County?
    OF dba_stmt_audit_opts
    WHERE UPPER (audit_option) IN ('EDIT ANY TABLE', 'ALTER USER', 'CREATE a ROLE', 'CREATE a USER', 'CREATE THE SESSION', "DROP ANY PROCEDURE', 'DROP no matter WHAT TABLE", 'GRANT NO PRIVILEGE', "DROP no matter WHAT ROLE", "PROCEDURE", "SELECT ANY DICTIONARY", "No matter WHAT PURPOSE of the GRANT", 'CREATE any WHAT LIBRARY', 'CREATE LIBRARY')
    AND the success = "BY ACCESS.
    AND failure = "BY ACCESS.
    AND user_name IS NULL
    AND proxy_name IS NULL
    Audit_option group

    Hozy says:
    This is what the original sql looks like and now I don't know how to insert it in your suggested sql.

    Where I put your original query in a subquery with an alias by dsao, just replace this application with your new query.

    Another thing - you use 'union '; I think this safely could be replaced by "union all", as it seems that the lines will not be duplicated between the two queries.

    with options as (select 'AUDIT_CREATE_ROLE' property, 'CREATE ROLE' value from dual union all
                     select 'AUDIT_DROP_ANY_ROLE' property, 'DROP ANY ROLE' value from dual union all
                     select 'AUDIT_EXECUTE_PROCEDURE' property, 'EXECUTE PROCEDURE' value from dual union all
                     select 'AUDIT_SELECT_ANY_DICTIONARY' property, 'SELECT ANY DICTIONARY' value from dual union all
                     select 'AUDIT_GRANT_ANY_OBJECT' property, 'GRANT ANY OBJECT' value from dual union all
                     select 'AUDIT_CREATE_LIBRARY' property, 'CREATE LIBRARY' value from dual union all
                     select 'AUDIT_AUD$' property, 'AUD$' value from dual union all
                     select 'AUDIT_ALTER_ANY_TABLE' property, 'ALTER ANY TABLE' value from dual union all
                     select 'AUDIT_ALTER_USER' property, 'ALTER USER' value from dual union all
                     select 'AUDIT_CREATE_USER' property, 'CREATE USER' value from dual union all
                     select 'AUDIT_CREATE_SESSION' property, 'CREATE SESSION' value from dual union all
                     select 'AUDIT_DROP_ANY_PROCEDURE' property, 'DROP ANY PROCEDURE' value from dual union all
                     select 'AUDIT_DROP_ANY_TABLE' property, 'DROP ANY TABLE' value from dual union all
                     select 'AUDIT_GRANT_ANY_PRIVILEGE' property, 'GRANT ANY PRIVILEGE' value from dual union all
                     select 'AUDIT_CREATE_ANY_LIBRARY' property, 'CREATE ANY LIBRARY' value from dual),
            dsao as (select 'AUDIT_'||replace(audit_option, ' ', '_') as property,
                            audit_option as value,
                            count(*) as value2
                     from   dba_stmt_audit_opts
                     WHERE  UPPER(audit_option) IN ('ALTER ANY TABLE',
                                                    'ALTER USER',
                                                    'CREATE ROLE',
                                                    'CREATE USER',
                                                    'CREATE SESSION',
                                                    'DROP ANY PROCEDURE',
                                                    'DROP ANY TABLE',
                                                    'GRANT ANY PRIVILEGE',
                                                    'DROP ANY ROLE',
                                                    'EXECUTE PROCEDURE',
                                                    'SELECT ANY DICTIONARY',
                                                    'GRANT ANY OBJECT',
                                                    'CREATE ANY LIBRARY',
                                                    'CREATE LIBRARY')
                     AND    success = 'BY ACCESS'
                     AND    failure = 'BY ACCESS'
                     AND    user_name IS NULL
                     AND    proxy_name IS NULL
                     GROUP BY audit_option
                     union all
                     select 'AUDIT_'|| replace(object_name,' ','_') as property,
                            object_name as value,
                            count(*) as value2
                     from   dba_obj_audit_opts
                     where  object_name='AUD$'
                     and    owner in ('SYSTEM','SYS')
                     and    object_type='TABLE'
                     and    upd='A/A'
                     and    del='A/A'
                     group by audit_option)
    select o.property, o.value, nvl(dsao.value2, 0) value2
    from   options o,
           dsao
    where  o.value = dsao.value (+)
    
  • Displays the output of PL/SQL

    The PL/SQL output below would not be dilsplay. Can anyone in this Council through my code and tell me what I am doing wrong that I can't see the result of the code.

    I only get 'anonymous block' as the view-only. I want to see

    Set serveroutput on
    declare
    cursor obj_cursor is
    Select
    object_name,
    object_type,
    owner
    Of
    DBA_OBJECTS
    where
    owner = 'ITA '.
    and object_type in ('TABLE', 'SEE')
    and object_name like 'JOB_;
    wk_job VARCHAR2 (500);
    WK_SQL VARCHAR2 (500);
    WK_JOBSTR VARCHAR2 (500);
    out_f utl_file.file_type;
    BEGIN
    wk_jobstr: = 'JOB_ | LTRIM (to_char (wk_job)). '%';
    for wk_rec loop obj_cursor
    If wk_rec.object_type = 'TABLE' then
    wk_sql: = 'drop table ' | wk_rec.object_name;
    dbms_output.put_line (wk_sql);
    end if;
    end loop;
    end;
    /

    And if the rans above successfully, how I put the following code in the code above?

    Select ownerid, starttime, endtime in ita.tpis32_job_status jobid where starttime < sysdate - 60 and num_lines > 1000000;

    The idea is to use the jobid five-digit and add it to the job_ variable.

    Hello

    first of all, I'll try to run only SQL, so the selection from your cursor in SQLPLUS. If it returns no rows, your problem is in the SQL code.

    I think the problem is because of your where clause:

    and object_name like 'JOB_';
    

    It will be all the lines where there are 4 characters, nothing more. I think you need to replace the '_' % or add the tot % string. This will also give you the results of more than 4 characters.
    So:

    and object_name like 'JOB_%';
    

    BTW: The underscore is a wild-card character to like. It replaces a single character. The % stands for 0 or more characters.

    Herald tiomela
    Superconsult.nl

  • How to reach the output of two or more queries?

    Suppose a query:
    select count (id) COL1 from table_1 gives:
    COL1
    59
    and another request:
    select count (id) COL2 from table_2 gives:
    COL2
    23
    .
    HOW can I get this output:
    Col1 COl2
    59 23
    edited by: "bootstrap" October 14, 2011 14:08

    Get each count in the subquery:

    SELECT
        (
            SELECT
                COUNT(*)
            FROM
                job
        ) AS cnt_job,
        (
            SELECT
                COUNT(*)
            FROM
                department
        ) AS cnt_department
    FROM
        dual;
    
    CNT_JOB                CNT_DEPARTMENT
    ---------------------- ----------------------
    51                     4                      
    
  • Help with the name of the comparison of the output of an sql subquery value function

    Oracle 10 g

    The problem is I want to compare the value obtained from the subquery with the next value in the values of the column from the main query

    Add a view called bioChemCompare to show the content average A-level biology and in the average grade of A-level chemistry for students of each school that has an average GCSE score between 6.5 and 7.0 (inclusive). The
    calculations should be carried out only on students who studied BOTH the biology and chemistry of A'level.

    I have a query like
    select   g.grade from comqdhb.gradevalues@glink g
    where  g.value > ( select avg(g.value)
    from    comqdhb.gradevalues@glink g
    ,         comqdhb.subject@glink sb
    ,         comqdhb.studentingroup@glink sg
    ,         comqdhb.teachinggroup@glink tg
    ,         comqdhb.student@glink s
    ,         average_gcse gc
    where g.grade=sg.grade 
    and     gc.avg_gcse between 6.5 and 7
    and     gc.upn=s.upn
    and     g."LEVEL"='a' and sb.sid=tg.sid
    and     sg.gid=tg.gid and sg.upn=s.upn
    and     (sb.subject ='Biology' or sb.subject='Chemistry'));
    The subquery
    select avg(g.value)
    from    comqdhb.gradevalues@glink g
    ,         comqdhb.subject@glink sb
    ,         comqdhb.studentingroup@glink sg
    ,         comqdhb.teachinggroup@glink tg
    ,         comqdhb.student@glink s
    ,         average_gcse gc
    where g.grade=sg.grade 
    and     gc.avg_gcse between 6.5 and 7
    and     gc.upn=s.upn
    and     g."LEVEL"='a' and sb.sid=tg.sid
    and     sg.gid=tg.gid and sg.upn=s.upn
    and     (sb.subject ='Biology' or sb.subject='Chemistry')
    Returns
    78.88
    In the main query
    select   g.grade from comqdhb.gradevalues@glink g
    where  g.value > 78.8
    g.Value has values such as
    120
    100
    80
    60
    40
    20
    78.8 is close to 80, only 80 must be taken and the corresponding grade will be displayed.

    What is the function to do so.

    I just put > and it displays
    120 A
    100 B
    80 C

    But the ABC should not be visible only C must be taken

    y at - it no fuction as neighbors, cant use between

    Please help, thank you.

    Rider wrote:
    y at - it no fuction as neighbors, cant use between

    The MIN function maybe aggregation?

    select   min(g.grade) from comqdhb.gradevalues@glink g ...
    

    Kind regards
    Rob.

  • How to make the output of Sql Plus with an error Code

    Dear members,

    How can I define sql more exit with an error code.

    We have a simultaneous host program. The executable is a shell script for this program. This sql script Shell script request which in turn gives call to a custom database package that I built.

    The flow rate is:


    -> SQL-> CUSTOM PACKAGE SCRIPT SHELL SCRIPT

    Custom package has two PARAMETERS of the error indicator and the error message. If something fails in the package these two PARAMETERS is returned with a value.

    So my sql script code looks like this:

    WHENEVER SQLERROR EXIT 251
    WHEN the OSERROR EXIT 251
    Set serveroutput size 1000000
    set linesize 32767
    set verify off
    set the position
    Set feedback off

    DECLARE
    x_error_message VARCHAR2 (1000);
    x_sql_message VARCHAR2 (1000);
    x_exception EXCEPTION;
    e_value NUMBER;

    BEGIN
    dbms_output.put_line ('Inside sql file');


    XXpackage.xxproc (x_error_message, x_sql_message);


    IF (x_error_message IS NOT NULL) AND (x_sql_message IS NOT NULL) THEN
    RAISE x_exception;
    END IF;


    EXCEPTION
    WHEN X_EXCEPTION THEN
    e_value: = 1;
    DBMS_OUTPUT. Put_line (' Exit Code: ' | e_value);
    DBMS_OUTPUT. Put_line ('X_EXCEPTION: EXCEPTION IN SCRIPT xpoext04a.sql :'||) SQLERRM);
    DBMS_OUTPUT. Put_line ('x_error_message is: ' | x_error_message);
    DBMS_OUTPUT. Put_line ('x_sql_message is: ' | x_sql_message);
    DBMS_OUTPUT. PUT_LINE (' ERROR IS: ' |) SQLERRM);
    WHILE OTHERS THEN
    e_value: = 252;
    DBMS_OUTPUT. Put_line (' Exit Code: ' | e_value);
    DBMS_OUTPUT. Put_line (' OTHER: EXCEPTION IN SCRIPT xpoext04a.sql :'||) SQLERRM);
    DBMS_OUTPUT. Put_line ('x_error_message is: ' | x_error_message);
    DBMS_OUTPUT. Put_line ('x_sql_message is: ' | x_sql_message);
    DBMS_OUTPUT. PUT_LINE (' ERROR IS: ' |) SQLERRM);


    END;
    */*
    output
    */*


    As you can see from above, if the two PARAMETERS have value, then it goes to an exception.

    My problem is that if it goes with the exception of X_EXCEPTION, the sql is not come away with a mistake. I mean sql is not treat this case like a sqlerror.


    How can do us more sql dating a sqlerror so that the host program must fail.


    Thank you
    Sandeep

    Published by: user340 on July 28, 2009 12:51

    Published by: user340 on July 28, 2009 12:57

    the plu sql is not come away with a mistake. I mean sql is not treat this case like a sqlerror.

    This is because there is no error. You handled the exception.

    You can try adding a STIMULUS; at the end of your exception section. This re-triggers the exception so sql liked to see it.

  • What is the best way to run two concurrent programs using the output of either executing the other?

    I wanted to just kind of get a notice of some people here. I have two main screws the first is a data acquisition system that displays 99 different sensors and which feeds on these data in a table. The second is a real-time processing system that is designed to take the painting and do many calculations. The two output data from screw at the front that I want to see, so I don't want to use just as a Subvi.

    Is there a simple way to run two screws, using the output of the data acquisition system to power the processor so that you can easily see the signs before two screws? I had thought to simply copy the code from the processor in real-time in the DAQ VI, but I fear that the VI resulting will be very large and unsightly.

    On a side note, I'm more thinking about this? I apologize if this is a stupid question, it has been a long week... aaaand it's Wednesday.

    Look at the Architecture of producer/consumer.  It will be a good starting point, even if you find that you need to change.  When performing data acquisition and processing of tasks in parallel loops, they can both run simultaneously.  Both can feed data to the main draw of the VI.

    I'd probably use three loops with the third being the user interface only.  All that must be displayed to the user is sent to the GUI of the acquisition of data or processing loop loops and commands or entered by users are returned in these loops, probably through queues.  The wall of the VI of data acquisition and processing VI are never displayed to the user.  Especially the treatment, because it runs on a system in real-time, should avoid synchronization issues that can present a graphical interface.

    Lynn

  • Output in two ways at the same time

    Hi guys,.

    I have a problem with the sending of two outputs (two different) rule once a conidition on true case. Here is a picture of the program (program attached as well):

    As you can see, I'm having the output of command to write to two different ways, as when the case is true, the output is supposed to illuminate two leds. The error message that I get with this is:

    Resources required by that task has already been reserved by another task"after that Labview highlights the area of write to the error command. Any suggestions would help!

    Thank you!

    That sounds familiar.

    Look at the VI post fix in response to this question:

    http://forums.NI.com/NI/board/message?board.ID=250&thread.ID=44243

  • Is it possible to have the audio from two different sources and routed to separate outputs at the same time?

    I currently have a string of the guitar signal electric-Rocksmith Real Tone cable - ASIO 4 all help IK Multimedia Amplitube 3.   I would like to know if I could also watch DVD with her while the implementation of the programme of Amplitube with sound.  It would be great that I use the DVD for guitar and play at the same time.   I don't have the signal of two merged as one.  In my mind, I should be able to disable the ASIO devices and use them with DirectX as usual.  I could send the ampitube signal to the headphones and use external speakers for the guitar signal, and use the lessons of speakers for the DVD (or maybe YouTube) laptop on board.

    Is this possible?

    How can I do?

    Toshiba Satellite X 205-S7483

    Jeff

    Yes.  For example, I have my Skype phone calls go to my helmet (normal just plugged in the headset) while my media player plays my speakers.  You can choose your default communication or multimedia devices with a right click on the volume control icon and choosing "playback devices".

    Other programs can also be built to be "to the output current" and allow you to choose the output too.

  • Join the two sql queries

    Hi all

    Thank you very much for all the kind support so far.

    I have two report (sql query)

    I want to add both the sql query

    1st sql query

    select distinct(a.item_number)
          ,a.quantity - b.quantity
    from QUANTITY_ONHAND_ATP a,BACKLOG_ATP_LT_CW b
    where a.item_number = b.item_number
    order by item_number
    2nd sql query

    select distinct(wb.item_number)
           ,wb.quantity - be.quantity
           ,c.quantity - d.quantity
    from BACKLOG_WEEK_BEFORE_ATP wb
        ,BACKLOG_ATP_ET_CW be
        ,BACKLOG_WEEK_AFTER_ATP c
        ,BACKLOG_ATP_GT_CW d
    where wb.item_number = be.item_number
       and c.item_number = d.item_number
       and wb.item_number = c.item_number
       and be.item_number = c.item_number
       and wb.item_number = d.item_number
       and be.item_number = d.item_number
    order by wb.ITEM_NUMBER
    In the 1st sql query I have 129 records and in the 2nd query sql, I have 14 records. I want to combine these two sql queries. If the item_number 1st sql query is not there in 2nd and then view it as to 1 sql only.

    Any help how to do that.

    Concerning

    Published by: User_Apex on July 15, 2011 01:21

    Use the NVL function:

    select q1.item_number, WEEK_BEFORE, nvl(CURRENT_WEEK,0) CURRENT_WEEK, nvl(WEEK_AFTER,0) WEEK_AFTER
    (...)
    
  • Don't know how to test the output of the PL/SQL function

    I have a function in the package '. " XCCC_PO_APPROVALLIST_S1' called 'does_cpa_exist ':
       FUNCTION does_cpa_exist(
          p_document_id              IN       NUMBER
       )
          RETURN BOOLEAN
       IS
          l_cpa_exists VARCHAR2(100);
       BEGIN
          SELECT 'Y'
            INTO l_cpa_exists
            FROM po.po_requisition_lines_all prla
               , ap.ap_suppliers pv
               , ap.ap_supplier_sites_all pvsa
           WHERE prla.vendor_id = pv.vendor_id
             AND prla.vendor_site_id = pvsa.vendor_site_id
             AND pv.vendor_id = pvsa.vendor_id
             AND prla.requisition_header_id = p_document_id
             AND EXISTS(
                    SELECT pha.vendor_id
                      FROM po.po_headers_all pha
                     WHERE pv.vendor_id = pha.vendor_id
                       AND pvsa.vendor_site_id = pha.vendor_site_id
                       AND pha.org_id = fnd_profile.VALUE('ORG_ID')
                       AND pha.type_lookup_code = 'CONTRACT'
                       AND pha.authorization_status = 'APPROVED');
    
          RETURN TRUE;
    
          IF (p_document_id IS NULL)
          THEN
             RETURN FALSE;
          END IF;
       EXCEPTION
          WHEN OTHERS
          THEN
             RETURN FALSE;
       END does_cpa_exist;
    The pl/sql valid and commits OK in TOAD.

    I ran the sql in the EBS, and took the path of the workflow looks like that function returned a value of false.

    I pass to the function a document_id.

    I was wondering how I might test the output of the function from TOAD?

    I tried:
    select XCCC_PO_APPROVALLIST_S1.does_cpa_exist(1017934) from dual;
    But get errors:
    ORA-06552: PL/SQL: Statement ignored
    ORA-06553: PLS-382: expression is of wrong type
    I do probably bad 101 things here, but I would still ask thinking and risk of being shouted at.

    Any advice appreciated,

    Thank you

    I was wondering how I might test the output of the function from TOAD?

    Try

    begin
      if xccc_po_approvallist_s1.does_cpa_exist (1017934)
      then
        dbms_output.put_line ('True');
      else
        dbms_output.put_line ('False');
      end if;
    end;
    /
    
  • SQL Developer: How to copy the data with the output grid column headers?

    Hello

    I use the 2.1.1.64 Version.

    I run a SQL query, down the results grid in the "Query result" window below. Say that I get 10 rows returned, with 5 columns.

    I want to copy this whole grid, as well as the names/column headers to the Clipboard. If I can stick under the original query to document the results of this query.

    I can't find any way to do this. I can copy/paste the results grid, but it does not copy the headers.

    The only way I think to do is to go through many steps to export in a TXT file, then paste that. Unfortunately, that's a lot of steps wasted if I need to do it again and again, and more, the output is pasted in an ugly format with double quotes, etc..

    It seems that the easiest feature is copy and paste the entire grid of the results, and of course, you could the headers. Why is it so difficult/impossible to do?

    (I think that the toad has the same problem. DBArtisan lets you copy and paste the results together, as well as headers, however.)

    Any help would be appreciated!

    Thank you
    John

    Shift-Ctrl-C will copy the headers of columns as well as the selected data.

Maybe you are looking for