Compilation with SQL * more

Hello world

I am sure it is a simple and can someone help me:

In other projects, I've always used TOAD or similar tools to compile my PL/SQL code, but with this project I have only SQL * more then when I run 'CREATE PROCEDURE '.... "I just get the message ' Warning: function created with compilation errors.

I'm sure that compiling information are written in a table somewhere or maybe can be displayed directly in the SQL * more window (maybe there an option or the indicator "Compile"?) and so I hope someone can point me to a good HOWTO or give me one or two keywords that I can google under?

Thank you very much
Alan Searle

Use

display errors

or user_errors

SQL> create or replace procedure p1 is
  2  begin
  3   null
  4  end;
  5  /

Warning: Procedure created with compilation errors.

SQL> show errors
Errors for PROCEDURE P1:

LINE/COL ERROR
-------- -----------------------------------------------------------------
4/1      PLS-00103: Encountered the symbol "END" when expecting one of the
         following:
         ;
         The symbol ";" was substituted for "END" to continue.

SQL> select text from user_errors
  2  where name = 'P1';

TEXT
--------------------------------------------------------------------------------
PLS-00103: Encountered the symbol "END" when expecting one of the following:

   ;
The symbol ";" was substituted for "END" to continue.

Tags: Database

Similar Questions

  • Connection with SQL * more is not possible

    Hello together,

    I have a problem with my database and SQL Plus.

    I can't connect to my DB via SQL Plus, I get the error message: > > ORA_12546: TNS: detonation verweigert (Permission denied) < <.

    I tried it with several users. When I try to log in to enterprise manager or connecting to the DB through SQL Developer works very well with the user > > sys < <, only the SQL more connection does not work.

    It works until yesterday that there are some problems with the DB and the processor and RAM were almost 100% occupied each.


    We use the Version 11 g Enterprise Edition Release 11.2.0.1.0 64 bit Production on a Windows Server 2008 R2 Enterprise Server.

    I am running SQL Plus, Enterprise Manager and SQL Developer directly on the DB server.

    When I start SQL Plus he asks me my username > > enter user name: < < and after that my password: > > password: < <.

    A connection as seen in many forums or document on the internet like > > scott/tiger@ORCL < < never worked on my system, which is also confused me.


    We have no listener.ora file in the folder: ORACLE_HOME/NETWORK/ADMIN only a sqlnet.ora with line > > SQLNET. AUTHENTICATION_SERVICES = (NTS) < < in it.



    Status of the listener:

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

    C:\Windows\System32 > lsnrctl status

    LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 18 February 2014 12:14:32

    Copyright (c) 1991, 2010, Oracle.  All rights reserved.

    Connection to (ADDRESS = (PROTOCOL = tcp)(HOST=) (PORT = 1521))

    STATUS of the LISTENER

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

    Alias LISTENER

    TNSLSNR for Windows 64-bit version: Version 11.2.0.1.0 - Production

    Start date February 18, 2014 10:15:54

    Uptime 0 days 1 hour 58 minutes 42 seconds

    Draw level off

    Security ON: OS Local Authentication

    SNMP OFF

    O:\app\administrator\diag\tnslsnr\QualisysDbNbg\listener\alert\log.XML log listener

    Summary of endpoints listening...

    (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=QualisysDbNbg) (PORT = 1521)))

    Summary of services...

    Service "orcl" has 1 instance (s).

    Instance "orcl", State LOAN, has 1 operation for this service...

    The command completed successfully

    C:\Windows\System32 >

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


    I hope someone can help me with this problem.


    Thank you you very much in forward for your answerand greetings

    Matthias


    The sys user must connect as sysdba

    have you tried

    sqlplus 'sys@ORCL as sysdba'

    or

    sqlplus 'sys/yoursyspwd@ORCL as sysdba'

    the first command should work without password for all users group ORA_DBA.

    Scott, the user cannot also exists in your database.

  • Connection to the 11g on Oracle_Developer_Days.ova with sql + more

    I downloaded the Oracle_Developer_Days.ova and have confirmed with connectivity

    C:\Users\robm > ping ServeurOracle

    ServeurOracle ping [192.168.11.18] with 32 bytes of data:

    Reply from 192.168.11.18: bytes = 32 time < 1 ms TTL = 64

    Reply from 192.168.11.18: bytes = 32 time < 1 ms TTL = 64

    Reply from 192.168.11.18: bytes = 32 time < 1 ms TTL = 64

    Reply from 192.168.11.18: bytes = 32 time < 1 ms TTL = 64

    Ping statistics for 192.168.11.18:

    Packets: Sent = 4, received = 4, lost = 0 (0% loss),

    Time approximate round trip in milli-seconds:

    Minimum = 0ms, Maximum = 0ms, average = 0ms

    C:\Users\robm >

    I have advanced and installed the client instant and also installed the sql + more

    C:\Users\robm > sqlplus scott/tiger@orcl

    SQL * more: Production of the 12.1.0.1.0 on sat Nov 30 00:27:44 version 2013

    Copyright (c) 1982, 2013, Oracle.  All rights reserved.

    ERROR:

    ORA-12514: TNS:listener is not currently of service requested in connect

    descriptor of

    Enter the user name:

    Here the tnsnames.ora can, I did you see errors?

    XRACQ_MYSERVICE_TAF =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = oracleserver) (PORT = 1521))

    (LOAD_BALANCE = yes)

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = orcl)

    (FAILOVER_MODE =

    (TYPE = SELECT)

    (METHOD = BASIC)

    (RETRIES = 180)

    (DELAY = 5)

    )

    )

    )

    any ideas on how to make it work?

    I now get

    ORA-01017: name of user and password invalid. connection refused

    using tsnames.ora

    WEIRD =.

    (DESCRIPTION =

    (ADDRESS_LIST =

    (ADRESSE = (PROTOCOL = TCP) (HOST = 192.168.11.18)(PORT = 1521)))

    (CONNECT_DATA =

    (SERVICE_NAME = orcl)

    )

    )

    so I seem to connect now... . How can scott Tiger be wrong isn't the default?

  • Connect to the database with SQL * more: is TNSNAMES. ORA used?

    Hello

    We have a local database called DEV01 and a copy of this database in a data center. To be able to connect to both databases, the TNSNAMES file. ORA

    on the local database server (not the one in the data center) has the following entries:

    / * Entry for the local database * /.

    DEV01_local, DEV01_local. WORLD =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = server01) (PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SID = DEV01)
    )
    )

    / * Entry for the database in the data center * /.

    DEV01, DEV01. WORLD =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = server02) (PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SID = DEV01)
    )
    )

    When I connect to the local database server, I set the Oracle environment as follows:

    export ORACLE_SID = DEV01

    export PATH=/opt/oracle/app/oracle/product/9.2.0/bin:$PATH

    export ORACLE_HOME=/opt/oracle/app/oracle/product/9.2.0

    Now I start SQL * more as follows:

    Oracle # > sqlplus user/user

    SQL > select instance_name, host_name from v$ instance;

    INSTANCE_NAME HOST_NAME

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

    SERVER01 DEV01

    As the SID is on two databases of the same (DEV01) I really don't understand how Oracle decides which of the SQL databases * more connects to.

    Is it the entry in the TNSNAMES file. ORA?

    But when I start SQL * more as follows:

    Oracle # > sqlplus user/user@DEV01_local

    SQL > select instance_name, host_name from v$ instance;

    INSTANCE_NAME HOST_NAME

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

    SERVER01 DEV01

    or

    Oracle # > sqlplus user/user@DEV01

    SQL > select instance_name, host_name from v$ instance;

    INSTANCE_NAME HOST_NAME

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

    DEV01 server02

    everything is as expected.

    Does anyone know who is the chosen database when just to connect with 'sqlplus user/user' (without the @DEV01 or @DEV01_local)?

    Any help will be appreciated!

    Rgds

    Jan

    When you connect to the local database that is connected to the server01, you need only specify the sid in the environment, in this case, Oracle tnsnames file to connect, actually uses, it uses any of the listener.  It uses what is called a connection needed.  It is purely a side connection server, and as long as the sid is located in the environment resolves to a database running on that server, you will be get connected.

    When you connect using the @connect_descriptor, like you second case, then Oracle will use the configured naming, including tnsnames, methods to solve the 'real' database  In this case, the auditor is required to create the connection to the database.

    John

  • Unable to connect to an instance by using EM but properly connect with SQL * more

    Hello

    I followed the following steps (from the document s/n 2 days):

    1. I created a model (including the database) to an instance named "orcl" using DBCA, before we proceed to create the model, DBCA informed me that the Forum might be stopped, I told him to go ahead.

    2. the model has been successfully created.

    3. I am now unable to connect to the instance orcl using EM, but I can connect to this instance without any problem using SQL * more.

    Question: Why am I not able to connect to the instance by using EM? and what should I do to fix this?

    Thank you very much for your help,

    John.

    PS: in case it may be useful, the listener tnsnames and Sqlnet files follow:
    # listener.ora Network Configuration File: E:\Oracle\product\11.2.0\dbhome_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = CLRExtProc)
          (ORACLE_HOME = E:\Oracle\product\11.2.0\dbhome_1)
          (PROGRAM = extproc)
          (ENVS = "EXTPROC_DLLS=ONLY:E:\Oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
        )
      )
    
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
          (ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE2DAY1)(PORT = 1521))
        )
      )
    
    ADR_BASE_LISTENER = E:\Oracle
    # tnsnames.ora Network Configuration File: E:\Oracle\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    
    DBCA =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE2DAY1)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = dbca.localsite.com)
        )
      )
    
    ORACLR_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
        )
        (CONNECT_DATA =
          (SID = CLRExtProc)
          (PRESENTATION = RO)
        )
      )
    
    LISTENER_ORCL =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE2DAY1)(PORT = 1521))
    
    
    ORCL =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE2DAY1)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = orcl.localsite.com)
        )
      )
    # sqlnet.ora Network Configuration File: E:\Oracle\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
    # Generated by Oracle configuration tools.
    
    # This file is actually generated by netca. But if customers choose to 
    # install "Software Only", this file wont exist and without the native 
    # authentication, they will not be able to connect to the database on NT.
    
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

    I think you change some configuration of your system as domain/IP address/host name.
    You need

    set ORACLE_SID=orcl
    emca -deconfig dbcontrol db -repos drop
    emca -config dbcontrol db -repos create
    

    then after result

  • Problem with sql * more

    Hi there, please help me! Here's the problem: I do exercise 3.1 (pag. 54) of the book "Hands on oracle db 10g express edition for windows" but

    (1) if I use Sql * Plus, once it executes all the script sql command * more session closed.

    (2) if I use cmd, I have this problem

    http://i982.Photobucket.com/albums/ae308/Tbeker/1-1958.jpg

    http://i982.Photobucket.com/albums/ae308/Tbeker/2-5.jpg

    Cuold help you my guy? I don't understand why the table does not exist!

    Thank you very much!

    Hi clcarter, finally I understood the problems:

    (1) on my pc the date of oracle XE is expressed as "Giu-DD-YYYY' because I'm Italian, but in the exercises in the book, the date is in English"JUN-DD-YYYY "; (ORA-01843: not one month valid);

    (2) I don't understand the reason but in the exercises, tables or values have been inserted without the "SCHEMA" and the "orders" table was so not all values (error ORA-00942: table or view does not exist);

    Now, after a separation of headaches, I can't continue, thank you for your help!

  • Other new lines in SQL script file and problem with SQL * more

    Hi all


    I would like to ask a question on the characters of new line inside files SQL scripts. I have a very long SQL query, stored in a file txt (ANSI encoding). Because query instructions are very long (several table joins and WHERE conditions) tried to separate, WHERE and ORDER BY clauses by inserting several new characters of lines (just hit the entrance) among them in order to improve the clarity of the source code. Now the problem is, whenever these newline characters are inserted in the file, apparently SQL * Plus cannot parse the file properly and gives me the following error message:
    SP2-0042: unknown command "FROM" - rest of line ignored.
    SP2-0734: unknown command beginning "myenterpri..." - rest of line ignored.
    The problem is definitely related to these new line because characters that when I remove them, the scripts runs without any problem. I would appreciate that you could kindly guide me how should I deal with this problem. Is there any SQL * Plus command to run to correctly interpret the new line characters?


    Thanks in advance,


    Kind regards
    Dariyoosh

    Hello

    In [SQL * Plus 9 | http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1013073] (and), you can tell

    SET     SQLBLANKLINES   ON
    

    allow to completely empty rows in an SQL statement.

  • BECAUSE a node: when to stop through SQL * more...


    Hello

    I installed a CCR node for the first time and playing with it to get better knowledge. The underlying cluster has two nodes, call them the Node_A and node_b.

    The cluster database itself is called upon to DEVELOP, DEVELOP_1 instance is running on the node Node_A, instance DEVELOP_2 is supposed to work on node_b. The preferred node is

    NŒUD_A.

    When testing database online relcation everything works as expected: DEVELOP_1 instance Gets the stop on Node_A node - instance DEVELOP_2 is started on node_b.

    But what closing instance DEVELOP_1 on Node_A with SQL * more I was surprised of the result:

    -C' is not instance DEVELOP_2 which began on node_b - it was DEVELOP_1 for instance!  (Because of this my control sews has changed - but is not the issue of this discussion).

    Now my questions are:

    -is the clusterware responsible for the DEVELOP_1 instance on node_b startup behavior when I stop instance DEVELOP_1 down on Node_A via SQL * more?

    - and if this behavior is documented? I went through the RAC documentation node, but could not find something useful

    Any help will be appreciated.

    Rgds

    Jan

    Hi Jan,

    Yes, its expected behavior in a node of the FCAC, please consult the document below.

    "Oracle Real Application Clusters one node Overview" (Page 1) (relocation of the database online)

    http://www.Oracle.com/technetwork/products/Clustering/overview/TWP-rac1nodev1-1-130698.PDF

  • Problem with the new line when you manually run a procedure in SQL * more

    The procedure below works fine in SQL * more when all EXEC < procedure_name > (parameter1, parameter 2,...); is placed on a single line
    SQL > exec cust_admin_util.create_schema (P_SCHEMA_NAME => 'SCOTT_01', P_SCHEMA_PWD => 'scott123', P_TBS_NAME => 'TRAG_TBS', p_temptbs_name => 'TEMP' );
    
    PL/SQL procedure successfully completed.
    I wanted to perform the same procedure with readability. So, I put each parameter on a separate line and try to run. But it's the slightest mistake out.
    SQL > exec cust_admin_util.create_schema
    (
    P_SCHEMA_NAME => 'TESTUSR_01',
    P_SCHEMA_PWD => 'scott123',
    P_TBS_NAME => 'TRAG_TBS',
    p_temptbs_name => 'TEMP'
    );BEGIN cust_admin_util.create_schema; END;
    
          *
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'CREATE_SCHEMA'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    
    
    SQL >   2    3    4    5    6    7
    P_SCHEMA_NAME => 'TESTUSR_01',
    *
    ERROR at line 2:
    ORA-00928: missing SELECT keyword
    No work around for this?

    Tom wrote:

    No work around for this?

    BEGIN
    cust_admin_util.create_schema
    (
    P_SCHEMA_NAME => 'TESTUSR_01',
    P_SCHEMA_PWD => 'scott123',
    P_TBS_NAME => 'TRAG_TBS',
    p_temptbs_name => 'TEMP'
    );
    END;
    /
    

    SY.

  • Question on the definition of the width of column in SQL * more with information recovered w SQL

    Hello

    Is there a way to tell SQL * more to set the width of a column with the largest width of the items in the column? (as opposed to the default which is declared in the DDL width)

    In other words, I would like to do something functionally equivalent to this:

    COL < columname > format [select max (length (< columnname >)) < thetablethatcontainscolumname >]

    I do above manually in two steps

    1. select max (length (columnname)) of...

    2 col columnname format a [resultofstep1]

    Is it possible to do in one step?

    Thank you for your help,

    John.

    Hi John

    I don't think that there is a way to do this, because this information is not known at run time (as you proved it, you must run a separate SQL query first to calculate that information - also, what happens if there are predicates, this could affect the defined result so the request will actually be performed twice). You may decide an arbitrary width for each column and set it as being wrapped/word_wrapped/truncated.

    Other that that, you should consider whther you are using the right tool for the job, SQLplus is not exactly ideal for the presentation layer stuff. Something like APEX would give you much more control over the layout and formatting.

    See you soon

    Ben

  • SQL with parameter in SQL more value

    Hi the master Oracle,


    I have a request as described below that you run on SQL more.


    Select object_name, object_type from USER_OBJECTS WHERE last_ddl_time between trunc (sysdate)-1 and sysdate;


    I tried this script to be set, when I run it then SQL should ask two values.
    If I do not give any value then script should use by default as SYSDATE.

    Someone could please let me know how to do this?



    Kind regards
    Sandeep Sutar
    select object_name
          ,object_type
      from user_objects
    where trunc(last_ddl_time) between trunc(to_date(nvl(&1,sysdate))) -1 and to_date(nvl(&2,sysdate))
    
  • Compile with stored procedure errors

    Hi guys, I just start SQL so forgive me if I ask stupid questions real. That's the problem I have right now, as I said in my title.

    It's my procedure.sql

    CREATE OR REPLACE PROCEDURE check IS

    no_of_duplicates NUMBER: = 0;

    BEGIN

    SELECT COUNT (*) IN no_of_duplicates

    THE EMPLOYEE

    WHERE E # =.

    (select E # PILOT)

    WHERE THERE ARE

    (SELECT E # MECHANIC)

    WHERE DRIVER. L # = MECHANIC. L#));

    IF no_of_duplicates: = 0 THEN dbms_output.put_line ('OK');

    ON THE OTHER

    SELECT E #, NAME OF THE EMPLOYEE

    WHERE E # =.

    (SELECT E # PILOT)

    WHERE THERE ARE

    (SELECT E # MECHANIC)

    WHERE DRIVER. L # = MECHANIC. L#));

    END IF;

    END check;

    /

    While trying to create the procedure, it gives me compilation errors. I took with this for hours and can't seem to find anything wrong with it. Can someone point me in the right direction? Thank you!

    Hello

    Once again, your postal code.  The error occurs when you call the procedure, but you have not posted the code that calls the procedure and causes the error.

    When I do this in SQL * more:

    SET SERVEROUTPUT ON ENCAPSULATED FORMAT
    EXEC check;

    The procedure that you have posted works perfectly (i.e., displayed the e # is, exactly as it was designed to do).

    Display the e # and the name consists of BULK COLLECT both the e # name in separate collections, like this:

    CREATE OR REPLACE PROCEDURE check IS
    TYPE e #_table IS the TABLE OF THE employee.e#%TYPE;
    e # e _list #_table;

    TYPE name_table IS TABLE OF THE employee.name%TYPE;
    name_list name_table;
    BEGIN
    SELECT e #, name
    E LOOSE COLLECTION #_list, name_list
    The EMPLOYEE
    WHERE e # (IN)
    SELECT d.e #.
    DRIVER d
    JOIN m mechanic ON d.e # m.e = #.
    );
    E IF #_list. COUNT = 0
    THEN
    dbms_output.put_line ('OK, there without duplicate of illict");
    ELSE - that is to say, e #_list. COUNTY <> 0
    dbms_output.put_line (' the following employees are drivers and mechanics :');)
    J IN 1.e #_list. COUNTY LOOP - I displays parentheses sometimes hard on the OTN site
    dbms_output.put (TO_CHAR (e #_list (j)))
    '999999999999'
    )
    );
    dbms_output.put (' ');
    dbms_output.put_line (name_list (j));
    END LOOP;
    END IF;
    END check;
    /
    DISPLAY ERRORS

    This is the result I get when I run the procedure above with your sample data:

    The following employees are drivers and mechanics:

    1 John Smith

    You will notice I did several other changes in your code, sometimes because they are much more practical and sometimes just to show you different ways to do the same thing, that you may or may not want to use in this problem.

    For example, you were doing the same query (with only very slight differences) 2 times: once to get the no_of_duplicates and then a second time to get the actual data.  I don't know if it's the most effective way to do what you need.  Say that there are 1000 rows in the result.  You get all the 1000 once just to get the total number (that you do not need, if all you worry at this point is if there is), then to get the data.  When you make a COLLECTION in BULK, you get automatically the COUNTY anyway, so why not not COLLECTING in BULK, and then use this count to see what to do next.  If the NUMBER is greater than 0, then you already have the data, and you do not need to fetch it again.  In addition, repeating (essentially) the same code is a maintenance problem.  If you need to make a change, you must make the same change to several places.  At best, it's a pain; but it is the exactly the kind of mistake that is easy to miss in trials, and you could have the code that runs for weeks in Production before you notice that it sometimes gives false results.

    Another example: e # is a NUMBER.  If it is possible to convert numbers in VARCHAR2s and save these VARCHAR2s in a VARCHAR2 collection, would be unwise more just to store them in a collection of NUMBER?

  • Same code running in SQL * more edit the sql buffer vs = different results file

    Hello

    For the last few minutes I was scratching my head trying to understand why my little piece of code was not working.
    As a result, a sample:
    create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
    /
    declare
      booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');  
    begin
      for i in booklist.FIRST .. booklist.LAST LOOP
        dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      end loop;
    end;
    /
    When run interactively, I get the following results:
      1  create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
      2  /
      3  declare
      4    booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');
      5  begin
      6    for i in booklist.FIRST .. booklist.LAST LOOP
      7      dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      8    end loop;
      9* end;
    SCOTT@ORCL> /
    
    Warning: Type created with compilation errors.
    
    SCOTT@ORCL> show errors
    Errors for TYPE BOOKTITLES_NT:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    2/1      PLS-00103: Encountered the symbol "/"
    So I try without the slash and get nowhere:
      1  create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
      2  declare
      3    booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');
      4  begin
      5    for i in booklist.FIRST .. booklist.LAST LOOP
      6      dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      7    end loop;
      8* end;
      9  /
    
    Warning: Type created with compilation errors.
    
    SCOTT@ORCL> show errors
    Errors for TYPE BOOKTITLES_NT:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    2/1      PLS-00103: Encountered the symbol "DECLARE"
    8/4      PLS-00103: Encountered the symbol "end-of-file" when expecting
             one of the following:
             ( begin case declare end exception exit for goto if loop mod
             null pragma raise return select update while with
             <an identifier> <a double-quoted delimited-identifier>
             <a bind variable> << continue close current delete fetch lock
             insert open rollback savepoint set sql execute commit forall
             merge pipe purge
    So I think, maybe I'll try it in a .sql file. So I put the first fragment of code in a file, test4.sql:
    SCOTT@ORCL> get C:\Users\J\Documents\SQL\test4.sql
      1  create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
      2  /
      3  declare
      4    booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');
      5  begin
      6    for i in booklist.FIRST .. booklist.LAST LOOP
      7      dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      8    end loop;
      9* end;
    SCOTT@ORCL>
    and run it, and it works:
    SCOTT@ORCL> @C:\Users\J\Documents\SQL\test4.sql
    
    Type created.
    
    Book number 1:Great Expectations
    Book number 2:Ulysses
    Book number 3:1984
    
    PL/SQL procedure successfully completed.
    Can someone tell me why the behavior is different when it is run from a file when it is run, well, interactive? There seems to be some limits on what you can interactively run vs. what you can run from a script.

    Thank you very much
    Jason

    SQL * more buffer cannot contain more than one return, even if you have two - create type and anonymous PL/SQL block. Thus it-error:

    Wrote file afiedt.buf
    
      1  create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
      2  /
      3  declare
      4    booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');
      5  begin
      6    for i in booklist.FIRST .. booklist.LAST LOOP
      7      dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      8    end loop;
      9* end;
    SQL> /
    
    Warning: Type created with compilation errors.
    
    SQL> create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
      2  /
    
    Type created.
    
    SQL> declare
      2    booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');
      3  begin
      4    for i in booklist.FIRST .. booklist.LAST LOOP
      5      dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      6    end loop;
      7  end;
      8  /
    Book number 1:Great Expectations
    Book number 2:Ulysses
    Book number 3:1984
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    SY.

  • Privileges differ between SQL * more and stored procedure

    A user with the dba role can access dba_role_privs. But this is not possible in a stored procedure created by the same user.
    Normally, the example should work fine
    But with Oracle XE 11.02 - cost free database with some limitations - I get error 942

    I show a simple example in SQL * more:

    SQL > r
    1 * select distinct dba_role_privs recipient where the recipient as "SY %.

    DEALER
    ------------------------------
    SYSTEM
    SYS

    SQL > create or replace procedure x as
    2 start
    3 for rec in (select distinct dba_role_privs dealer where the beneficiary as 'SY %')
    4 loop
    5 zero;
    6 end of loop;
    7 end;
    8.

    Warnung: Prozedur wurde mit Kompilierungsfehlern standing.
    English translation: procedure created with compilation errors

    SQL > show error

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    3/14 PL/SQL: statement ignored
    3/43 PL/SQL: ORA-00942: table or view does not exist
    SQL >

    How can I fix?

    Why do you think the example should work properly?

    Normally, regardless of the version, the privileges granted through roles (such as DBA) not available for stored procedures. Stored procedure of a DEFINER rights can only take advantage of the privileges granted directly to the owner of the procedure. Stored procedure of the invoker rights can enjoy privileges granted by a role, but that requires that the appellant has independent privileges to query the table in question (and, in this case, would require dynamic SQL usage).

    Generally, the simplest approach would be to grant the privilege to CHOOSE ANY DICTIONARY to the owner of the procedure.

    Justin

  • Compile with java7 succeedes, but fails with java8

    When you change the executable compiler of java7 (1.7.0_80) at java8 (1.8.0_60), I get a compilation error:

    Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failed

    D:\data\scm-workspace\ParAd\dev\ParAd\src\main\java\de\contiteves\parad\application\dialog\ParadDialog.Java:[32,12] error: cannot access HelpProvider

    at org.apache.maven.plugin.AbstractCompilerMojo.execute (AbstractCompilerMojo

    the project compiles without error using the java7 executable compiler

    The source code has not changed. the error disappears when returning to the java7 compiler executable.

    Please see the attached logs for more details.

    The problematic class
    comes from oracle-Help jar:

    helpproviderlocation.png

    How can I make my request compilable with Java8?

    The solution was to replace the help.jar from former JDev - 9.0.4.3 with JDev version - 12.2.x

    Good bye

    DPT

Maybe you are looking for

  • I already have a wireless router...

    I already have a router provided by my ISP. Can I use my Airport Time Capsule to act as an external hard drive wireless and run time capsule without changing my current router? JB

  • Computer is slow

    My computer is running very slowly, I ran a virus and malwares and they seem to look ok.  I saw that some people were running an Etrecheck, so I thought I give it a shot. EtreCheck version: 2.9.3 (253) Report generated 2016-02-11 10:41:39 Download Et

  • Re: Satellite A300-1MO - can I use any Toshiba Recovery disk?

    I have an A300-1 MB.Can I use any Toshiba Recovery disk?Or is it as a specific for my A300-1 MB? I'm like a total noob...Someone pls help...!

  • ThinkPad x 230 problem

    Hello I start my laptop, after he gives me eye pic "Boot Menu" screen I click on enter it remains on the same screen. Please, do you have the solution? Thank you http://img4.hostingpics.NET/pics/331432IMG0259.jpg

  • I reinstalled a vista virsion and need to know how to remove the old

    I have this computer to someone else, he had to remove his virsion of Vista so I could recharge mine. When I loaded mine, its has no dispear. WHN I boot the system askes me whioch one I want ot load. However, if I click on hidden it tells me I have n