Please add exit to the last line of the sql script

Hi,
I am executing a sql script from UNIX shell. When I execute it at the command prompt the script executes successfully, but when I schedule the script on cron, the script is throwing an error with the above message
"Please add exit to the last line of the sql script"
Any idea what is happening? Thanks in advance for any help
thedba

It works check this out..
<< script a.sh >>
logfile=/home/oracle/sri/x.log
sqlplus -s /nolog <<DOC >> ${logfile}
whenever sqlerror exit sql.sqlcode
connect scott/tiger
@a.sql a.log
DOC
<<  script a.sql >>
set feedback off
set echo off
spool &1
select * from tab where tname like 'A%';
spool off
exit;
<< a.log >>
TNAME                          TABTYPE  CLUSTERID                              
AQ$DEF$_AQCALL                 VIEW                                            
AQ$DEF$_AQERROR                VIEW                                            
AQ$_DEF$_AQCALL_F              VIEW                                            
AQ$_DEF$_AQERROR_F             VIEW                                            
AQ$_INTERNET_AGENTS            TABLE                                           
AQ$_INTERNET_AGENT_PRIVS       TABLE                                           
AQ$_QUEUES                     TABLE                                           
AQ$_QUEUE_TABLES               TABLE                                           
AQ$_SCHEDULES                  TABLE                                           
<< x.log >>
TNAME                          TABTYPE  CLUSTERID
AQ$DEF$_AQCALL                 VIEW
AQ$DEF$_AQERROR                VIEW
AQ$_DEF$_AQCALL_F              VIEW
AQ$_DEF$_AQERROR_F             VIEW
AQ$_INTERNET_AGENTS            TABLE
AQ$_INTERNET_AGENT_PRIVS       TABLE
AQ$_QUEUES                     TABLE
AQ$_QUEUE_TABLES               TABLE
AQ$_SCHEDULES                  TABLE-Sri

Similar Messages

  • Required field, UPC, is missing. Please add UPC to the listing and retry the operation.

    What to do about this: "Required field, UPC, is missing. Please add UPC to the listing and retry the operation." ? We sell cassette tapes and sometimes they are are of a vintage that predates upc codes.

     forester_studios wrote:OK thanks for the input; but selecting 1 item leaves the other 4 or 5 unsearchable I would think.  Seems like a typical ebay answer (which is not much better than no answer as far as problem solving goes).   I have to wonder if ebay thought this new requirement through.  Often upc codes on Canadian items are not in ebays system at all.  So are these items which have upc codes un-listable  since ebay does not acknowledge they exsist? In that case, here is what I intend to do.... List the most important item's UPC in the actual required UPC field and then create as many other 'custom' item specific UPC fields as are allowed. You need to be on the long form selling form to do it. Call them Other UPC and Even More UPC or something. And then, just to be sure, I'll list all the UPCs in the item description.  Buyers probably won't search for UPC (unless they're standing in a retail store with their smartphone in hand and looking for cheaper pricing online) but search engines do. When I look for the products that I sell on google, I get amazon results 19 times before I see one from eBay. I'm certain that's the UPC talking there. We do need Product Identifiers on eBay. Implementing them is the difficulty. Ebay is aware that the UPC for Canadian packages may be different than the exact same in an American one. I've raised it and was told they were looking into it. Use the MPN identifiers too. Pretty much nothing I list can be found in the product catalogue on ebay.ca (is there one?) so I don't know what to expect for resolution there if and when the Catalogue version of the Product Identifiers are shown to be clearly wrong but I know it happens, here and elsewhere. The last order that I placed with Amazon had a new UPC pasted over an old, similar product. It was not what I ordered. Close but no cigar. Hopefully, when all of this becomes 'official' in two weeks, there will be a timely manner to address item misinformation within the Product Catalogue. In the meantime, I would state all the item properties in the Item Description area to cover my butt.   

  • Please add "iPhone" to the spell check dictionary.

    The forums spell checker is flagging iPhone, which is an Apple product name. Please add it to the dictionary.

    Klaus1 wrote:
    They are all there on a Mac.
    As you don't run a Mac I can only suggest that you add them yourself - after all you only have to do it once!
    Umm, I want to be as "constructive" as possible, so I'll clarify my statement. My suggestion referred to the web based spell checker built into the apple discussions site. It's the little "ABC" checkmark icon between underline and quote. This application does not run on anyone's local machine, (Mac or other)- it's web based.
    On the server, it contains a database of all the words that are spelled correctly, along with thousands of suggestions for how to correctly spell words that aren't correct.
    Apple generally takes very good care to make the user experience seamless and well thought out. Unfortunately in this case, it's failure to include it's own brand names like "phone" seems careless or at least sloppy. If you look beyond just it's own product names like "iMac", you'll also discover than common feature words like WiFi, GSM and dozens of other words which are commonly used in these forums are also missing. I'm trying to help Apple give the most professional image possible.
    As for your comment, immediatly replying that I'm not using a Mac so too bad seems to run counter to the desire of this community, beyond the fact that you don't understand this application. If the goal is to encourage Windows, (or in my case Linux), users to move to OSX, then you might want to be or encouraging and not so dismissive. If your goal is to alienate potential customers perhaps you're ideally suited for the Linux user community who's elitist ugliness for NOOBS is legendary.
    MC

  • Please help me convert the SQL to HQL

    select
    count(*) as col_0_0_
    from
    edu.hr_people_all hrpeopleal0_
    left outer join
    edu.conditions_journal conditions1_
    on hrpeopleal0_.people_id=conditions1_.people_id
    and conditions1_.personal_number like '%'
    where
    hrpeopleal0_.status=11

    Hibernate version: 3
    HQL as I 've done
    FROM PMSProjectsORO pjt LEFT JOIN PMSChecklistORO pcl
    ON pjt.projectId = pcl.projectId order by
    pjt.projectCode ascHQL is probably incorrect.
    Try this:
    FROM
    PMSProjectsORO pjt
    LEFT JOIN
    PMSChecklistORO pcl
    ORDER BY
    pjt.projectCode asc>
    Original SQL for MSQL5:
    FROM PMSProject LEFT JOIN PMSCheckList ON
    PMSProject.PROJECT_ID = PMSCheckList.PROJECT_ID order
    by PMSProject.PROJECT_CODE desc
    Name and version of the database you are using:
    MYSQL 5
    Please help me convert the sql to hql since what i
    've done is throwing error like unexpected token...
    Please reply ASAPLet me know if that's better.
    %

  • Difference between ';' and '/' in the SQL scripts

    Hi All,
    Could anyone please let me know the difference between placing ';' and '/' in the sql scripts.
    I am placing couple of insert statements in a textfile with .sql extension and running it from the sql prompt.
    Which one( ';' or '/') should be keep at the end of each statement in the script.
    SQL> SELECT SYSDATE FROM DUAL;
    SYSDATE
    12-MAY-13
    SQL> SELECT SYSDATE FROM DUAL
      2  /
    SYSDATE
    12-MAY-13Thanks,

    968217 wrote:
    My doubt is how it understands or the difference b/w the below two view statements one with ';' and another one with '/'. Sorry if i am unclear.They are identical in SQL*Plus. These characters mean "+send entered/buffered text to Oracle to parse and execute+".
    So - SQL*Plus sends "+create or replace view ev1 as select ename , sal from emp+" to the server (via a cursor execute):
    create or replace view ev1 as select ename , sal from emp
    /And again, SQL*Plus sends "+create or replace view ev1 as select ename , sal from emp+" to the server (via a cursor execute):
    create or replace view ev2 as select ename , sal from emp;These are identical statements.
    As I mentioned in the post I referred you to. Oracle also uses the ";" character in the PL/SQL language. So when you enter PL/SQL code in SQL*Plus, you do not want SQL*Plus to send each line of PL/SQL code to the server. Instead, you want it to wait till the last statement has been entered and then send the the whole block to the server to be parsed and executed,
    SQL*Plus has a basic parser itself. It uses that to figure out what you have entered, and whether a ";" you enter is an instruction from you to it, to send the text to the server - or when you enter a ";", it is part of the text for the server and that it should not react to it.
    Thus when you enter the following, SQL*Plus recognises that you are using the SQL language, and as this language does not use ";" characters, a ";" character when entered means that it needs to send the text to the server to be parsed and executed:
    SQL> select * from emp;
    // ; character instructs SQL*Plus to create and execute cursor "select * from emp"When you enter PL/SQL code, SQL*Pus recognises that and knows that ";" characters entered indicates end-of-statement for PL//SQL and that it should not act on that,
    SQL> begin
      2    null;
      3  end;
      4  /
    // SQL*Plus ignores the ";" character - and the "/" character is used to
    // instruct SQL*Plus to create and execute cursor"begin<LF>null;><LF>end;"

  • To automate the SQL scripts using PLSQL Code

    Hi All,
    I have 20 database server (11.2.0.3) hosted on  unix and Windows platforms.
    Every day I have to kill inactive sessions from all the these 20 database servers. So I have made a below script::
    connect sys/&&sys_password@&&tns_database_name as sysdba
    SPOOL E:\DELETE_INACTIVE_SESSIONS.SQL
    set PAGESIZE 1000
    set LIN 5000
    SET ECHO OFF;
    SET FEEDBACK OFF;
    SET HEADING OFF;
    select 'alter system kill session '||'`'||SID||','||SERIAL#||'`'||' immediate;'  from v$session where status='INACTIVE' and username in ('OSS_DICTIONARY','ADMINISTRATOR');
    SPOOL OFF;
    @@E:\DELETE_INACTIVE_SESSIONS.SQL
    Is there any way so that this execution of script can be automated in PLSQL code for 20 servers so and that code could be put in batch file for execution(i.e. can be execute through batch file from my windows laptop).
    Thanks

    Shrma wrote:
    Is there no way to handle the sql scripts in PLSQL code?
    Well, remember that PL/SQL is executed on a specific server by a certain user so you are already connected when executing a PL/SQL code.
    You could actually use a SQL Plus script to connect to different servers using connect and run your script.
    i.e.:
    SQL> connect sys/pwd_server1@db_server1
    SQL> @killinactive.sql
    SQL> connect sys/pwd_server2@db_server2
    SQL> @killinactive.sql
    But it does not make so much difference with my previous solution.
    Please explain exactly what you would like to do.
    Regards.
    Al

  • Getting windows error during running the sql scripts from form 6i

    I made a little form application. The purpose of this application is to generate explain plan for a particular SQL. Some sql scripts run internally in order to populate the result on form’s screen after pressing the form’s button but I am getting windows error during running the sql scripts from form 6i.
    I am using forms 6i with patch 17 with Oracle 10G database on windows 2000 professional on same computer.
    This application runs fine with 8i.
    Please inform me where the problem is and how to overcome it.
    Zafri.

    I am using Text_IO in my form's when button press trigger , inorder to create the
    text file, then in the same when button press triger
    I am calling RMAN via host command in order to run the script which was created by text_IO.
    Below you find some of the code. I will appreciate if you solve the problem.
    when button press trigger:
    Declare
    in_file3 Text_IO.File_Type;
    linebuf3 VARCHAR2(1800);
    output11 varchar2(1000);
    BEGIN
         output11:='C:\EXPLAIN_PLUS\misc\rm_file.bat ';
    Host(output11,no_screen);
    :sql.execution_plan:= 'Working........................';
    synchronize;
    in_file3 := Text_IO.Fopen('c:\explain_plus\misc\create_table.txt', 'w');
    Text_IO.Put_Line(in_file3, linebuf3);
    Text_IO.put_line(in_file3,' ');
    Text_IO.put_line(in_file3,' run { sql "create table PLAN_TABLE (statement_id,...object_name varchar2(30),object_instance numeric,object_type varchar2(30),optimizer varchar2(255),search_columns number,id .....partition_start varchar2(255),partition_stop  varchar2(255),partition_id numeric,other long,distribution varchar2(30)) "; } ');
    Text_IO.put_line(in_file3,' ');
    Text_IO.put_line(in_file3,' ');
    Text_IO.FCLOSE(in_file3)
              Declare
    un VARCHAR2(80);
    pw VARCHAR2(80);
    cn VARCHAR2(80);
    output VARCHAR2(1000);
    output2 VARCHAR2(1000);
    dummy varchar2(40);
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(1800);
    BEGIN
         Get_Connect_Info(un,pw,cn);
         /* for Plan_table Begg. Second INNER BLOCK */
         declare
              dummy2 varchar2(40);
         begin
         select table_name into dummy2 from all_tables where table_name='PLAN_TABLE';
         if dummy2 = 'PLAN_TABLE' then
         output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\MISC\TRUNC2.txt ' ;
    Host(output2,no_screen);
         end if;
         exception
         when no_data_found     then
    output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\misc\create_table.txt ';
    Host(output2,no_screen);
         end; --

  • How to run the SQL Script in SQL Prompt?

    Hi ExpertGroup,
    I have written one SQL Script name called "MySQLSCript.SQL". I want to know how to run the SQL Script in SQL Prompt?.
    Generally, I run SQL Script in PL/SQL Developer tool. But In this case, some SET command is not working/supporting in PL/SQL Developer Tool.
    Let me know, How to Run in SQl Prompt.
    Thanks & Regards,
    Senthil K Kumar.

    This is my SQL Script....
    SET COLSEP '|'
    SET LINESIZE 32767
    SET PAGESIZE 50000
    /* SET LINESIZE 3000
    SET PAGESIZE 50000
    SET DEFINE OFF */
    SET ECHO OFF
    SET FEEDBACK OFF
    --SET HEADING OFF
    SET TRIMSPOOL ON
    SET NEWPAGE NONE
    SET UNDERLINE OFF
    SPOOL &&EnterPath;
    SELECT * FROM &&TableName;
    SPOOL OFF
    SET FEEDBACK ON
    --SET DEFINE ON
    PROMPT Done.
    I am able to run this script in SQL Prompt....
    Its executing fine...
    But, If I am executing again it maynot asking for new set of data....
    alternativily its taking old values only.....
    how can i exeute with new set of data in the sql prompt.....

  • Petition - Please add these to the next firmware o...

    To Nokia:
    Please add three more folders to the main menu of the N73
    in addition to the Internet icon that was added to v.4.0
    Media
    Connectivity
    Help
    (They exist in the N80 which is older than the N73 and the N93i)
    Right now everything is dis-organized in Tools or Applications, and probably a lot of users want their menu
    organized nicely.
    if anyone approves, please sign.
    Thanks.
    Nokia N95
    RM-159
    v.31.0.017

    I haven't got the chance to update the fimware to v.4.0
    I'm glad i didn't because it has it's problems, that's
    why Nokia removed it.
    BTW,
    i'm too from Israel
    i'm in the Pocket forum by the nick semi-t.
    Nokia N95
    RM-159
    v.31.0.017

  • Please add this to the Forum FAQ / Help

    Please add the stuff mentioned here FAQ/Help - Search and here Forum FR: Add a button to put a [ code ] tag inside a post to the the forum FAQ / Help (http://forums.oracle.com/forums/help.jsp).
    Thanks, Markus

    That would be a great addition, but you have to send your suggestion to the developer team. Use this form for  a feature request:
    http://www.apple.com/feedback/garageband_ios.html

  • Add ; at end of last line.

    hi,
    i am spooling one large query to one .sql file.
    after this opearion i have to execute this file using command @x.sql
    for this purpose i have to add ";" at end of query in file;
    any idea how to achieve it using sql opeartion ?
    file is having only query.

    Why does it have to be via SQL?
    prompt ;;If it has to be part of the SQL you could try analyic functions:
    SQL> select ename
      2       , case row_number() over (order by ename desc) when 1 then ';' end as terminator
      3  from   emp
      4  order by ename;
    ENAME      T
    ADAMS
    ALLEN
    BLAKE
    CLARK
    FORD
    JAMES
    JONES
    KING
    MARTIN
    MILLER
    SCOTT
    SMITH
    TURNER
    WARD       ;The ordering key you use would have to be unique. If there isn't a unique key to order by, you could construct one using a nested rownum expression etc.

  • Please help me for the Sql Loader???

    Hi,
    I have a control file in c:\txt_to_DB_EDI.ctl
    insight that it is written that
    LOAD DATA
    INFILE 'D:\WING FAT\EDI_Sample.TXT'
    APPEND INTO TABLE TEMP_DATA_WINGFAT
    fields terminated by ' '
    TRAILING NULLCOLS
    (COMANY_CODE,SENDER_CODE,SENDER_TYPE,SUPPLIER_CODE,BYER_CODE,PO_NO,QC_DATE,INSPECTED_BY,
    CARGO_DELV_DATE,STYLE,COLOUR,,CAR_SIZE,ORDER_QTY_PCS,SHPPED_QTY_PCS,TOTAL_CARTON,GOODS_DESC,
    TAR_MODE,FILE_CREATION_TIME,FILE_NAME)
    actually I have a table that has the following fields
    CREATE TABLE TEMP_DATA_WINGFAT
    COMANY_CODE VARCHAR2(100),
    SENDER_CODE VARCHAR2(100),
    SENDER_TYPE VARCHAR2(100),
    SUPPLIER_CODE VARCHAR2(100),
    BYER_CODE VARCHAR2(100),
    PO_NO VARCHAR2(100),
    QC_DATE VARCHAR2(100),
    INSPECTED_BY VARCHAR2(100),
    CARGO_DELV_DATE VARCHAR2(100),
    STYLE VARCHAR2(100),
    COLOUR VARCHAR2(100),
    CAR_SIZE VARCHAR2(100),
    ORDER_QTY_PCS VARCHAR2(100),
    SHPPED_QTY_PCS VARCHAR2(100),
    TOTAL_CARTON VARCHAR2(100),
    GOODS_DESC VARCHAR2(100),
    TAR_MODE VARCHAR2(100),
    FILE_CREATION_TIME VARCHAR2(100),
    FILE_NAME VARCHAR2(100)
    I need to insert all data in the text file to the database.
    The contains of the text file is just like the below
    05 11 L 16 84 77538-445-12-106-102 20040907 SANJOY 20040820 1606 1606 Sea 20040907 10:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-626-64-112-001 20040907 SANJOY 20040905 4116 4116 Sea 20040908 09:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-626-64-111-001 20040907 SANJOY 20040905 4800 4800 Sea 20040908 09:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-626-64-110-001 20040907 SANJOY 20040905 4116 4116 Sea 20040908 09:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-626-64-109-001 20040907 SANJOY 20040905 4800 4800 Sea 20040908 09:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-705-42-209-001 20040907 SANJOY 20040901 4356 4356 Sea 20040908 10:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-705-42-209-102 20040907 SANJOY 20040901 4979 4979 Sea 20040908 10:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-705-42-214-001 20040907 SANJOY 20040901 1452 1452 Sea 20040908 10:09 QC_EDI_1.TXT
    05 11 L 19 84 77554-705-42-214-102 20040907 SANJOY 20040901 670 670 Sea 20040908 10:09 QC_EDI_1.TXT
    05 11 L 16 84 77538-346-01-203-001 20040907 SANJOY 20040915 1210 1210 Sea 20040908 10:09 QC_EDI_1.TXT
    05 11 L 115 84 77507-669-61-204-001 20040907 SANJOY 20040901 8220 8220 Sea 20040908 11:09 QC_EDI_1.TXT
    05 11 L 115 84 77507-669-61-203-001 20040907 SANJOY 20040901 6000 6000 Sea 20040908 11:09 QC_EDI_1.TXT
    05 11 L 115 84 77507-750-60-116-001 20040907 SANJOY 20040901 12240 12240 Sea 20040908 11:09 QC_EDI_1.TXT
    05 11 L 400001 84 73206-896-51-130-001 20040907 SANJOY 20040901 3200 3200 Sea 20040908 12:09 QC_EDI_1.TXT
    05 11 L 400001 84 73206-896-51-133-001 20040907 SANJOY 20040901 2000 2000 Sea 20040908 12:09 QC_EDI_1.TXT
    05 11 L 400001 84 73206-896-51-132-001 20040907 SANJOY 20040901 3200 3200 Sea 20040908 12:09 QC_EDI_1.TXT
    05 11 L 400001 84 73206-896-51-131-001 20040907 SANJOY 20040901 2000 2000 Sea 20040908 12:09 QC_EDI_1.TXT
    Askings are :
    1. Please check the control file text.
    2. then Please say how do I run this control file. Please write the code to run in the sql prompt.
    Please treat this at an urgent basis.
    FARHAD

    The cmd is: sqlldr aa/bb@cc control=c:\txt_to_DB_EDI.ctl, before that you need to make sure sqlldr is available.
    you may run it on server command line, sure you in your user's profile set the $SQLLDRCMD to the sqlldr executable.

  • Command for exceuting the sql script to a db from linux home

    Hi All,
    Can someone please tell me how to execute the /addev/ad/11.5/sql/adcdexcp.sql against case122 from my linux home for our product.
    Thanks in Advance

    Do not fully understand your question.. but some basics:
    You need an Oracle OCI client driver and Oracle client on the client side. E.g. Oracle Instant Client and Oracle's SQL*Plus.
    You need to connect to the database server (using SQL*Plus as the example):
    sqlplus scott/tiger@db-alias
    Where db-alias is a TNS alias for the database.
    Once connected, you can use SQL*Plus to load the contents of a SQL script, and send a single SQL command (or PL/SQL anonymous block) at a time to the Oracle server for execution. E.g.
    SQL> @/addev/ad/11.5/sql/adcdexcp.sql
    I suggest you point your browser to http://tahiti.oracle.com (Oracle Documentation Portal), and look for the SQ*Plus User Guide for the Oracle version you're running.
    If you can be more specific and provide proper details as to what you are attempting to achieve, forum members will be a better position to provide assistance and advice.

  • Problem while executing script in Toad - How to use '&' in the sql script ?

    I have to execute sql script in toad. Sql script has one insert query in which one insert-value is 'USA & CAN'. When I executed the script in toad by pressing F5, I got a prompt window asking for the value if 'CAN' as it is after the &.
    I tried using[b] {escape '\' } .... but could not resolve the problem.
    Is there any solution or workaround to overcome this problem. I have thousands of records with such values and I have to use sql script only.

    There is an option in TOAD to change this behaviour.
    Look in VIEW/OPTIONS/SQL Editor/
    Uncheck the box for "Scan statements for bound variables before execution".
    In SQL*PLUS it would be SET SCAN OFF
    (desupported version is SET DEFINE OFF)
    Message was edited by:
    Sven Weller

  • Please add Favicons to the bookmarks bar!

    Apple, please please please get this done. It's a feature that keeps so many users from switching to Safari.

    My bookmarks bar has favicons in the folders.
    Here is the "News" folder I have.

Maybe you are looking for

  • AIR 2.7 on Android - playback device ?

    Is there a way to choose whether the audio played by an AIR application will be played using the telephones earpiece, instead of the speaker ? This would make "telephony" (voip) applications so much more useful

  • How can I restore 1 picture from time capsule

    I am trying to import 1 picture from my time capsule backup. It only allows me to do 1.

  • MY MEMORIE IS TOO LOW

    My laptop memory is almost full, bought it at pawn shop. A few days ago. And I have some app that are not installing. And I am not computer smart. [Personal Information Removed] eather one of these emails you can reach me at

  • Audio jack is not working

    I have bought a blackberry z10 4 days ago.When I test the headset on another phone it is working fine But when I put it into my phone it doesn't respond.i have followed many ways ..pls guys any suggestions......I want my z10 to be perfect......pls he

  • Gimp slow on gnome shell

    Hello, Im experiencing a slow performance of gimp under gnome-shell (zooming in-out, dragging the image using spacebar, etc), however it works fine in other DEs like kde, mate, openbox. Has anyone noticed smtg similar? any hints to try? I'm using an