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

Tags: Database

Similar Questions

  • How to display the output of query clause?

    Hello. I use Forms Developer 10g. I have a datablock that uses a from_clause_query. In my from_clause_query, I used a WITH AS SELECT.
    I try to view the output of this query in my forms but the first column, V_CUTOFF_TO not displayed, probably because it is not a database element. It was a result of my initial query WITH AS SELECT month. How can I view this with the release of my from_clause_query. Thanks in advance for the help. Moreover, I am trying to post the contents of my from_clause_query here, but it says sorry, this content is not allowed. I don't know why?

    I was able to solve the problem by creating a stored procedure. I insert the records in a table in the procedure, and then I query the table. Thanks for your help.

  • 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 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.

  • Able to display the output but cannot send and entry on powerconnect 5424

    Hello

    I am configuring a PowerConnect 5424 switch to connect to my network as one of the distribution switch. When I explain on my network. its very basic as we do not have to any VLAN managed or any other complex implementation.

    When I boot the switch connection with putty via a cable series, I can see the output of the switch where I can't enter anything. I tried three different emulators of terminal that did not work at all.

    What can be the reason, how can I do this because I just want to set up an IP address so that I can connect to switch and monitor ports... etc?

    Hello!

    Thanks for the reply. Well, he had no problem with the cable or unit, it is the laptop that I used. It's no wonder that my previous Dell switch has failed. I tried it on another laptop and it worked like charm. I managed to configure the switch too.

    Thank you!

  • How to clear the output buffer, possibly resize and burn again, before you begin the task of output

    I use PyDAQmx with a USB-6363, but I think the question is generic to DAQmx.

    I have an output buffer that I want to be able to (re) write to without starting the task output.

    More specifically, I have a graphical interface and a few sliders, the user can move.  Whenever the slider changes, a new set of values is loaded into the buffer output through DAQmxWriteAnalogF64.  After you set the value, the user can click on a button and start the task output.

    In some cases the change in cursor does not require a change in buffer size, only a change in the data.  In this case, I get the compalint following DAQmx as they tried writing:

    The generation is not yet started, and not enough space is available in the buffer.

    Set a larger buffer, or start the generation before writing data more than content in the buffer.
    Property: DAQmx_Write_RelativeTo
    Value: DAQmx_Val_CurrWritePos
    Property: DAQmx_Write_Offset
    Corresponding value: 0
    Property: DAQmx_Buf_Output_BufSize
    Corresponding value: 92

    In other cases the change in cursor requires both change in the size of the buffer and data modification.  In this case, I get the following, but only after that do a few times each time increase the size of the writing.

    DAQmx writing failed because a previous writing DAQmx configured automatically the size of output buffer. The size of the buffer is equal the number of samples written by channel, so no additional data can be written before the original task.

    Start the generation of before the second writing DAQmx or set true in all instances of writing DAQmx Auto Start. To gradually write to the buffer before starting the task, call DAQmx Configure an output buffer before the first writing DAQmx.
    Task name: _unnamedTask<0>

    State code:-200547
    function DAQmxWriteAnalogF64

    I tried to configure the output via DAQmxCfgOutputBuffer buffer (in some cases, by setting it to zero or a samples, then save again, in an attempt to clear it) but that doesn't seem to do the trick.

    Of course, I can work around the problem by loading data only when the user clicks the end button, but not what I'm asking here.

    Is it possible to "remake" the writing of output before you begin the task?

    Thank you

    Michael

    Today I have no material practical to validate, but try unreserving task before writing the new buffer:

    DAQmxTaskControl (taskHandle, DAQmx_Val_Task_Unreserve);

    With a simulated device, he made the error go away in case the buffer is the same size.  You will need to validate if the data are in fact correct, but I think it should be (unreserving I would say reset the write pointer so the old buffer are replaced with the new data).

    I always get errors when you try to change the size of buffer if (on my 6351 simulated).  I posted some similar mistakes about the reconfiguration of the tasks here, I guess it is possible that this issue has also been set at 9.8 (I always use 9.7.5 on this computer).  If the behavior is still present in the new driver, and also appears on real hardware (not just simulated), then it seems that this is a bug of DAQmx someone at OR should be considered.

    I wrote a simple LabVIEW VI that captures the error in order to help people to NOT reproduce it:

    The best solution at the moment would be likely to re-create the task if you need to change the size of the buffer (or avoid writing data until you are sure what will be the size of buffer).

    Best regards

  • How to display the output as 'error' in this program

    DECLARE

    C_ID employees.sno%type: = 2;

    employees.name%type c_name;

    c_addr employees.country%type;

    BEGIN

    SELECT name, c_name, c_addr FROM Employees WHERE sno country is c_id;

    DBMS_OUTPUT. Put_line (' name: ' | c_name);

    DBMS_OUTPUT. Put_line (' address: ' | c_addr);

    EXCEPTION WHEN no_data_found THEN

    dbms_output.put_line ('no such customer!');

    WHILE others

    THEN dbms_output.put_line ('Error!');

    END;

    If I have 2 give her no customer display

    and what I need to do to print error when you exit?

    Because you manage the no_data_found error in your exception block there is no error for when others block to manage.  If you want to hit him when another fishing your code available, you can either remove the handler no_data_found, or introduce a different error condition, such as:

    SQL > select * from employees;

    SNO NAME NECK

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

    1 John CAN

    1 John CAN

    SQL > DECLARE

    2 c_id employees.sno%type: = 1;

    3 employees.name%type c_name;

    4 c_addr employees.country%type;

    5 BEGIN

    6. SELECT name, country IN c_name, c_addr

    7 FROM employees

    8. WHERE the sno = c_id;

    9 DBMS_OUTPUT. Put_line (' name: ' | c_name);

    10 DBMS_OUTPUT. Put_line (' address: ' | c_addr);

    EXCEPTION 11

    12. WHEN no_data_found THEN

    13 dbms_output.put_line ('no such customer!');

    14 SO that others THEN

    15 dbms_output.put_line ('Error!');

    16 END;

    17.

    Error!

    PL/SQL procedure successfully completed.

    The too_many_rows error introduced by the lines in the flow of the table to the when of other Manager.  Note the procedure message passed to PL/SQL.  Because the other handler handled the error, when more an error in the code block.  If it's a stored procedure, the appellant would never know that something had gone wrong, one of the reasons why when another Manager without a raise is a bad idea.

    John

  • 10.1.3.4 - BPEL how to display the output of Java Embedding

    I have a 2 steps java imbedding into my stream. base64ToString, replaceNamespace. I use the getVariableData and the setVariableData to access the data stream in this step and I'll put the values in a variable called xmlString. When running, I see only "run bpelx:exec" when I click on the java embedding step, I see quite the value of "xmlString. How can I see the value created breast this java embedding stage. System.out.println is not the answer I'm looking for.

    Use addAuditTrailEntry which will put your output as part of audit trail
    addAuditTrailEntry ("output:" + variableData)

    OR

    System.out.println

    It will be printed in the console.

  • error messages,... hs_err_pid3164, hs_err_pid280, hs_err_pid3692... they keep coming to the top, anyone know whats causing or how to fix them it, I also get a lot of script errors please help

    I would appreciate a little insite on these errors

    Hello

    ·        Since when are you facing this problem?

    ·        Remember to make changes to the system?

    ·        You have a genuine copy of Windows XP is installed on the system?

    PID is the product id is the 20 digit number that is found in the system. Follow the steps mentioned below to locate the product ID.

    a. click on Start menu and click Control Panel.

    b. click System and in the general tab, you can see the product identification number 20 numbers.

    Method 1:

    I suggest to start in safe mode and check if you experience this problem. Follow the steps mentioned below.

    a. restart the computer and keep tapping F8 until you reach the start menu.

    b. Select safe mode from the list and press ENTER.

    If you get the script error message when you browse to Internet Explore then I suggest that you follow the steps mentioned in the article below.

    How to resolve script errors in Internet Explorer on Windows computers

    http://support.Microsoft.com/kb/308260

    I suggest you return the item mentioned below.

    When you try to validate a copy of Windows XP, you receive the following error message: "0 x 80080201 cannot detect the product ID (PID).

    http://support.Microsoft.com/kb/938720

    Thanks and regards.

    Thahaseena M
    Microsoft Answers Support Engineer.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to display the value of the variable for bottom of pl/sql

    How to display the value of the variable for bottom of pl/sql

    declare

    V_1 number: = 10;

    V_2 number: = 20;

    V_3 number: = 30;

    v_4 number: = 40;

    v_5 number: = 50;

    test varchar2 (100);

    Start

    I'm in 1.5

    loop

    test: = "v_" | I have;

    dbms_output.put_line(i||) e > ' | test);

    end loop;

    end;

    /

    How to get below output:

    1 > v_1

    2 > v_2

    3 > v_3

    4 > v_4

    5 > v_5

    But I want to output of

    1 > 10

    2 > 20

    3 > 30

    4 > 40

    5 > 50

    Hello

    You cannot reference variables as you did and get the value of the variable. Use pretty collection.

    set serveroutput on size 2000
    declare
      type      number_table is table of number;
      numbers   number_table := number_table(10, 20, 30, 40, 50);
    begin
      for i in numbers.first .. numbers.last
      loop
        dbms_output.put_line(i || '->' || numbers(i));
      end loop;
    end;
    /
    
    anonymous block completed
    1->10
    2->20
    3->30
    4->40
    5->50
    

    See the Collections of PL/SQL and Records http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/composites.htm#LNPLS005

  • How to display the horizontal output?

    Hi all

    I need to display the output horizontally in my report.

    Output current:

    col1 col2

    -----    ------

    1          a

    2          b

    3          c

    Power required:

    col1: 1 2 3

    col2: a, b and c

    I can do it by the layout of rdf, but I need to do it by XML editor or a publisher of BI, because I need excel output only.

    So any ideas?

    I can do it by the layout of rdf, but I need to do it by XML editor or a publisher of BI, because I need excel output only.

    you do this by rdf as report page or data model for the bi publisher model?

    so first case is rotate the data in rdf by sql and then put in model

    also the pivot in rtf http://docs.oracle.com/cd/E28280_01/bi.1111/e22254/create_rft_bldr.htm#BIPRD2681

    also the columns Dynamics http://docs.oracle.com/cd/E28280_01/bi.1111/e22254/create_rtf_tmpl.htm#BIPRD2546

  • SQL: how to display the second string of the function in the Jobs table only if the function has more than one string.

    SQL: how to display the second string of the function in the Jobs table only if the function has more than one string.

    Hello

    You can use REGEXP_SUBSTR Oracle/PLSQL: REGEXP_SUBSTR function

    Select the function double REGEXP_SUBSTR('PUBLIC RELATION REPRESENTATIVE ','[^]+',1,2);

    Do you have any value of the column as no 2nd string?

  • How to display the results in the order based on the value of research

    Hi all

    How to display the results in the slot order.
     
    
    CREATE TABLE TEST( SONGID  NUMBER, TITLE   VARCHAR2(200))
    
    INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
    INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
    INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');     
    INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
    INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');
    
    SELECT *FROM  TEST WHERE INSTR (TITLE, 'MADONNA') > 0
    
    output: 
    SONGID     TITLE
    10     AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    11     CICCONE, MADONNA (CA)
    12     DALLIN, MADONNA LOUISE/STOCK
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    16     MIRWAIS AHMADZAI, MADONNA
    17     MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
    18     MADONNA (CA),CICCONE
    
    Expected output :
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    18     MADONNA (CA),CICCONE
    ..
    ..
    ..
    ..
    ...
    If the user makes a search with "MADONNA", I view the results as title begins with "MADONNA" first then the rest of the records.
    Please let me know is possible to show the results in this order.


    Kind regards
    Rajasekhar

    This can be a little more specific:

    SQL> SELECT *
      2  FROM   TEST
      3  WHERE  INSTR (TITLE, 'MADONNA') > 0
      4  ORDER  BY INSTR (TITLE, 'MADONNA')
      5           ,TITLE
      6  ;
    
                  SONGID TITLE
    -------------------- --------------------------------------
                      13 MADONNA
                      14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
                      15 MADONNA (CA)
                      18 MADONNA (CA),CICCONE
                      12 DALLIN, MADONNA LOUISE/STOCK
                      11 CICCONE, MADONNA (CA)
                      17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
                      16 MIRWAIS AHMADZAI, MADONNA
                      10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    
  • How to display the time of growth of the autoextended oracle files?

    Hello

    How to display the time of growth of the autoextended oracle files?

    Hello

    1. do you have re - seen view data dictionary in the oracle documentation?

    DBA_DATA_FILES

    dba_free_space

    dba_Tablespaces

    -Regarding (updated)

    DBA_HIST_SEG_STAT

    DBA_HIST_SNAPSHOT

    DBA_TABLESPACE_USAGE_METRICS

    DBA_HIST_TBSPC_SPACE_USAGE

    2. If not, then re - discovers once and understand the use of columns and build the query.

    3. If Yes, then why you have not tried to build queries

    4. again, if you're lazy, search in google or forums. ton of translates queries

    5. What are the disadvantage of step 4 - you will not get to learn something (0% gain of knowledge).  If you really want to learn, then try to learn to build query, and try to understand the views of data dictionary

    6. When you spend above task at the end of the task you will get satistided with two things

    --> Understand how to use the Oracle docs for help and where to look in the future

    --> Your skills / knowledge gain - trust me it will make you another step to learn new things.

    7. If you don't know SQL, learn the basics takes hardly 2 to 3 hours and then you can build query.

    It may be useful

    -Pavan Kumar N

  • How to display the parameter string registered by DBMS_XMLINDEX?

    This is probably a stupid question, but I can't seem to find any function to display the setting of a parameter string that was recorded by DBMX_XMLINDEX. REGISTERPARAMETER.

    For example,.

    If I have:
    BEGIN
    DBMX_XMLINDEX.REGISTERPARAMETER('indexParam', 'xxxxxxxx');
    END;
    /
    How to display the value of 'indexParam' after creation?
    SQL> set long 1000
    SQL>
    SQL> select paramstr
      2  from xdb.xdb$xidx_param_t
      3  where param_name = 'MYINDEXPARAM'
      4  ;
    
    PARAMSTR
    --------------------------------------------------------------------------------
    PATH TABLE po_ptab
        PATH ID INDEX po_pidx
        ORDER KEY INDEX po_oidx
        VALUE INDEX po_vidx
        PATHS(NAMESPACE MAPPING(xmlns:p="http://www.example.com/IPO"))
        GROUP MASTERGROUP XMLTABLE PO_TAB
        ('/p:PurchaseOrder'
            COLUMNS
               REFERENCE VARCHAR2(30) PATH 'p:Reference',
               REQUESTOR VARCHAR2(30) PATH 'p:Requestor' )
        GROUP ITEMGROUP XMLTABLE ITEMGROUP_TAB
        ('/p:PurchaseOrder/p:LineItems/p:LineItem'
            COLUMNS
               LINENUMBER NUMBER(38) PATH '@p:ItemNumber',
               QUANTITY NUMBER(38) PATH '@p:Quantity',
               DESCRIPTION VARCHAR2(256) PATH 'p:Description')
     
    

    After you add it to an index, you can also view the content in USER_XML_INDEXES. PARAMETERS (XML format).

Maybe you are looking for

  • Satellite Pro M50 - no sound

    Hello I hope someone can help me! I recently bought my M50 and it has been fine until last night when since then, there has been no noise. No CD or internet, etc. I checked to make sure all volume controls are on and not on mute and made a diagnosis

  • Re: Need drivers XP for Satellite A210-111

    HelloI'm french and I deleted Vista for XP Pro. But there are a few problems:I can't find drivers for ATI X 1200, the sound card and the touchpad. People can you help me? THX A LOT

  • HP Mini 110: hp mini 110 factory password

    29/04/13 Hello I have a hp mini 110 that crashes at startup and wrote Enter the current password now: After 3 entries, it stops with CNU9451LP7 Please help me. I'm at my wits end I have important data on this machine. Thank you.

  • Firewall does not block the pseudonyms

    My problem is exactly that. I have windows Vista Home Basic and aol 9 1 vr. no probs with internet explorer. uninstalled and reinstalled aol doz times. When I use my pseudonyms I get to aol, but cannot access all sites and lost my favorites.  Yet whe

  • What is the safest way to get back to Windows 7 from Windows 10?

    Windows 7 Edition Home Premium.  Open windows yesterday and it is automatically upgraded to Windows 10. To my dismay, some of the files just disappeared. I do have Windows 10!   What is the safest way to get back to Windows 7?   Restore help?