ORA-00900 - the SQL commands: invalid SQL statement

Hello world
I installed Oracle Xe on a Centos 5.5 host yesteday.
Installation was Ok, I can connect to the web interface on "http://127.0.0.1:8080 / apex / '.
But when I want to use sql commands, regardless of the input control, I have the "ORA-00900: invalid SQL statement" message.
I can enter the command "Show all", for example, in a terminal after SQL > command prompt, it works... but not in the web interface...
I tried to import the .sql, script trought the web interface, no much result, no display in the window.
Can someone help me,
Thank you

Show all is NOT a SQL command is a command that I think, not a command from pl/sql, sql more... Why not try to do a select on a table is know YOU the schema...

Thank you

Tony Miller
Webster, TX

Tags: Database

Similar Questions

  • ORA-00900: the SQL statement invalid when you run for immediate assistance.

    Hello
    I write code simple db is 9.2.0.8
    create or replace procedure gather_part_stats(p_schema in varchar2, p_table in varchar2)
    as
    l_quarter varchar2(8) := to_char(sysdate, '"Y"YYYY"_Q"q') ;
    l_sql varchar2(2000) := 'exec dbms_stats.gather_table_stats(:schema, :table, method_opt => ''for all columns size 1'' , cascade => true , estimate_percent => 1 , granularity => ''PARTITION'', partname=>:part);';
    begin
    dbms_output.put_line('l_quarter: ' || l_quarter);
    dbms_output.put_line(l_sql);
    execute immediate l_sql using in p_schema, in p_table, in l_quarter ;
    end;
    /
    Trying to collect statistics of the table with the selected partition but mess up something with... something :)
    I use use to avoid sql injection, please advice.

    Error is:
    SQL > gather_part_stats exec ('TEST', 'TEST');
    l_quarter: Y2012_Q2
    exec dbms_stats.gather_table_stats (: schema,: table, method_opt = > ' for all columns size 1', cascade = > true, estimate_percent = > 1, granularity = > 'PARTITION', partname = >: part);
    BEGIN gather_part_stats ('TEST', 'TEST'); END;

    *
    ERROR on line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at the 'INSTALL '. GATHER_PART_STATS', line 8
    ORA-06512: at line 1

    Concerning
    GregG

    You must use the dynamic PL/SQL

    create or replace procedure gather_part_stats(p_schema in varchar2, p_table in varchar2)
    as
    l_quarter varchar2(8) := to_char(sysdate, '"Y"YYYY"_Q"q') ;
    l_sql varchar2(2000) := 'begin dbms_stats.gather_table_stats(ownname=>:schema, tabname=>:table, method_opt => ''for all columns size 1'' , cascade => true , estimate_percent => 1 , granularity => ''PARTITION'', partname=>:part); end;';
    begin
    dbms_output.put_line('l_quarter: ' || l_quarter);
    dbms_output.put_line(l_sql);
    execute immediate l_sql using in p_schema, in p_table, in l_quarter ;
    end;
    / 
    
  • How can I pass a condition of the table in the sql statement?

    For example, in the table in the COND Varchar2 column (200) there is the value ' VAR > 10'.

    | COND |

    |' VAR > 10' |

    where VAR is the name of the table column. I would like to make statement CASE WHEN VAR > 10 AND 0... I tried with as subquery

    WHEN BOX (SELECT COND FROM TABLE WHERE...) THEN 0, but it does not work.

    Hello

    You can do this by using dynamic SQL.

    that is to say:

    declare
      v_stm      varchar2(4000);
      v_cond      varchar2(100);
      v_result    integer;
    begin
      select cond
        into v_cond
        from yourtable
      where a=1;
    
      v_stm := 'select case when '||v_cond||' then 0 ...';
    
      -- dynamic sql
      execute immediate v_stm
        into v_result;
    
    end;
    /
    

    Remember that, in general, dynamic SQL has a performance degradation that SQL static and should be avoided when possible.

    Storage condition or the SQL statements in the tables is not a good practice.

    Kind regards.

    Alberto

  • Identify the SQL statements that are executed frequently

    I would like to identify SQL statements that are executed may times (e.g., > 1000 times) during an interval AWR.

    I am aware of coloring a SQL_ID with exec ('...') dbms_workload_repository.add_colored_sql; but then the SQL ID must be known.

    Is it also possible to do the same for the (not yet known) SQL statements that are executed > 1000 times? I think that the SQL statements that run very quickly (for example 1 s <) won't be captured automatically in a CWA even if those statements are frequently performed.

    Version 11.2.0.4 on SLES11

    Try this...

    fixed lines 155

    execs from collar to 999 999 999

    Col min_etime to 999,999.99

    Col max_etime to 999,999.99

    Col avg_etime to 999,999.999

    Col avg_lio to 999,999,999.9

    Col norm_stddev to 999,999.9999

    Col begin_interval_time to a30

    node of col to 99999

    break on plan_hash_value on startup_time skip 1

    Select * from)

    Select sql_id, sum (execs), min (avg_etime) min_etime, max (avg_etime) max_etime stddev_etime/min (avg_etime) norm_stddev

    de)

    Select sql_id, execs, plan_hash_value, avg_etime,

    StdDev (avg_etime) on stddev_etime (sql_id partition)

    de)

    Select sql_id, plan_hash_value,.

    Sum (NVL(executions_delta,0)) execs,

    (sum (elapsed_time_delta) /decode (sum (nvl(executions_delta,0)), 0.1, sum (executions_delta)) / 1000000) avg_etime

    -sum ((buffer_gets_delta/decode (nvl(buffer_gets_delta,0), 0.1, executions_delta))) avg_lio

    DBA_HIST_SQLSTAT s, DBA_HIST_SNAPSHOT SS

    where ss.snap_id = S.snap_id

    and ss.instance_number = S.instance_number

    and executions_delta > 0

    Group of sql_id, plan_hash_value

    )

    )

    Group of sql_id, stddev_etime

    )

    where norm_stddev > nvl (to_number('&min_stddev'), 2)

    and max_etime > nvl (to_number('&min_etime'),.1)

    order of norm_stddev

    /

  • Get the SQL statement error programmatically

    Hello

    error SQL in the FORMS, you can display the erroneous SQL statement pressing (shift) (Ctrl) E on the screen. Is there a way to get the text of the SQL statement in a PL/SQL function for logging purposes?

    I get the error using SQLERRM, it's not a problem. But how can I get the SQL text of the statement?

    Thanks and regards,

    Sascha

    Sascha,

    You should be able to use the: SYSTEM. System LAST_QUERY variable forms.

    Craig...

  • How to analysis of the XML in the sql statement?

    Hi friends, I have a table that contains a column of type CLOB, stores in xml format. For example, the data are like that

    <Employees xmlns="http://TargetNamespace.com/read_emp">
       <C1>106</C1>
       <C2>Harish</C2>
       <C3>1998-05-12</C3>
       <C4>HR</C4>
       <C5>1600</C5>
       <C6>10</C6>
    </Employees>
    
    

    So how can I write the sql statement for the analysis of the data at the top

    create or replace procedure parsing_xml

    (

    clob trans_payload

    trans_dir varchar2

    )

    as

    Start

    if(trans_dir='inbound/emp')

    then

    insert into emp_proj

    (

    employee_id

    last_name

    hire_date

    job_id

    salary

    department_id

    )

    Select t1.c1

    t1.c2

    t1.c3

    t1.c4

    t1.c5

    t1.c6

    from xmltable

    (

    XmlNamespaces ('http://TargetNamespace.com/read_emp' as 'emp').

    ' / ' emp:Employees by the way of xmltype (trans_payload)

    columns

    whole path of C1 'emp:C1. "

    path of varchar2 (10) C2 'emp:C2. "

    C3 varchar2 (10) path "emp:C3."

    C4 varchar2 (10) path "emp:C4."

    whole path of C5 "emp:C5."

    C6 varchar2 (10) path 'emp:C6 '.

    ) t1;

    end if;

    commit;

    end;

  • Why the sql statement was extucted twice in shell script?

    I tried to test the rac load balancing using the shell script depending on suse 10 + oracle 10g rac.
    oracle@SZDB:~> more load_balance.sh
    #!/bin/bash
    for i in {1..20}
    do
    echo $i
    sqlplus -S system/oracle@ORA10G <<EOF
    select instance_name from v\$instance;
    /
    EOF
    sleep 1
    done
    exit 0
    After run the shell script, I got the result to follow.
    oracle@SZDB:~> ./load_balance.sh
    1
    
    INSTANCE_NAME
    ----------------
    ora10g2
    
    INSTANCE_NAME
    ----------------
    ora10g2
    
    2
    
    INSTANCE_NAME
    ----------------
    ora10g1
    
    INSTANCE_NAME
    ----------------
    ora10g1
    
    3
    
    INSTANCE_NAME
    ----------------
    ora10g1
    
    INSTANCE_NAME
    ----------------
    ora10g1
    Seem that the sql statement was run twice in each loop. If you help please take a look. Thanks in advance.

    Robinson

    Because you have one; and one.

  • copy and paste the sql statement into sql * more

    How do you paste the sql statement into sql * more... I tried the following options, get the windows interface for this sequel to the documentation below, but that did not work

    http://download.Oracle.com/docs/HTML/A88829_01/ch3.htm

    then I tried to create a simple .txt file with my sql statement and tried to run using @name (where name is the name of the file) and it gives me the following error SP2-0310: cannot open the file 'firstscriot.sql '.

    You name the file name.txt? Then you cannot start with @name, because SQL * PLUS will add the extension .sql

    Try instead the @name.txt or name the file name.sql

    And check if you have the correct path.

    Concerning
    Marcus

  • How the SQL statement

    In an interview, no one asked me a question. How the sql statement
    ex: select * from emp;

    I answered him as if the select statement is in the library cache then it will retrieve data from the cache, otherwise it will retrieve data from database files. On this, he asked to go. I could not years itself. Anyone like elobarate me on the analysis?

    SMON,

    I would have preferred the official documents from Oracle, as suggested by

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e16508/sqllangu.htm#CHDFCAGA

    Concerning
    Peter

  • CALL THE PROCEDURE IN THE SQL STATEMENT

    Why we cannot call a procedure inside the SQL statement?

    Hello

    Usually when you select an item should return you data. In the case of a procedure, you cannot return any return value from the procedure directly it has to be done through some settings and to access these settings, you cannot use a simple sql statement. Where as in a function, you must return one of data that can be easily obtained accordingly.

    see you soon

    VT

  • Tuning sql of a product to the seller without changing the sql statement

    Hello

    We have a product of the provider that generates the SQL statement. For a query, we get the answer in 15 seconds. But users are asking if we can bring it back to 5 seconds. Limitation is the query can not be changed. He used about 10 to 12 tables and bit complex query.

    What kind of options could be evaluated if we are to improve the performance of a query (not sure if she could never be reduced to 5 seconds)
    without making any change to the query.

    Database Version: Oracle 10.2.0.4

    Thank you
    Delphine

    Hello

    http://www.Oracle-base.com/articles/10G/AutomaticSQLTuning10g.php

    your software is enterprise or standard?

    Tuning Pack & pack diagnosis are extra cost option with the standard edition.

    & the useful note * automatic SQL Tuning - SQL [271196.1 ID] profiles *.

    http://www.Oracle.com/us/corporate/pricing/technology-price-list-070617.PDF

    Thank you

    Published by: CKPT November 5, 2010 11:12

  • Need help to resolve the error - below the SQL statement to execute cannot be

    Below is my CO as, which creates a callable statement.

    try {}
    OAApplicationModule oaapplicationmodule = (webBean) pageContext.getApplicationModule;
    OADBTransactionImpl t = (OADBTransactionImpl) oaapplicationmodule.getOADBTransaction ();
    OracleCallableStatement proc = (OracleCallableStatement) t.createCallableStatement (lquery,-1);
    proc. Execute();
    t.Commit ();


    }
    catch (SQLException sqlexception)
    {
    throw OAException.wrapperException (sqlexception);
    }




    After the execution of the page, get the below error... (Please find below stack error)

    I have referred the development guide but did not get something useful.

    Please give me clues about the same.

    Raghu cordially

    -- Error Stack ---------------------------------------------------------

    Error page


    Details of the exception.

    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: Houston-27123: SQL error in the preparation of the call statement. Statement: null
    at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408)
    at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2637)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
    in OA. jspService(OA.jsp:40)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)
    # # 0 in detail
    java.sql.SQLException: the SQL statement to execute cannot be empty or null
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
    at oracle.jdbc.driver.OracleConnection.privatePrepareCall(OracleConnection.java:1138)
    at oracle.jdbc.driver.OracleConnection.prepareCall(OracleConnection.java:1054)
    at oracle.jbo.server.DBTransactionImpl.createCallableStatement(DBTransactionImpl.java:3033)
    at cisco.oracle.apps.xxchr.element.server.webui.XXCHRElementSetSearchCO.processFormRequest(XXCHRElementSetSearchCO.java:343)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
    at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
    at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
    in OA. jspService(OA.jsp:40)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)
    java.sql.SQLException: the SQL statement to execute cannot be empty or null
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
    at oracle.jdbc.driver.OracleConnection.privatePrepareCall(OracleConnection.java:1138)
    at oracle.jdbc.driver.OracleConnection.prepareCall(OracleConnection.java:1054)
    at oracle.jbo.server.DBTransactionImpl.createCallableStatement(DBTransactionImpl.java:3033)
    at cisco.oracle.apps.xxchr.element.server.webui.XXCHRElementSetSearchCO.processFormRequest(XXCHRElementSetSearchCO.java:343)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
    at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
    at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
    at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
    in OA. jspService(OA.jsp:40)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)

    Published by: Rambeau on Oct 14, 2010 02:58

    check the code stuck by me again

    Connection Conn = pageContext.getApplicationModule (webBean) .getOADBTransaction () .getJdbcConnection ();

    Connection conn = oaapplicationmodule.getOADBTransaction().getJdbcConnection(); //Right one
    

    Thank you
    -Anil

  • the SQL statements used to create views

    Hello
    How can I see the full text (with table) to create a sql view:
    SQL> select text from dba_views where rownum=1;
    
    TEXT
    --------------------------------------------------------------------------------
    select "LIB_IDX","LIB_NAME","VENDOR_NAME","PROTOCOL_NUM","VERSION_NUM","PATH_NAM
    Thank you.

    Try the following in the SQL * faster before executing the SQL statement:

    SET LONG 1000
    

    If this does not work, increase it if necessary.

  • OSB: fn - bea: execute - sql () with the sql statement ' INSERT INTO...» »

    Dear Experts,

    I need a clarification. Is it possible to use the fn - bea: function execute sql (Oracle Service Bus) to perform an insert operation in a database with the data extracted from the message of the Organization (i.e. $body/Info/username)? If it is possible which is the right syntax?
    Any suggestion is appreciated.

    Kind regards
    Mike

    Published by: ITDeveloper on November 19, 2009 2.55

    Published by: ITDeveloper on November 19, 2009 3.01

    Hi Mike,.

    Please refer to my post for the same question to the fn - bea: sql performance with 'Insert INTO' the sql statement

    Thank you best regards &,.

    Vivek

  • table in the sql statement

    Hi all

    I just created a function that returns a TABLE;

    I am grateful if some body guide me how to display the values in the table at the call of my sqlplus as function

    Select * from func_avg_cost() of double;

    its fine when you return a single value of work. But I'm back a table to retrieve the value from the table in the sql statement

    Thank you!

    now, I must return two numbers function. as possible through table.

    which is also possible with a simple object:

    SQL> create or replace type my_number_typ as object (n1 number, n2 number)
    /
    Type created.
    
    SQL> create or replace function my_numbers (n1 number := 0, n2 number := 0)
       return my_number_typ
    as
    begin
       return my_number_typ (n1, n2);
    end my_numbers;
    /
    Function created.
    
    SQL> select   my_numbers (2, 3) from dual
    /
    MY_NUMBERS(2,3)
    --------------------------------------------------
    (2; 3)
    1 row selected.
    
    SQL> select   my_numbers (sal, deptno) my_numbers  from   emp where   empno = 7788
    /
    MY_NUMBERS
    --------------------------------------------------
    (3000; 20)
    1 row selected.
    
    SQL> select   my_numbers (sal, deptno).n1 sal, my_numbers (sal, deptno).n2 deptno
      from   emp where   empno = 7788
    /
           SAL     DEPTNO
    ---------- ----------
          3000         20
    1 row selected.
    

Maybe you are looking for