SQL*Plus Script Errors

My scripts all contain relative file paths e.g.
@@../directory1/file1.sql
Is there a way of setting the current working directory in SQL Developer to make this work?
In SQL*Plus for windows you simply opened the file but this does not seem to work.

As I said, run them in SQL*Plus.
SQL*Developer is a development tool and database browser, not a SQLPLus clone.
It has its own methods of extracting data which may or may not suit your output requirements. You don't need col statements as much if you are viewing data in a grid, for example. [1]
I don't know what you use the sqlplus scripts for, but they could be replaced over time with some combination of Apex, SQLDeveloper reports and straight sqldeveloper queries.
As for SQL*PLus being greyed out on the menu, there are some known issues about that. I think one of them is that you need to be using tns connections. However, the sqlplus menu item is gone in sqldeveloper 1.5 so don't rely on it. Learn to run if from the command line.
[1] Despite that, I would arguethat SQLDeveloper should support all (with tiny exceptions) SQLPlus commands. Not because I see it as a sqlplus replacement, but so it can be used to develop scripts which can then be run in SQL*Plus without amendment (without the hassle of switching back and forth during development)

Similar Messages

  • Execute SQL*PLUS script from VB6?

    I'm using VB6 to connect to oracle 10 with oracle client 8i, I can establish the connection without any problems.
    If I run a SQL statement from VB it works prefect, but when I try to run a SQL Plus script from VB I get error ORA-00900, "invalid SQL statement". Everything works fine in oracle SQLPLUS.
    Is there anything I have missed about running SQL*PLUS script from VB6? Is'nt it the same as a SQL statement?

    Thanks for you answer Justin,
    This is a short variant of SQL*Plus I wanna execute from VB and transfer the result into a listview in VB.
    If this is possible from VB, can you show me how I should do?
    COLUMN customer_1 NEW_VALUE customer_1 NOPRINT
    COLUMN customer_2 NEW_VALUE customer_2 NOPRINT
    SELECT customer customer_1
      FROM (
            SELECT customer,
                   ROW_NUMBER() OVER(PARTITION BY customer ORDER BY CustomerTotalSales DESC) CustomerTotalSalesRank
              FROM (
                    SELECT  customer,
                            SUM(SalesQty) OVER(PARTITION BY customer) CustomerTotalSales
                      FROM  CustTable
                      WHERE year_month BETWEEN 200709 AND 200801
    WHERE CustomerTotalSalesRank = 1
      AND ROWNUM = 1
    SELECT customer customer_2
      FROM (
            SELECT customer,
                   ROW_NUMBER() OVER(PARTITION BY customer ORDER BY CustomerTotalSales DESC) CustomerTotalSalesRank
              FROM (
                    SELECT  customer,
                            SUM(SalesQty) OVER(PARTITION BY customer) CustomerTotalSales
                      FROM  CustTable
                      WHERE year_month BETWEEN 200709 AND 200801
    WHERE CustomerTotalSalesRank = 2
      AND ROWNUM = 1
    SET VERIFY OFF
    SELECT  year_month,
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 1
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) "&customer_1",
            SUM(
                CASE CustomerTotalSalesRank
                  WHEN 2
                    THEN
                      SalesQty
                    ELSE
                      NULL;
                END
               ) "&customer_2"
    FROM  (
             SELECT  year_month,
                     SalesQty,
                     ROW_NUMBER() OVER(PARTITION BY customer ORDER BY CustomerTotalSales DESC) CustomerTotalSalesRank
               FROM  (
                      SELECT  customer,
                              year_month,
                              SalesQty,
                              SUM(SalesQty) OVER(PARTITION BY customer) CustomerTotalSales
                        FROM  CustTable
                        WHERE year_month BETWEEN 200709 AND 200801
      WHERE CustomerTotalSalesRank <= 10
      GROUP BY year_month
      ORDER BY year_month
      /

  • How to detect client OS from SQL*Plus script

    Sometimes in a SQL*Plus script I need to execute OS commands e.g.
    host rm tempfile.bufHowever of course Windows has no "rm" command by default, so I have to edit the script to use
    host del tempfile.bufNow if I could define &DELETE (for example, "cat"/"type" is another) as a substitution variable, I could just use
    host &DELETE tempfile.bufMaybe I need more coffee but all I could come up with was something like this:
    def rm=rm
    def cat=cat
    spool sqlplus_windows_defs.cmd
    prompt echo def rm=del
    prompt echo def cat=type
    spool off
    host .\sqlplus_windows_defs > sqlplus_windows_defs.sql
    @sqlplus_windows_defs.sql
    host &rm sqlplus_windows_defs.cmd
    host &rm sqlplus_windows_defs.sqlthe idea being that you first define the variables for nix ("rm" and "cat"), then attempt to create and execute a Windows command file containing DOS versions ("dele" and "type"), which does not run under nix. Unfortunately the OS failure message (".sqlplus_windows_defs: not found" in Unix) appears on the screen despite SET TERM OFF, so I'm back where I started.
    I know there are various ways to get the server OS, and you can get the SQL*Plus version with &_SQLPLUS_RELEASE and so on, but I can't see a way to determine the client OS. Any suggestions?

    Thanks guys. This seems to work in Windows XP - will try on Unix when I get a chance:
    col DELETE_COMMAND new_value DELETE_COMMAND
    col LIST_COMMAND new_value LIST_COMMAND
    def list_command = TYPE
    def delete_command = DEL
    SELECT DECODE(os,'MSWIN','TYPE','cat') AS list_command
         , DECODE(os,'MSWIN','DEL','rm')   AS delete_command
    FROM   ( SELECT CASE WHEN UPPER(program) LIKE '%.EXE' THEN 'MSWIN' END AS os
             FROM   v$session
             WHERE  audsid = SYS_CONTEXT('userenv','sessionid') );
    host &LIST_COMMAND xplan_errors.lst
    host &DELETE_COMMAND xplan_errors.lstIf the user doesn't have access to v$session it will just default to the Windows commands.
    http://www.williamrobertson.net/code/xplan.sql

  • SP2-0642: SQL*Plus internal error state 2133, context

    Hi Everybody
    I am getting the below wired error msg in SQL Plus when trying to execute a select statment on a external table
    SP2-0642: SQL*Plus internal error state 2133, context 0:0:0
    Unsafe to proceed
    SP2-0642: SQL*Plus internal error state 2221, context 4294967295:4:0
    Unsafe to proceed
    Kindly help me out to solve this issue.
    Thanks & Regards
    Chandra Sekar A.
    [email protected]

    Hi Guys
    Thanks for both of you for your replies.
    The problem is still pertaining.
    Below is the structure I have used to create the external table
    CREATE TABLE "Z_TBN_JXPKIREC"
    "ORG" NUMBER ,
    "ACCT" VARCHAR2(19) ,
    "XD_REC_NBR" NUMBER ,
    "XD_REC_TYPE_KEY" NUMBER ,
    "LOGO" Number ,
    "XD_DATE_LAST_MAINT" NUMBER ,
    "XD_PLAN_NBR" NUMBER ,
    "XD_FILLER_1" VARCHAR2(21) ,
    "XD_DATE_ADDED" NUMBER ,
    "XD_PRIN_BNP" NUMBER ,
    "XD_INT_BNP" NUMBER ,
    "XD_INS_BNP" NUMBER ,
    "XD_NSF_BNP" NUMBER ,
    "XD_SVC_CHG_BNP" NUMBER ,
    "XD_LATE_CHG_BNP" NUMBER ,
    "XD_MEMBER_BNP" NUMBER ,
    "XD_OVLM_BNP" NUMBER ,
    "XD_RECV_BNP" NUMBER ,
    "XD_COLL_BNP" NUMBER ,
    "XD_USER_FEE_1_BNP" NUMBER ,
    "XD_USER_FEE_2_BNP" NUMBER ,
    "XD_USER_FEE_3_BNP" NUMBER ,
    "XD_USER_FEE_4_BNP" NUMBER ,
    "XD_USER_FEE_5_BNP" NUMBER ,
    "XD_USER_FEE_6_BNP" NUMBER ,
    "XD_FILLER_2" NUMBER ,
    "XD_FILLER_3" VARCHAR2(85)
    ORGANIZATION EXTERNAL (
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY LOC_TARGET
    ACCESS PARAMETERS (
         RECORDS FIXED 2500
    CHARACTERSET JA16EBCDIC930
    STRING SIZES ARE IN BYTES
    NOBADFILE
    NODISCARDFILE
    LOGFILE 'XXXX_9.LOG'
    FIELDS
    NOTRIM
    "ORG" POSITION (1:3) INTEGER EXTERNAL ,
    "ACCT" POSITION (4:22) CHAR(19) ,
    "XD_REC_NBR" POSITION (23:25) INTEGER EXTERNAL ,
    "XD_REC_TYPE_KEY" POSITION (26:27) INTEGER EXTERNAL ,
    "LOGO" POSITION (28:30) INTEGER EXTERNAL ,
    "XD_DATE_LAST_MAINT" POSITION (31:34) DECIMAL(7,0) ,
    "XD_PLAN_NBR" POSITION (35:37) INTEGER EXTERNAL ,
    "XD_FILLER_1" POSITION (42:62) CHAR(21) ,
    "XD_DATE_ADDED" POSITION (38:41) DECIMAL(7,0) ,
    "XD_PRIN_BNP" POSITION (63:71) DECIMAL(17,0) ,
    "XD_INT_BNP" POSITION (72:80) DECIMAL(17,0) ,
    "XD_INS_BNP" POSITION (81:89) DECIMAL(17,0) ,
    "XD_NSF_BNP" POSITION (90:98) DECIMAL(17,0) ,
    "XD_SVC_CHG_BNP" POSITION (99:107) DECIMAL(17,0) ,
    "XD_LATE_CHG_BNP" POSITION (108:116) DECIMAL(17,0) ,
    "XD_MEMBER_BNP" POSITION (117:125) DECIMAL(17,0) ,
    "XD_OVLM_BNP" POSITION (126:134) DECIMAL(17,0) ,
    "XD_RECV_BNP" POSITION (135:143) DECIMAL(17,0) ,
    "XD_COLL_BNP" POSITION (144:152) DECIMAL(17,0) ,
    "XD_USER_FEE_1_BNP" POSITION (153:161) DECIMAL(17,0) ,
    "XD_USER_FEE_2_BNP" POSITION (162:170) DECIMAL(17,0) ,
    "XD_USER_FEE_3_BNP" POSITION (171:179) DECIMAL(17,0) ,
    "XD_USER_FEE_4_BNP" POSITION (180:188) DECIMAL(17,0) ,
    "XD_USER_FEE_5_BNP" POSITION (189:197) DECIMAL(17,0) ,
    "XD_USER_FEE_6_BNP" POSITION (198:206) DECIMAL(17,0) ,
    "XD_FILLER_2" POSITION (207:215) DECIMAL(17,0) ,
    "XD_FILLER_3" POSITION (216:300) CHAR(85)
    LOCATION (LOC_TARGET: 'XXXX.DAT')
    REJECT LIMIT UNLIMITED
    NOPARALLEL
    and w.r.t. SQL Plus version itz 9.2 and the database server is also 9.2
    Your replies are highly appreciated and thanks for your valuable time.
    Thanks & Regards
    Chandra Sekar A.
    [email protected]

  • Error : SP2-0642: SQL*Plus internal error state 2286, context 0:0:0

    Hi all
    I got the following error while starting a database.please help me
    SP2-0642: SQL*Plus internal error state 2286, context 0:0:0 Unsafe to proceed

    Hi,
    Please look at the notes.
    SP2-0642: SQL*Plus Internal Error State 2130 ORA-24315: Illegal Attribute Type [ID 1060880.1]
    "SP2-0642: SQL*Plus internal error state 2090, context 0:0:0" Error Encountered While Running Select Statement [ID 555757.1]
    SP2-0642: SQL*Plus internal error state 2090, context 0:0:0" Error Encountered While Running Select Statement [ID 555757.1]
    They are either Windows related or general.
    Regards,

  • SQL*Plus script with a dynamic SPOOL File Location?

    Anyone,
    I have a numbr of SQL Plus scripts that I need to run many times but each run against a different database. Each script SPOOLS the output like this:
    spool c:\temp\BUILD_ASSET.lis
    spool c:\temp\BUILD_WORKORDER.lis
    etc
    (each spool is a seperate script run)
    The spool is at the top of each BUILD SQL Script.
    Example:
    set time on
    SET FEEDBACK ON
    SET ECHO ON
    SET TIMING ON
    spool c:\temp\BUILD_ASSET.lisBut I need each run to go into its own directory based on the database I am connected to. Like this:
    CONNECT DB1
    @C:\temp\BUILD_ASSET.SQL =====> spool c:\temp\DB1\BUILD_ASSET.lis
    @c:\temp\BUILD_WORKORDER.SQL =====>  spool c:\temp\DB1\BUILD_WORKORDER.lis
    etc
    CONNECT DB2
    @C:\temp\BUILD_ASSET.SQL =====> spool c:\temp\DB2\BUILD_ASSET.lis
    @c:\temp\BUILD_WORKORDER.SQL =====> spool c:\temp\DB2\BUILD_WORKORDER.lisIs there a way to dynaically code this without having to create a version of the BUILD scripts for every single DB I connect to?
    I would like to have one big script that executes all the individual BUILD scripts.
    Seems very easy in concept but I can not see an easy way. I would appreciate any help I can get.
    Thanks in advance,
    Miller

    column db new_Value db
    select sys_context('userenv','db_name') db from dual;
    spool c:\temp\&db\file.lis

  • SQL Plus Script Execution Time

    Anyone,
    Is there an easy way to start a timer inside a SQL Plus script that shows exact run time at end of script completion?
    Right now I use the TIME option and have a time as the prompt start and then one at end but would like if the SQL Plus script could simply put a begin/end/run time for me as last output. TIMING is to much since I have many things execute and do not wnat to see every individual runtime.
    Thanks in advance,
    Miller

    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12047.htm#i2699704
    You can use TIMING with a named timer
    SQL> timing start script_time
    SQL> select 1 from dual;
             1
             1
    SQL> /
             1
             1
    SQL> /
             1
             1
    SQL> timing stop
    timing for: script_time
    Elapsed: 00:00:07.37
    SQL>

  • How to control logic flow in SQL Plus script

    Hi
    I have the requirement below:
    Before I start running an SQL script, I need to ensure that I am connecting as a particular user. If I am not that user, then the script should show a msg "Error - Invalid User - Log in as <<username>>"
    Let's say i am executing a script A.sql.
    SQL > @<path>a.sql
    But before this script is executed -- i shall check for the user:
    block begins...
    select user into var1 from dual
    if upper(var1) != 'ABCUSER' then
    -- display the error message and stop execution of this script
    else
    @<path>a.sql (*it executes what i want :) )
    end if;
    block ends...
    How do I write this code using an SQL script ? Pls sugges

    Hi,
    As Centinul said, SQL*Plus is poorly equipped to deal with problems like this. If possible, try to do what you want outside of SQL*Plus.
    If you really have to do it in SQL*Plus, here are two ideas:
    (1) run a script conditionally
    (2) deliberately raise an error
    (1) Using SQL*Plus substitution variables, you can decide which of several scripts to run as a sub-script, based on the results of some query.
    For example, if a.sql is the script that only user ABCUSER is allowed to run, then write two other very short scripts:
    (a) warning.sql, such as the following:
    --  warning.sql
    PROMPT  You are not authorized to do this.
    QUIT(b) step_1.sql, which decides whether a.sql or warning.sql should be run, and does it:
    --     step_1.sql - Decide whether a.sql or warning.sql is to be run next, and do it.
    --     (a) decide:
    COLUMN  script_name_col     NEW_VALUE     script_name
    SELECT     CASE
              WHEN  USER = 'ABCUSER'
              THEN  'a.sql'
              ELSE  'warning.sql'
         END     AS script_name_col
    FROM     dual;
    --     do:
    @&script_nameYou may want to use @@, or specify a complete path name.
    (2) Deliberately raise an error, either in a separate script or in a.sql itself, like this:
    WHENEVER     SQLERROR     EXIT
    SELECT     CASE
              WHEN  USER = 'ABCUSER'
              THEN  NULL
              ELSE  TO_NUMBER ('This will raise ORA-01722')
         END     AS "Welcome!"
    FROM     dual;
    WHENEVER     SQLERROR     NONE
    -- continue with the original a.sql

  • Procedure works in sql plus, shows error in sql dev

    I create a package spec and body via a script in sql plus. Following is part of script:
         procedure updateMetricValue(p_metricValueId_in IN number,
         p_username_in IN metricvalue.entryBy%TYPE,
         p_value_in IN VARCHAR2)
         is
         BEGIN
              UPDATE MetricValue
              SET modifiedBy = p_username_in,
                   value = CAST(p_value_in as NUMBER(17,4))
              WHERE id = p_metricValueId_in;
         END updateMetricValue;
    No errors in sqlplus. Runs fine. When I look at the package in SQL Developer 1.0, it shows an error: "expecting identifier" just before the 4 in the line:
    value = CAST(p_value_in as NUMBER(17,4))
    What am I missing?
    Using 9.2.0.1.0 on windows XP as development database.

    I create a package spec and body via a script in sql plus. Following is part of script:
         procedure updateMetricValue(p_metricValueId_in IN number,
         p_username_in IN metricvalue.entryBy%TYPE,
         p_value_in IN VARCHAR2)
         is
         BEGIN
              UPDATE MetricValue
              SET modifiedBy = p_username_in,
                   value = CAST(p_value_in as NUMBER(17,4))
              WHERE id = p_metricValueId_in;
         END updateMetricValue;
    No errors in sqlplus. Runs fine. When I look at the package in SQL Developer 1.0, it shows an error: "expecting identifier" just before the 4 in the line:
    value = CAST(p_value_in as NUMBER(17,4))
    What am I missing?
    Using 9.2.0.1.0 on windows XP as development database.

  • SQL Plus REport Error

    Hi,
    There is an SQL Plus REport which was developed by someone else a couple of years ago. And now i pulled the code to make a few changes in the columns and put it back.
    Before i made the change i ran the report from the Oracle applications and there was no error.
    But for some reason when i changed it and ran it from applications, there is an error that shows up:
    EXEC FND_CONC_STAT.COLLECT
    ERROR at line 163:
    ORA-00933: SQL command not properly ended
    And so i reverted back to the original code and the same error shows up.
    Can someone tell me why this is error is showing up?
    This is the sql code for the report:
    SET ECHO OFF
    SET SHOW OFF
    SET FEEDBACK OFF
    SET VERIFY OFF
    SET HEADING OFF
    SET PAGESIZE 0
    SET LINESIZE 450
    --WHENEVER SQLERROR EXIT;
    DEFINE vfrmdte = '&&1';
    DEFINE vtodte = '&&2';
    DEFINE vjobnum = '&&3';
    DEFINE vorgid = '&&4';
    select substr(we.wip_entity_name,1,10)||';'||
    substr(msi.segment1,1,10)||';'||
    rc.customer_number||';'||
    rsu.location||';'||
    substr(sl.cust_po_number,1,25)||';'|| --changed sh to sl
    --sh.ordered_date||';'||
    sl.creation_date||';'||----extra colmn added
    sl.ordered_item||';'|| substr(sl.attribute8,1,30)||';'||
    REPLACE(sl.ordered_item,'?',' ')||';'|| --substr(sl.attribute8,1,30)||';'||
    sl.request_date||';'||
    substr(dcgv.segment2,1,15)||';'||
    substr(dgv.SEGMENT1,1,20)||';'||
    sh.order_number||';'||
    substr(dcgv.segment3,1,15)||';'||
    substr(dcgv.segment4,1,25)||';'||
    substr(dscv.segment2,1,20)||';'||
    substr(dscv.segment3,1,10)||';'||
    wdj.start_quantity||';'||
    wdj.quantity_completed||';'||
    sl.order_quantity_uom||';'||
    wdj.completion_subinventory||';'||
    wdj.completion_locator_id||';'||
    wdj.primary_item_id||';'||
    wdj.wip_entity_id||';'||
    wdj.scheduled_start_date||';'||
    wdj.status_type||';'||
    substr(ml.meaning,1,30)||';'||
    ml.lookup_code||';'||
    md.demand_source_header_id||';'||
    substr(md.demand_source_line,1,15)||';'||
    mso.sales_order_id||';'||
    substr(mso.segment1,1,15)||';'||
    substr(mso.segment2,1,25)||';'||
    substr(mso.segment3,1,20)||';'||
    mic.category_set_id||';'||
    mic2.category_set_id||';'||
    dgv.category_id||';'||
    dcgv.category_id||';'||
    sh.header_id||';'||
    sh.order_type_id||';'||
    sl.line_number||';'||
    sl.line_id||';'||
    sl.inventory_item_id||';'||
    substr(sl.attribute11,1,20)||';'||
    msi.fixed_lot_multiplier||';'||
    substr(dscv.segment1,1,20)||';'||
    wdj.organization_id||';'||
    rc.customer_id||';'||
    rsu.site_use_id||';'||
    sl.LAST_UPDATE_DATE------extra colmn added
    from
    apps.wip_entities we ,
    apps.wip_discrete_jobs wdj ,
    apps.mfg_lookups ml ,
    --apps.wip_so_allocations wsa ,                                                     
    apps.mtl_demand md, --inv.mtl_demand md ,                                                     
    apps.mtl_sales_orders mso ,
    apps.mtl_system_items_b msi,--inv.mtl_system_items_b msi ,
    apps.mtl_item_categories mic ,
    apps.mtl_item_categories mic2 ,
    apps.mtl_item_categories mic3 ,
    apps.mtl_category_sets mcs ,
    apps.mtl_category_sets mcs2 ,
    apps.mtl_category_sets mcs3 ,
    apps.MTL_CATEGORIES_B dgv,--INV.MTL_CATEGORIES_B dgv ,
    apps.MTL_CATEGORIES_B dcgv ,
    apps.MTL_CATEGORIES_B dscv ,
    apps.oe_order_headers_all sh, --so_headers_all sh ,                                                              
    apps.oe_order_lines_all sl, --so_lines_all sl ,                                                                
    apps.oe_transaction_types_tl sot, --so_order_types_all sot ,                                                         
    apps.ra_customers rc ,
    apps.ra_site_uses_all rsu
    where
    we.wip_entity_id = wdj.wip_entity_id
    and wdj.firm_planned_flag in (1,2)
    and wdj.status_type = ml.lookup_code
    and ml.lookup_type = 'WIP_JOB_STATUS'
    and md.supply_source_header_id = we.wip_entity_id
    -- and sh.header_id = mso.sales_order_id
    and mso.segment1 = sh.order_number
    and mso.segment2 = sot.name
    and sot.transaction_type_id = sh.order_type_id
    and sh.sold_to_org_id = rc.customer_id
    and sh.ship_to_org_id = rsu.site_use_id
    --DUPLICATE and sh.order_type_id = sot.order_type_id                                     
    and sl.header_id = sh.header_id
    and sl.line_id = md.demand_source_line
    and sl.inventory_item_id = msi.inventory_item_id
    and msi.organization_id = wdj.organization_id
    and msi.inventory_item_id = mic.inventory_item_id
    and msi.organization_id = mic.organization_id
    and mic.category_set_id = mcs.category_set_id
    and mcs.category_set_name = 'DWC Groups'
    and dgv.category_id = mic.category_id
    AND dgv.STRUCTURE_ID = 50109
    and msi.inventory_item_id = mic2.inventory_item_id
    and msi.organization_id = mic2.organization_id
    and mic2.category_set_id = mcs2.category_set_id
    and mcs2.category_set_name = 'DWC COLORS'
    and dcgv.category_id = mic2.category_id
    AND dcgv.STRUCTURE_ID = 50111
    and msi.inventory_item_id = mic3.inventory_item_id
    and msi.organization_id = mic3.organization_id
    and mic3.category_set_id = mcs3.category_set_id
    and mcs3.category_set_name = 'DWC Ship'
    and dscv.category_id = mic3.category_id
    AND dscv.STRUCTURE_ID = 50112
    AND to_date(to_char(sl.request_date,'DD-MON-YYYY'),'DD-MON-YYYY') between
    nvl(to_date(to_char('&vfrmdte','DD-MON-YYYY'),'DD-MON-YYYY'),sl.request_date)
    and nvl(to_date(to_char('&vtodte' ,'DD-MON-YYYY'),'DD-MON-YYYY'),sl.request_date)
    AND we.wip_entity_name = NVL('&vjobnum', we.wip_entity_name)
    AND we.organization_id = NVL('&&4',we.organization_id)
    AND wdj.status_type IN (1,3)
    GROUP BY
    substr(we.wip_entity_name,1,10)||';'||
    substr(msi.segment1,1,10)||';'||
    rc.customer_number||';'||
    rsu.location||';'||
    substr(sl.cust_po_number,1,25)||';'|| --changed from sh to sl
    --sh.ordered_date||';'||
    sl.creation_date||';'||
    sl.ordered_item||';'|| substr(sl.attribute8,1,30)||';'||
    REPLACE(sl.ordered_item,'?',' ')||';'|| --substr(sl.attribute8,1,30)||';'||
    sl.request_date||';'||
    substr(dcgv.segment2,1,15)||';'||
    substr(dgv.SEGMENT1,1,20)||';'||
    sh.order_number||';'||
    substr(dcgv.segment3,1,15)||';'||
    substr(dcgv.segment4,1,25)||';'||
    substr(dscv.segment2,1,20)||';'||
    substr(dscv.segment3,1,10)||';'||
    wdj.start_quantity||';'||
    wdj.quantity_completed||';'||
    sl.order_quantity_uom||';'||
    wdj.completion_subinventory||';'||
    wdj.completion_locator_id||';'||
    wdj.primary_item_id||';'||
    wdj.wip_entity_id||';'||
    wdj.scheduled_start_date||';'||
    wdj.status_type||';'||
    substr(ml.meaning,1,30)||';'||
    ml.lookup_code||';'||
    md.demand_source_header_id||';'||
    substr(md.demand_source_line,1,15)||';'||
    mso.sales_order_id||';'||
    substr(mso.segment1,1,15)||';'||
    substr(mso.segment2,1,25)||';'||
    substr(mso.segment3,1,20)||';'||
    mic.category_set_id||';'||
    mic2.category_set_id||';'||
    dgv.category_id||';'||
    dcgv.category_id||';'||
    sh.header_id||';'||
    sh.order_type_id||';'||
    sl.line_number||';'||
    sl.line_id||';'||
    sl.inventory_item_id||';'||
    substr(sl.attribute11,1,20)||';'||
    msi.fixed_lot_multiplier||';'||
    substr(dscv.segment1,1,20)||';'||
    wdj.organization_id||';'||
    rc.customer_id||';'||
    rsu.site_use_id||';'||
    sl.LAST_UPDATE_DATE ----extra colmn added

    Then we reverted back to the original and there it was the same error.This doesn't seem possible to me. Maybe you just didn't use the exact original script. Other Charset, other linebreaks, UNIX2DOS conversion, etc.
    So debugging the error seems useful to me. At least you got an error message and could start working up on that.
    On the other hand maybe it would be better to ask this question in the Applications Forum. I think this is this one: Business Intelligence Applications
    Regards
    Sven

  • Sql*plus worksheet error

    Hi there,
    I'm using Windows 2000 SP3 with Oracle 9i Database Server release 92010
    The sql*pl worksheet work fine several time until now, when I'm clicking on SQL*PL worksheet I'm getting an error message that says:
    SQL*Plus executable may not have been installed in C:\oracle\ora92\bin.
    CreateProcess: C:\oracle\ora92\bin\sqlplus -r 3/nolog
    @c:\oracle\ora92\sysman\config\sqlplusworksheetInit.
    sql error = 193
    Thanks,
    Oded Dror
    Email: [email protected]

    changing the env variable at dos prompt will not change it for other processes. It will be changed
    only while the dos prompt window is running. to change it permanently, you need to right click on
    My Computer" icon and go to properties -> Advance Options. and change the environment values there.

  • SQL Plus access Errors

    Hi All;
    First off if this is a misplaced post, sorry about that and please let me know where it should be posted.
    I have an Oracle 11.g server that WAS functioning fine up to as of late. For some reason users cannot use SQL Developer (on the server) anymore and are now getting the ever so common error when trying to connect:
    ORA-12514 TNS:Listener does not current know of the service.
    Nothing has changed with regards to the user ID and passwords, nor have the service names changed or any other config to the Listener.
    ALSO:
    If I try to come in via a CLI with sqlplus commands, no dice here either. I'll try this path:
    @prompt: sqlplus /nolog
    @prompt: SQL*PLUS: Release 11.1.0.6.0 Product...etc. etc.
    @prompt: connect /as sysdba
    @prompt: ERROR:
    ORA-12560 TNS: protocol adapter error
    Yes I have did some "google" searches, but they just seem to hint about new installs and configurations. Not said error issues with prior functioning systems.
    Any help would be greatly appreciated. Thanks in advance, Steve
    Edited by: user10773923 on Apr 1, 2010 3:45 PM
    Edited by: user10773923 on Apr 1, 2010 3:46 PM

    Hi,
    If on windows, did you change the name of you machine?
    It will fail your DB from starting up.
    Often
    Nothing has changedis our perspective, but something has in fact changed, else there is no reason for it not to work.
    Happy Trouble Shooting :)
    Regards,
    Bhushan

  • Detecting clientside NLS_LANG setting in SQL*Plus script

    Our company has developed an application that uses an Oracle database as it backend. Companies can buy our application and run it against their own Oracle installation.
    A new version of our application often requires an update to the Oracle database schema.
    Together with new application files we send our customers an update.sql script they must run against their database using SQL*Plus.
    This update script may contain international characters like é for example:
    UPDATE SHOPS SET DESCRIPTION = 'Café'
    WHERE SHOP_ID=1We save the SQL-script file in windows-1252 encoding so the character é is encoded as 0xE9 in the script file.
    When the DBA running the upgrade script has set NLS_LANG=.WE8MSWIN1252 this works perfectly.
    When the DBA has set his NLS_LANG=US7ASCII the é gets replaced by an upside-down question mark. Other NLS_LANG settings can also be troublesome.
    To prevent this we give very clear installation instructions. However, nobody reads them. This leads to two questions:
    A) Is there a way to prevent this problem so I do not depend on the NLS_LANG setting by the DBA running the upgrade script?
    B) Otherwise: is there a way to test for the NLS_LANG setting inside the script and abort if it is not WE8MSWIN1252?
    Info:
    Database is 10.2.0.3/10.2.0.4 and sometimes 10.2.0.5, always database character set WE8MSWIN1252.
    Client software: I do not know what each DBA uses but it will be mostly 10g client software
    Client OS: Some DBA's will be running the script from Windows, others from some Unix variety. I cannot control that.

    I agree with Sergiusz. You're much better off if you can remove character set dependencies from your scripts by using commands like this.
    UPDATE SHOPS SET DESCRIPTION =  unistr( 'Caf\00E9' )
    WHERE SHOP_ID=1 ;If that's not possible however you can try this approach to determine the session's character set.
    SQL> column USERENV_LANGUAGE format a30
    SQL> column oracle_charset   format a20
    SQL> r
      1  select
      2    userenv_language
      3  , substr
      4    ( userenv_language
      5    , instr( userenv_language, '.' ) + 1
      6    ) as oracle_charset
      7  from
      8  ( select sys_context( 'USERENV', 'LANGUAGE' ) as userenv_language
      9    from dual
    10* )
    USERENV_LANGUAGE               ORACLE_CHARSET
    AMERICAN_AMERICA.AL32UTF8      AL32UTF8 --
    Joe

  • Semicolon and / in SQL Plus scripts?

    Anyone,
    Seem to have some confusion over the use of / and ; inside PL SQL Scripts run in SQL Plus.
    I seem to get two commits thereby two rows on INSERT clase that has a ; and a /.
    i.e.
    /* Insert record into table for recording statistics on the runtime of this script */
    INSERT INTO MYTABLE ( col1, col2) VALUES ( value1, value2);
    COMMIT;
    /The above will get two of the same rows in the table. Is this an issue with SQL Plus settings? What do people typically use? I have a combination of SQL and DDL in my scripts and I need / for the DDL typically as I understand. How do othere intermix these and what standard is used.

    Dave, here are the very basics.
    The SQL language does not have command separators as only a single command at a time can be issued. Thus the following is invalid SQL:
    SELECT * FROM emp;
    The semicolon as command separator (or terminator) is not valid SQL. This is valid SQL:
    SELECT * FROM emp
    PL/SQL is a programming language similar to Pascal, C and Java. Multiple commands are used in a program. These need to be separated so that the parser/compiler can know where a command starts and where it ends. In PL/SQL the semicolon is used.
    The following is invalid PL/SQL as it is missing command separators:
    declare
    i integer
    begin
    i := 1234
    endThe following is valid PL/SQL :
    declare
    i integer;
    begin
    i := 1234;
    end;SQL*Plus is an Oracle CLI (command line interface) client. It can submit both SQL and PL/SQL to the database. It needs to know when you have stopped entering commands into its input buffer and to submit what you've entered to the database.
    SQL*Plus uses two characters for this. The semicolon and the forward slash. If you want to submit the above SELECT to Oracle using SQL*Plus, SQL*Plus needs to know when to submit its input buffer's content - thus:
    SQL> SELECT * FROM emp;
    Or:
    SQL> SELECT * FROM emp
    SQL> /
    When using PL/SQL in SQL*Plus, SQL*Plus "understands" that the semicolons you use are for the PL/SQL language - not an instruction from you to it to submit its buffer to Oracle for execution.
    The forward slash can also be at anytime used to resubmit the current SQL*Plus input buffer again. E.g.
    SQL> SELECT * FROM emp;
    .. now do the last SQL (or PL/SQL) in the buffer again
    SQL> /[i]

  • When connecting to database in SQL* plus giving Error

    hi,
    I am using Oracle 10g. My problem is when i connecting to database in Server through SQL * Plus giving the Error:
    ORA-12514: TNS:listerner does not currently know of service requested in connect descriptor.
    Why this is happening i don't know. I created listener also. But no use. How to solve this can any tell me pls... ! .
    Thank u...!

    hi,
    Thank u bang for u r reply. It is not working sir. I added the listener as follows:
    # listener.ora Network Configuration File: D:\oracle10g\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = HA14)(PORT = 1521))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\oracle10g)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = OVSL06)
    (ORACLE_HOME = D:\oracle10g)
    (SID_NAME = OVSL06)
    (SID_DESC =
    (GLOBAL_DBNAME = OVSL06)
    (ORACLE_HOME = D:\oracle10g)
    (SID_NAME = OVSL06)
    I typed the following commands in command prompts
    C:\>lsnrctl
    LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production on 30-MAY-2007 16:29
    :14
    Copyright (c) 1991, 2004, Oracle. All rights reserved.
    Welcome to LSNRCTL, type "help" for information.
    LSNRCTL> stop
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=HA14)(PORT=1521)))
    The command completed successfully
    LSNRCTL> start
    Starting tnslsnr: please wait...
    TNSLSNR for 32-bit Windows: Version 10.1.0.2.0 - Production
    System parameter file is D:\oracle10g\network\admin\listener.ora
    Log messages written to D:\oracle10g\network\log\listener.log
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=HA14)(PORT=1521)))
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROCipc)
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=HA14)(PORT=1521)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 32-bit Windows: Version 10.1.0.2.0 - Produ
    ction
    Start Date 30-MAY-2007 16:29:28
    Uptime 0 days 0 hr. 0 min. 2 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File D:\oracle10g\network\admin\listener.ora
    Listener Log File D:\oracle10g\network\log\listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=HA14)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROCipc)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    same error is getting as i am getting previously. Tell me solution pls....!
    Thank u...!

Maybe you are looking for

  • Only show subtotals (hide detail records)

    Hey, I have a very special 'need'. I hope I can explain myself. In short: I have a query and I only want to see the subtotals. I have a DSO with the following relevant fields. CITY, DATE, ORDERNR, CONSTANT, COUNT (= 1 for every order) In my rows I ad

  • Change text in Exception  report

    Hello, I have created a exception report. When I move the mouse pointer over one of the figures that have an exception value, the text below the pointer pops up and reads either, good1, bad7 or medium 4 depending on the value and the exception it is

  • Best practice with otr texts in wd

    hi, when I enhance a wd component I want to work with otr texts and I have two questions: 1. Is the best way to store the otr texts in a separate new package or in the still existing package of the enhanced wd component? 2. Makes it sense to fetch ev

  • Error Opening Database

    Hi I have just repaired my Aperture 3.1 Database hoping that it would help with some difficulties I have with the software. Now it is completed when I try to open Aperture I get the message "There was an error opening the database for the library "/V

  • How to keep icon on folder when i use yousendit or email?

    Hi there, I am trying to email or yousend a folder to a client and when i do they can not see icon i have put on the folder... is there any way of keeping the picture there?