How to copy procedure to sql plus window.

I am trying to copy my procedure from note pad to sql plus window and some of the texts are being cut off. How can I copy the entire procedure to sql plus window.
thanks

Thank you guys this is what is happning.
1  CREATE OR REPLACE PROCEDURE  ITEMCUSTOMPAGING(
2        p_desc in itemlist.idescr%type,
3        p_letting in bidlet.datelet%type,
4        p_letting1 in bidlet.datelet%type,  
5       p_sort in  NUMBER ,
6       p_order in VARCHAR ,
7        i_results    out sys_refcursor
8     )
9     AS
10     BEGIN
11        OPEN  i_results  FOR
12         SELECT g.csecnum , e.iplineno , substr(e.eiitem ,1,4)||'.'||substr(e.eiitem ,5,9) ItemNum,
13         INITCAP(i.idescr ||'  '|| e.isupdes)  Descrip,INITCAP(i.idescrl ||'  '|| e.isupdes)  Descrip
14         DECODE (TRIM (p.prroute), NULL, 'N/A',p.prroute) Route,b.datelet  ,trim(to_char(b.datelet ,'
15        FROM itemlist i, estitem e, estcatg g, propproj x, proposal p, bidlet b, letprop l
16        WHERE    p.contid = x.contid AND x.pcn = g.pcn AND e.pcn = g.pcn AND e.cn = g.cn AND i.item =
17        AND i.ispecyr = p.cspecyr AND e.iplineno <> ' ' AND e.eiitem <> '2550601/01000'
18        AND e.eiitem <> '2565601/00031' AND e.eiitem <> '2565601/00032' AND e.eiitem <> '2565601/0003
19        AND e.eiitem <> '2402601/01000'
20        AND (i.idescr  like  TRIM(UPPER(p_desc))||'%'  or  i.idescrl  like  TRIM( UPPER(p_desc))||'%'
21        AND b.datelet  between  p_letting  and p_letting1
22        AND p.contid = l.lcontid
23        AND l.letting = b.letting
24        AND SUBSTR (l.lcontid, 4, 4) <= '5'
25        GROUP BY g.csecnum,i.idescr,b.datelet,i.iunits,p.clocat1,p.clocat2,p.contid,p.cdescr, p.cproj
26        ORDER BY p_sort   p_order;
27* End;
QL> /
arning: Procedure created with compilation errors.
QL> SHOW ERR
rrors for PROCEDURE ITEMCUSTOMPAGING:
INE/COL ERROR
2/8     PL/SQL: SQL Statement ignored
6/25    PL/SQL: ORA-00933: SQL command not properly ended
QL>

Similar Messages

  • How to compile a procedure from Sql*Plus?

    Dear friends,
    I couldnt find the way how to compile my invalid procedure through sql*Plus.
    I know this is very awkward,but I m in need of that command only.
    Thanks
    Ritesh Sharma

    Pls check it --
    SQL>
    SQL>
    SQL> @C:\RND\Oracle\Function\a.sql;
    11  /
    Function created.
    SQL>
    SQL>
    SQL> start C:\RND\Oracle\Function\a.sql;
    11  /
    Function created.
    SQL> Regards.
    Satyaki De.

  • How to execute the parametered stored procedure in sql *plus ?

    how to execute the parametered stored procedure in sql *plus ?
    my storedprocedure format
    CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE
    (empDOB out date, empEmpName out varchar2)
    thanks & regards
    mk_mur

    Oh, sorry... making many reading-too-fast mistakes today...
    You can't declare date variables in SQL*Plus (seel help var), but you can cast to varchar2:
    TEST> CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE (empDOB out date, empEmpName out varchar2) IS
      2  d date := sysdate;
      3  e varchar2(10) := 'bob';
      4  begin
      5  empdob := d;
      6  empempname := e;
      7  end;
      8  /
    Procedure created.
    TEST> var d varchar2(30)
    TEST> var n varchar2(30)
    TEST> call  SMS_SELECTMPLOYEE(:d,:n);
    Call completed.
    TEST> print d n
    D
    11/07/06
    N
    bobYoann.

  • How to pass Unix environment variable to a SQL procedure or SQL * Plus

    Can any body suggest me how to ,
    How to pass Unix environment variable to a SQL procedure or SQL * Plus file..
    I am trying to invoke a SQL Procedure from Unix
    by passing the value of a Unix environment variable.
    Is it possible..?
    Thanks in advance.
    Regards,
    Srinivas Jaltaru

    Within your shell script you can use what is known as a "here document" which is basically a way of wrapping a call to Oracle. The following call to Oracle loops and writes rows to files with numerically increasing file names. Two unix shell variables are used, one in a select statement and one in a spool command :
    <pre>
    #!/bin/bash
    export ORACLE_SID=DEV05
    FILENO=1007351
    while [ ${FILENO} -le 1008400 ]
    do
    FILENAME=farm_${FILENO}.txt
    DUMMY=`sqlplus -s user20/user20 <<SQLSTOP
    set lines 73
    set pages 0
    set head off
    set termout off
    set echo off
    set feedback off
    select rpad(searchx, 8)
    from blastx@PRODUCTION
    where searchx = ${FILENO} ### here's a shell variable
    spool /export/home/user20/sql/psiblast/BACKUP2_D/${FILENAME} ### here's a shell variable
    spool off
    SQLSTOP`
    FILENO=`expr ${FILENO} + 1`
    done
    exit 0
    </pre>

  • How to view  a stored procedure from sql plus

    Can anyone please tell what is the command for viewing the content of the stored procedure from sql plus ?
    Thanks

    Hi,
    I use this simple script to retrieve.......
    EDTRAD@T_E_S_9-->l
    1 select text from all_source where name = 'GET_MAN' -- proc name here
    2* order by line asc
    EDTRAD@T_E_S_9-->/
    TEXT
    FUNCTION get_man (in_man SSBOSS.CLNTWORK.manager%type)
    RETURN varchar2 IS
    CURSOR get_man(in_man SSBOSS.CLNTWORK.manager%type) IS
    SELECT name
    FROM ssboss.clntwork
    WHERE agency = 'TM'
    AND manager = in_man
    AND manager is not null
    AND manager != '**OB**';
    v_man SSBOSS.CLNTWORK.name%type := null;
    BEGIN
    OPEN get_man(in_man);
    FETCH get_man INTO v_man;
    IF get_man%notfound THEN
    v_man := 'Manager Not Found !';
    RETURN (v_man);
    CLOSE get_man;
    END IF;
    RETURN (v_man);
    CLOSE get_man;
    END;
    21 rows selected.
    EDTRAD@T_E_S_9-->

  • Copy command for SQL*Plus

    Am trying to use the copy command in SQL*Plus to copy a table
    from an Oracle database to a local table on my machine in
    another format. Keep getting errors. It seems to contact the
    remote machine fine, but can't locate my local machine or figure
    out where to put it. Any suggestions on how to set up my
    Windows 95 machine to get the copy command working would be
    greatly appreciated. Thank you.
    null

    Hi,
    Here is an example :
    SQL> copy from scott/tiger@q4_production_server create ord -
    using select * from ord;Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    Table ORD created.
    21 rows selected from scott@q4_production_server.
    21 rows inserted into ORD.
    21 rows committed into ORD at DEFAULT HOST connection.
    Hope this helps,
    Bala
    Laura Michaels (guest) wrote:
    : Am trying to use the copy command in SQL*Plus to copy a table
    : from an Oracle database to a local table on my machine in
    : another format. Keep getting errors. It seems to contact the
    : remote machine fine, but can't locate my local machine or
    figure
    : out where to put it. Any suggestions on how to set up my
    : Windows 95 machine to get the copy command working would be
    : greatly appreciated. Thank you.
    null

  • Copying text in Sql*Plus

    I seem to be unable to copy and paste text using the "highlight text and right-click" procedure in Sql*Plus 8.0.6.0.0. The right-mouse button seems to work in everything else so it doesn't seem to be the mouse that is the problem. Does anybody know if this could be due to the way Sql*Plus is set up or some other Oracle related problem?

    You can either do SET PAGESIZE 0 which turns off all headings.
    Of you can do SET PAGESIZE 50000 which will reprint the headings every 50,000 lines.
    50,000 is the max. I don't know of a way to show the headings once, and only once. (you can turn off headings and fake them one time with a select ... from dual before your main query).

  • Testing stored procedure using sql plus

    I'm attempt to create and test a stored procedure in sql plus.
    I enter:
    create procedure sp_getconfiguration(mygroup in char, myparameter in char, myvalue in out char) as begin select configvalue into myvalue from tblconfiguration where configgroup = mygroup and configparameter = myparameter; end;/
    I get a procedure created. response by when I type:
    variable myval char
    call sp_getconfiguration('Language','Enabled', myval);
    I get the following error:
    error at line 1:
    ora-06576: not a valid function or procedure name
    I can go into DBA studio and see the procedure listed and can compile it and it says "valid". I have tried granting execute permission to public and trying it again under sql plus and nothing seems to help.
    I'm also attempting to run this same procedure from VB and get an invalid column name error from there.
    Thanks for any help in advance.
    Lee

    Thanks for all your help. What I actually called product support and they helped me solve it. But what I found out is that if using oracle 8.1.# you have to invoke the stored procedure without the "call " in front of the procedure name. For instance.
    sp_getconfiguation()
    In version 9.# it appears that you use the call in front of the procedure. Dah! So if anyone else is having this problem. That is the solution. Thanks anyway.

  • Where's the SQL*Plus Windows GUI?

    Is the SQL*Plus Windows GUI included in XE?

    Thanks, SQL Developer is perfect. It's strange that SQL Developer isn't bundled with Express Edition. SQL*Plus reminds me of Yazoo, big hair and the 1980's.
    Interestingly SQL Developer seems to be very similar to DBVisualizer. Do you know if that's an accident or did Oracle white label DBVisualizer perhaps?

  • How execute this stored procedure from SQL PLUS???

    Hello folks....
    Help me please...
    I have this procedure....
    CREATE OR REPLACE PROCEDURE TEST(COD OUT VARCHAR2, NUM OUT
    VARCHAR2, ID OUT VARCHAR2)
    AS
    BEGIN
    END;
    SO, I4D LIKE TO EXECUTE IT FROM SQL PLUS::
    BUT, I DONT KNOW HOW TO DO..PLEASE SEND ME A SAMPLE..
    THANK U

    Thank u man!!!
    look, my error before was :
    SQL> set serveroutput on
    SQL> declare
    SQL> cod varchar2(100);
    SQL> num varchar2(100);
    SQL> id varchar2(100);
    SQL> begin
    SQL> TEST( cod, num, id );
    SQL> EXEC DBMS_OUTPUT.put_line( cod || ' ' || num || ' ' ||
    id );
    SQL> end;
    SQL> /
    i put the EXEC....
    thank u!!!

  • How to execute procedure in SQL Worksheet ?

    Hi, anybody know, how I can execute procedure here?
    I try EXEC sec_roles, EXEC security_admin.sec_roles, EXECUTE - there is a SQL statement error. When I use CALL - there is no such procedure (I have execute previleges).
    Although in SQLPlus EXEC works, but there are problems with standard SQL commands (all of them returns "2" no matter what content is).
    Any ideas?
    Regards
    Krzysztof

    exec procedure(parameters) is a sql plus (and a few others) shortcut for
    BEGIN
       procedure(parameters);
    END;So try that then pressing/clicking whatever it is in sql worksheet that makes a statement run.
    Note that if your procedure has parameters defined as OUT or IN OUT, you will need to supply a variable to accept the returned value(s).
    John

  • Create table as in procedure vs SQL*Plus between 2 utf8-db's

    I have a 9.2.05 db with charset UTF8 and Polish characters in it. When I extract a table to another 9.2.05 db with UTF8 charset using create table x as selcect * ...
    When I run it in SQL*Plus everything works just fine but when I do the create table as from inside a procedure the national characters are converted to western characters and the length of the record are shorter. Why? How do I get the procedure to work as SQL*Plus does. /Göran

    This sounds strange. Could you show the code of the procedure? Could you double-check that your db link points to the right database? Could you add:
    SELECT VALUE INTO <variable1>
    FROM NLS_DATABASE_PARAMETERS
    WHERE PARAMETER='NLS_CHARACTERSET'
    SELECT VALUE INTO <variable2>
    FROM NLS_DATABASE_PARAMETERS@<dblink>
    WHERE PARAMETER='NLS_CHARACTERSET'
    to your procedure and output the contents of the PL/SQL <variable1> and <variable2>, e.g. using DBMS_OUTPUT, to verify the character sets of the databases?
    -- Sergiusz

  • How to run procedure in sql navigator?

    Hi,
    Can anyone tell me how can i run stored procedures in a package from SQL NAVIGATOR?
    Thank you

    If there are no OUT-Parameters just
    exec <package_name>.<procedure_name>
    as it´s done in SQL*Plus.
    Regards,
    Gerd

  • Issue with new line when manually executing a procedure in SQL*Plus

    The below procedure works fine in SQL*Plus when the entire EXEC <procedure_name> (parameter1, parameter2, ..); is put in 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 execute the same procedure with more readability. So, I put each parameters on a separate line and try to execute. But it is erroring 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 keywordAny workaround for this ?

    Hi Tom,
    At SQL Plus,
    You have to use the -(Hyphen) as the concatenation Operator.
    For Instance,
    SQL>  exec host_command( -
    p_command => 'dir');
    PL/SQL procedure successfully completed.
    Thanks,
    Shankar                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • PLS-00201 error occurs when batching a stored procedure in SQL*Plus

    I have a batch file to run a stored procedure and spool the results to file. When I enter the commands manually in sql*plus the output works fine and my results are spooled to the output file. But when I run the same commands in the batched script I get an error.
    Any ideas?
    Stored Procedure:
    create or replace procedure MMP( p_cursor in out SYS_REFCURSOR)
    as
    begin
    open p_cursorfor select name, id from table;
    end;
    batch file 1:
    sqlplus -S user/pw@REPORTDV @sp_output_spooled.sql
    script file sp_output_spooled.sql
    Pasting these commands directly to the SQL*Plus command prompt spools the result set to file as expected.
    set colsep '|'
    set echo off
    set feedback off
    set termout off
    set heading off
    set linesize 9000
    set pagesize 0
    set trimspool on
    set headsep off
    spool output.TXT
    var rc refcursor
    execute MMP(:rc)
    print rc
    spool off
    exit
    The errors printed to output.TXT file after the batch is run and error occurs:
    BEGIN MMP(:rc); END;
    ERROR at line 1:
    ORA-06550: line 1, column 8:
    PLS-00201: identifier 'MMP' must be declared
    ORA-06550: line 1, column 8:
    PL/SQL: Statement ignored
    ERROR:
    ORA-24338: statement handle not executed
    SP2-0625: Error printing variable "rc"

    Hi,
    Your code worked fine for me.
    Is MMP procedure owned by the same user that is running the batch file or does it have proper privileges and synonym?
    vr,
    Sudhakar

Maybe you are looking for

  • Where can I get a 32-bit Itunes? The download page keeps linking to a 64-bit version.

    The Apple download pages keeps linking me to a 64-bit download. Not a 32-bit.

  • Handling Unprocessed items- G/L account and not A/R account

    Good Morning SAP Guru's, I have a problem. When using FLB1, if I have an item that does not belong in the subledger but needs to be booked to a general ledger, I double click on the unprocessed item, change the account type from D for customers to S

  • Timer not firing

    Whenever I try to use the Timer class, it won't fire for the life of it. I can't figure out what the problem is. This is a sample piece of code here: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TrivialApplet extends

  • SOAP AUthentication not working

    Hi Experts, I have a scenario in which the data is picked from a file location and then the SOAP receiver CC posts the data to a sharepoint portal. The issue I am facing is that when the portal guys allow anonymous login, my data reaches the portal b

  • TS4036 My iPad has a message that says:  Icloud backup.....

    The message says: Icloud backup This ipad hasn't been backed up in two weeks.  Backups happen when this ipad is plugged in, locked, and connected to wi-fi. It won't close when I click ok in the message box. How do I get past this message and into my