PL/SQL Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: PL/SQL

  1. #1
    Join Date
    Aug 2000
    I am trying to run the following script from the sql plus prompt.

    select 'File created '||to_char(sysdate, 'dd-Mon-YYYY hh24:mm:ss')
    from dual;
    target_dir varchar2(100) := 'd:\oracle\backups';
    source_file varchar2(100) ;
    ts_name varchar2(100);
    prev_ts_name varchar2(100);
    cursor mycur is
    select file_name, lower(tablespace_name)
    from sys.dba_data_files
    where instr(file_name, 'temp') = 0
    order by 2;

    I get the following error messages:

    ORA-00900: invalid SQL statement
    source_file varchar2(100)
    ORA-00900: invalid SQL statement
    ts_name varchar2(100)
    ORA-00900: invalid SQL statement
    prev_ts_name varchar2(100)

    Is it possible to run this plsql script from the sql+ prompt or does it need to be treated differently.

  2. #2
    Join Date
    Jul 2000
    remove the BEGIN before the DECLARE.

  3. #3
    Join Date
    Oct 2000

    Thumbs up

    Make sure the sections are correctly setup, i.e.
    "declare" section normally before "begin... end" section,
    even through may be "multi-nested" "declare" or "begin"
    sections existed.

    take care

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width