SQL command IN is working whereas NOT IN   not working

In application code I have the below code.
IF v_service_variant NOT IN(0,1,2,3,4) THEN --Checking whether existing service variant is applicable in 21Cn Fibre.
v_service_variant := 3; --If not making it as a standard service
UPDATE sspt_sessions_table SET service_variant = v_service_variant WHERE sess_id=v_sess_id; --Updating sspt_sessions_table
SELECT DECODE(service_variant_id, 0, 'None', 1, 'Loadbalancing', 2, 'Failover',3, 'BGP4', 4, 'Backup') INTO l_service_variant --To get the service variant name
FROM sspt_maj_resilience WHERE service_variant_id=v_service_variant;
UPDATE sspt_prquote_details SET service_variant = l_service_variant WHERE ftip=l_ftip AND sess_id=v_sess_id; --Updating sspt_prquote_details
COMMIT;
END IF;
Then the statements inside the if condition are not being executed. At the same time if I am replacing NOT IN with IN only and making changes to get if condition true then it is going inside the IF condition.... Could anyone please help me on this

Hi,
Does this happen when using SQL*Developer or if you run the SQL in SQLPLUS ?
If it is when running in SQLPLUS then it woul dbe better to raise it in the SQL Forum -
Forum: SQL and PL/SQL
PL/SQL
This forum is for problems using SQL*Developer.
Regards,
Mike

Similar Messages

  • SQL commands doesn't work

    I've instaled an oracle lite8i version 4.0.0.2.0 on Windows 98 operation system.
    When i try to change something in polite DB, the sql commands doesn't cause any effect on the polite.
    For example :
    when i type "alter user system identified by asd", even connected as system, i receive the message "Operation 0 succeeded", but the password doesn't change.
    This also happen with "create user ... " "create table ... "
    What should i do ????
    Thanks

    "/" does work . Please give a full working example that doesn't work.
    In Home>SQL>SQL Commands you usually execute a single command.
    But you can write multiple commands like:
    create table xx1(n number)
    drop table xx1
    /To execute one after the other, just highlight the first
    create table xx1(n number)
    /and press <ctrl>+<enter> .
    Then highlight the next command and press <ctrl>+<enter> again.
    --- OR ---
    create a sql script in Home>SQL>SQL Scripts . Then you can execute multiple commands at once.
    ~Dietmar.

  • SQL command IN is working , but NOT IN is not working for the below code...

    In application code I have the below code.
    IF v_service_variant NOT IN(0,1,2,3,4) THEN --Checking whether existing service variant is applicable in 21Cn Fibre.
    v_service_variant := 3; --If not making it as a standard service
    UPDATE sspt_sessions_table SET service_variant = v_service_variant WHERE sess_id=v_sess_id; --Updating sspt_sessions_table
    SELECT DECODE(service_variant_id, 0, 'None', 1, 'Loadbalancing', 2, 'Failover',3, 'BGP4', 4, 'Backup') INTO l_service_variant --To get the service variant name
    FROM sspt_maj_resilience WHERE service_variant_id=v_service_variant;
    UPDATE sspt_prquote_details SET service_variant = l_service_variant WHERE ftip=l_ftip AND sess_id=v_sess_id; --Updating sspt_prquote_details
    COMMIT;
    END IF;
    Then the statements inside the if condition are not being executed. At the same time if I am replacing NOT IN with IN only and making changes to get if condition true then it is going inside the IF condition.... Could anyone please help me on this

    950474 wrote:
    In application code I have the below code.
    IF v_service_variant NOT IN(0,1,2,3,4) THEN --Checking whether existing service variant is applicable in 21Cn Fibre.
    v_service_variant := 3; --If not making it as a standard service
    UPDATE sspt_sessions_table SET service_variant = v_service_variant WHERE sess_id=v_sess_id; --Updating sspt_sessions_table
    SELECT DECODE(service_variant_id, 0, 'None', 1, 'Loadbalancing', 2, 'Failover',3, 'BGP4', 4, 'Backup') INTO l_service_variant --To get the service variant name
    FROM sspt_maj_resilience WHERE service_variant_id=v_service_variant;
    UPDATE sspt_prquote_details SET service_variant = l_service_variant WHERE ftip=l_ftip AND sess_id=v_sess_id; --Updating sspt_prquote_details
    COMMIT;
    END IF;
    Then the statements inside the if condition are not being executed. At the same time if I am replacing NOT IN with IN only and making changes to get if condition true then it is going inside the IF condition.... Could anyone please help me on thishow can we reproduce what you report?
    while "not working" may be 100%, it is also 100% devoid of any actionable detail.
    what results when it is not working?
    how would working results supposedly appear?
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • UPDATE sql command won't work

    Hi,
    I have troubles using UPDATE command. I have ACCESS database and a table created by
    create table ACCOUNTNAMES (ACC_ID VARCHAR(30) primary key, ACC_NAME VARCHAR(40), ACTIVEPASSIVE VARCHAR(30))accessed by
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conection = DriverManager.getConnection("jdbc:odbc:mydatabasename", username, password);
    statement = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    resultSet = statement.executeQuery("SELECT * FROM ACCOUNTNAMES");
    // Working with resultSet
    statement.executeQuery("update ACCOUNTNAMES set ACC_NAME = "TEST" where ACC_ID = "60"");I have SQL exception at this point saying
    "[ODBC MS Access Driver] Too few parameters. Expected 2"
    I have a row with ACC_ID = 60 in the table. "Expected" might also be 1.
    Please give me your advice.

    statement.executeQuery("update ACCOUNTNAMES set ACC_NAME = "TEST" where ACC_ID = "60"");Is TEST a variable nameif so you have to concatenate it
    try the below stmt. to update the ACC_NAME as TEST.
    statement.executeQuery("update ACCOUNTNAMES set ACC_NAME = 'TEST' where ACC_ID = 60");

  • "Between NVL" - Works in SQL Command, not in APEX report region

    First, I realize I could use dynamic SQL (model 4), but I don't want to (too hard just yet).
    I have a select statement with a series of Where conditions that employ values, in bind variables, supplied by the user.
    I want the choice of parameters to be optional, so I am checking for and replacing nulls.
    Select emp_name from employee_table where
    emp_rating between nvl(:p7_rating_choice, 0) and nvl(:p7_rating_choice, 99)
    and
    emp_language_no between nvl(:p7_lang_choice, 0) and nvl(:p7_lang_choice, 99);
    (the binds should be numeric).
    The actual statement is quite a bit longer, but the point is that the BETWEEN NVL(:x, min) AND NVL(:x, max) piece does not seem to work when used in a report region.
    It works fine if ALL parameters are provided, but returns an error if one or more are null.
    In the SQL command window it works (with a pop-up) just fine.
    By the way, the :p7_lang_choice bind variable is chosen from a LOV list which works in all other cases.
    Also, if I disable nulls (choosing "no" in ITEM page), everything works fine. It seems that the substitution of the min and max values via the NVL returns the wrong data type.
    Any ideas what I have done wrong?

    Thanks Scott.
    Every day brings a little more understanding!
    I also noticed a simplified method in the APEX documentation (although there was no explanation of the code) as follows:
    Where
    (column = :p1_user_input_1 OR :p1_user_input_1 = [null substitution value])
    AND
    (column = :p1_user_input_2 OR :p1_user_input_2 = [null substitution value])
    AND
    etc...
    Using the value you provide in the LOV section for the null, the second part of the OR handles the null situation.
    For some reason I was so tied up with comparing to the column that I never thought to have an OR with a compare to something else.
    Oh well.
    Thanks,
    Norm

  • Cannot change SQL command text in Data Flow Task

    I have an SSIS package that extracts data from Teradata into a SQL Server DB.
    I'm using SQL Server 2008 R2 EE x64, and Visual Studio 2008 PE (BIDS) supplied with it, accessing Teradata v13.
    In the Integration Services project, I have a Data Flow Task, it has an ADO .net source which has Data access mode set to “SQL Command”.
    This worked for a while when I initially entered a SQL statement to select data.
    But, when I change the existing SQL Command text and save the package, the changes are lost.
    It keeps going back to the original SQL Statement.
    It is currently “select col1, col2, … col10 from view1”.
    When I change it to anything else, like “select col5 from view1”, and save, and then double click the ADO NET source again, I find that the SQL command text is still the old one. It goes back to the previous statement.
    I’ve tried other statements like “exec macro” for Teradata, etc. but the same thing keeps happening - changes are not saved.
    Does anyone have any ideas on this, or have you seen this before?

    This is odd, but seems to be a component metadata corruption; so why don't you:
    delete the teradata connector and source component, then re add them back, see if it now accepts the new SQL statement, if this does not work
    abandon this package and create a new one replicating the functionality incorporating the new SQL.
    In case #1 and 2 both fail post here any errors observed and find out whether you are missing any updates to either Teradata provider or SQL Server
    Arthur My Blog

  • Adding multiple SQL Commands, Errors

    When I add a second SQL Command to my report I get the following error messages right before it attempts to update the data.  I have tried replacing the new SQL into the existing SQL command and it works, so I am fairly certain the SQL syntax is correct.
    "Failed to retrieve data from the database" and "unknown database connection error".
    Any idea as to why this is occurring?
    Thanks!

    If you're using a command, you should use a single command to provide ALL of the data for your report.  Please see my post here Best Practices When Using Commands with Crystal Reports for more information about how to use commands.
    -Dell

  • Possible bug in SQL Commands – object required

    Hello,
    I tried to run the following in the SQL Commands:
    select * from emp
    where empno = (select MIN(empno)
                 from emp
                 where empno > :ITEM)If memory serve, it was suppose to open a pop up window, and allow me to enter a value for the bind variable. What I'm getting is a run time error about object required. Am I missing something?
    Thanks,
    Arie.

    Hi Dimitri,
    Yes, you are correct. It's strange though, because I don't remember such a behavior in the past, and also with this current browser configuration, I don't seems to have any problems with date pickers or help windows. I should probably look into it a bit deeper.
    Thanks,
    Arie.

  • Code block works in SQL Command Processor but not in application

    Hello forum,
    Been struggling with this for a few days without success:
    I have a form with a popup LOV called P6_POPUP, a file browse item called P6_BROWSE, a SUBMIT button, and a Process with the following code:
    declare
    q_image_id number;
    begin
    select host_family_photos_seq.nextval into q_image_id from dual;
    insert into host_family_photos (image_id, file_object_id, image_name)
    select q_image_id, id, filename
    from htmldb_application_files where filename = :P6_BROWSE;
    update host_family set image_id = q_image_id where family_name = :P6_POPUP;
    end;
    The Process Point is set to On Submit after Computations and Validations and When Button Pressed is set to the Submit button.
    When I run the page the file is imported into HTMLDB_APPLICATION_FILES
    but the insert and update do not occur.
    The URL header after submitting is as follows:
    http://127.0.0.1:8080/apex/f?p=115:1:480837828458787::NO:::&success_msg=Photo%20Imported%2FB87C5A54684B0DF005D09D0DFE6E98D6%2F
    However if I run the above code in the APEX SQL Command window and supply the required variables it works every time - most confusing.
    Not sure what to try from here.
    thanks for your time,
    Brett

    Scott:
    I always thought that the File Browse item maps to the NAME column in the view (below) and that is guaranteed to be unique. The NAME column seems to have a system-generated "F1234" id embedded in it (to guarantee uniqueness, I thought).
    In other words, when we put a File Browse item on the page, submitting the page uploads the file into the HTMLDB_APPLICATION_FILES table and the way to access that record (to copy/move it into our own custom table) is by doing
    from htmldb_application_files
    where name = :P1_BROWSEThanks
    SQL> desc htmldb_application_files
    Name                                      Null?    Type
    ID                                        NOT NULL NUMBER
    FLOW_ID                                   NOT NULL NUMBER
    NAME                                      NOT NULL VARCHAR2(90)
    FILENAME                                           VARCHAR2(400)
    TITLE                                              VARCHAR2(255)
    MIME_TYPE                                          VARCHAR2(48)
    DOC_SIZE                                           NUMBER
    DAD_CHARSET                                        VARCHAR2(128)
    CREATED_BY                                         VARCHAR2(255)
    CREATED_ON                                         DATE
    UPDATED_BY                                         VARCHAR2(255)
    UPDATED_ON                                         DATE
    LAST_UPDATED                                       DATE
    CONTENT_TYPE                                       VARCHAR2(128)
    BLOB_CONTENT                                       BLOB
    LANGUAGE                                           VARCHAR2(30)
    DESCRIPTION                                        VARCHAR2(4000)
    FILE_TYPE                                          VARCHAR2(255)
    FILE_CHARSET                                       VARCHAR2(128)

  • COPY command not working SQL Commands editor

    Hi All,
    I want to have a simple 'one-button-solution' for copying few tables from an external DB into the database where my Apex application is running.
    When I issue the following from the sqlplus command line I get the following output:
    SQL> COPY FROM schema/password@tnsnames_sid TO schema/password@tnsnames_sid REPLACE TABLE_TEST USING select * from TABLE_FOREIGN;
    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 TABLE_TEST dropped.
    Table TABLE_TEST created.
    2 rows selected from schema@tnsnames_sid.
    2 rows inserted into TABLE_TEST.
    2 rows committed into TABLE_TEST at schema@tnsnames_sid.
    SQL>
    However, if I try exactly the same command from within the Apex 'SQL Commands' editor, I get the following error message:
    ORA-00900: invalid SQL statement
    NOTE that the reason I use COPY command is to overcome problems with LONG datatype which arise when doing simply CREATE TABLE AS.... with dblink.
    In anycase, how can I make this work from within the 'SQL Commands' editor (and therefore in a button process).
    Regards,
    Pawel.

    Hi Harman,
    yes, this is a known issue.
    It's fixed with NW04 SPS 13.
    Regards Matthias Röbig-Landau

  • Sql command not working with date time??

    I am using my own sql query to fetch data in the sql command.
    Due to the problem I found - here is the basic example:
    The sql is:
    select to_number(to_date('10/11/2011 10:23:00','dd/mm/yyyy hh24:mi:ss') - to_date('10/11/2011 10:20:00','dd/mm/yyyy hh24:mi:ss'))  minu  from dual
    But I am not getting anything in Crystal Report tool!!
    In any sql tool I get results.
    When I am not using time part (hh24:mi:ss) :
    select to_number(to_date('10/11/2011','dd/mm/yyyy') - to_date('09/11/2011','dd/mm/yyyy'))  minu
    from dual
    I am getting data!!!!
    What is the problem??
    Initially I had it with parameters of type 'Date Time'
    Please, any one knows what the problem is?

    Hi,
    Sorry for the delay and thanks for answering.
    It was partial solution
    Moving to oracle driver, not (OLE DB), this specific one worked fine:
    select to_number(to_date('10/11/2011 10:23:00','dd/mm/yyyy hh24:mi:ss') - to_date('10/11/2011 10:20:00','dd/mm/yyyy hh24:mi:ss'))*100 minu from dual
    BUT
    When I tried to change one of the hardcoded values to be parameter of type 'Date Time' I couldn't pass the validation step - mostly the errors:
    "ORA 00900 Invalid sql statment"   and
    "ORA - 00907: Missing right parnthesis"
    No matter which format I used.
    Last version is:  
    select to_date('{?tsStartReport}','yyyy-mm-dd hh24:mi:ss') from dual
    Any idea why 'Date Time; is so problematic? How can I workaround it?

  • SQL command (with XPath) does not work properly with JSP

    Hello everyone,
    I try this SQL command on Oracle SQL Developer,
    select filename,
    extract(xml_col, '/Operation/Records/tabDetail/Vehicle_Level/text()') as Vehicle_Level,
    extract(xml_col, '/Operation/Records/tabDetail/Vehicles_Closed/text()') as Vehicles_ID
    from ope
    where upload_datetime in
    (select min(upload_datetime)
    from ope
    where (TO_DATE(TO_CHAR(upload_datetime, 'DD-MM-YYYY'),'DD-MM-YYYY'))
    between TO_DATE('01-01-2008','DD-MM-YYYY') and TO_DATE('01-07-2008','DD-MM-YYYY')
    HAVING (filename like '60-1-%')
    GROUP BY filename);
    It works properly, the result is :
    FILENAME --------------------- VEHICLE_LEVEL --------------------- VEHICLES_ID
    60-1-OPE-1.xml --------------------- 3 --------------------- 60-1-VEH-43
    But when I try this command on JSP, the result is :
    FILENAME --------------------- VEHICLE_LEVEL --------------------- VEHICLES_ID
    60-1-OPE-1.xml --------------------- null --------------------- null
    I don't want "null" value, but I don't know where is wrong. Please help me.
    Thank you very much.
    Orange Jasmin

    If you know that the videos and music have been working before and that the ID3 tags are correct I suggest that you try to reinstall the phone software using Update Service.
    http://www.sonymobile.com/gb/tools/update-service/
    Let me know if these problems remains after reinstall.
     - Community Manager Sony Xperia Support Forum
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • Adobe PDF iFilter SQL Server 2008 R2 Full Text not working

    Unable to get the SQL Server 2008 R2 to index PDF files for full-text searching.
    Environment: Windows 7 SP1 Enterprise 64-bit, SQL Server 2008 R2 Express SP3 64-bit, Adobe Reader 11.x
    Installed PDF iFilter 64 (11.0.01) from
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5542
    Added its folder (C:\Program Files\Adobe\Adobe PDF iFilter 11 for 64-bit platforms\bin\;) to the PC system Path variable. Rebooted PC.
    Confirmed SQL Server sees the Adobe PDF iFilter ..... SELECT * from sys.fulltext_document_types where document_type = '.pdf' 
    Inserted PDF files to my table (see below for CREATE statement).
    The SQLFT log says  ... Warning: No appropriate filter was found during full-text index population for table or indexed view '[TestDB].[dbo].[pdfifiltertable]' (table or indexed view ID '2105058535', database ID '7'), full-text key value '1'.
    Some columns of the row were not indexed.
    Installed other filters for Office. Added files of type DOC, XPS. Confirmed the search query works for those file types. So as such SQL Full-Text is enabled and working.
    Below my T-SQL commands:
    Exec sp_fulltext_service 'load_os_resources', 1
    Exec sp_fulltext_service 'verify_signature', 0
    Exec sp_fulltext_database 'enable'
    CREATE TABLE pdfifiltertable(
    PdfID INT IDENTITY NOT NULL,
    PdfFileName VARCHAR(MAX),
    Ext VARCHAR(10) ,
    PdfText VARBINARY(MAX),
    CONSTRAINT PK_PdfID PRIMARY KEY (PdfID)
    GO
    CREATE FULLTEXT CATALOG pdfCatalog AS DEFAULT
    GO
    CREATE FULLTEXT INDEX ON pdfifiltertable([PdfText] Type column [Ext]
    ) KEY INDEX PK_PdfID with change_tracking auto
    GO
    SELECT pdfFileName FROM pdfifiltertable WHERE CONTAINS(pdftext, 'payment')

    What edition are you using? Like is it SQL-Express or SQL-Standard etc.
    Adding files using C# desktop application.
    Tested in another PC SQL-Server Express 2008 with Windows 7 64-bit. Same issue.
    C# source code ... add a button called uploadPDF and a datagridview called datagridview to the form.
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    namespace UploadPDF
    public partial class Form1 : Form
    #region Properties
    protected static string ConnectionString {
    get {return "Integrated Security=SSPI;database=Testdb;Data Source=localhost\\SQLEXPRESS;Workstation ID=localhost;";}
    protected static SqlConnection Connection {
    get {return new SqlConnection(ConnectionString);}
    protected DataTable pdfDataTable;
    #endregion
    public Form1()
    InitializeComponent();
    populateDataGrid();
    protected void populateDataGrid()
    SqlConnection con = Connection;
    con.Open();
    try
    pdfDataTable = new DataTable();
    SqlCommand cmd = new SqlCommand( "select * from pdfifiltertable", con);
    SqlDataAdapter adapter = new SqlDataAdapter(cmd);
    adapter.Fill(pdfDataTable);
    dataGridView.DataSource = pdfDataTable;
    dataGridView.Columns[3].Visible = false;
    finally {
    con.Close();
    private void uploadPDF_Click(object sender, EventArgs e) {
    if (DialogResult.Cancel == fileOpenDialog.ShowDialog()) return;
    try {
    byte[] content = FileToByteArray(fileOpenDialog.FileName);
    uploadPDFBlob2DataBase(fileOpenDialog.FileName,content);
    populateDataGrid();
    } catch (Exception ex) {
    MessageBox.Show(ex.Message, "PDFiFilter11", MessageBoxButtons.OK, MessageBoxIcon.Error);
    public byte[] FileToByteArray(string _FileName) {
    byte[] pdfBuffer = null;
    try {
    System.IO.FileStream _FileStream = new System.IO.FileStream(_FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read);
    System.IO.BinaryReader _BinaryReader = new System.IO.BinaryReader(_FileStream);
    long TotalNumberOfBytes = new System.IO.FileInfo(_FileName).Length;
    pdfBuffer = _BinaryReader.ReadBytes((Int32)TotalNumberOfBytes);
    _FileStream.Close();
    _FileStream.Dispose();
    _BinaryReader.Close();
    } catch (Exception _Exception) {
    Console.WriteLine("Exception caught in process: {0}", _Exception.ToString());
    return pdfBuffer;
    public void uploadPDFBlob2DataBase(String fName, byte[] content) {
    SqlConnection con = Connection;
    con.Open();
    String ext,filename;
    ext = Path.GetExtension(fName);
    filename = Path.GetFileName(fName);
    try {
    SqlCommand insert = new SqlCommand( "insert into pdfifiltertable ([PdfFileName],[Ext],[PdfText]) values ((@pdfFileName),(@extension),(@pdfcontent))", con);
    SqlParameter pdffilenameParameter = insert.Parameters.Add("@pdfFileName", SqlDbType.NText);
    pdffilenameParameter.Value = filename;
    pdffilenameParameter.Size = filename.Length;
    SqlParameter extParam = insert.Parameters.Add("@extension", SqlDbType.NVarChar);
    extParam.Value = ext;
    extParam.Size = ext.Length;
    SqlParameter pdfcontentParameter = insert.Parameters.Add("@pdfcontent", SqlDbType.Binary);
    pdfcontentParameter.Value = content;
    pdfcontentParameter.Size = content.Length;
    insert.ExecuteNonQuery();
    } finally {
    con.Close();
    } //class
    } //namespace

  • SQL*Plus variable assignment works for 8i but not 9i

    We have scripts that connect to each database on the box and perform database tasks nightly. The scripts first set the environment then connects to each database with SQL*Plus. This works for 8i but fails in the recently created 9i environment. (Unix Solaris environment)
    Because the SQL*Plus connection appears in many areas in the scripts, we assign the following connection string to a variable:
    SQLPLUS="/usr/oracle/product/9.2.0/bin/sqlplus -s 'xxx/xxxxxx@xxxx as sysdba'"
    Export SQLPLUS
    echo "$SQLPLUS"
    (This echo out correctly: /usr/oracle/product/9.2.0/bin/sqlplus -s 'xxx/xxxxxx@xxxx as sysdba')
    It fails when the script calls the assigned variable:
    $SQLPLUS <<-EOF
    with the following error:
    Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
    where <option> ::= -H | -V | [ [-L] [-M <o>] [-R <n>] [-S] ]
    <logon> ::= <username>[<password>][@<connect_string>] | / | /NOLOG
    <start> ::= @<URI>|<filename>[.<ext>] [<parameter> ...]
    "-H" displays the SQL*Plus version banner and usage syntax
    "-V" displays the SQL*Plus version banner
    "-L" attempts log on just once
    "-M <o>" uses HTML markup options <o>
    "-R <n>" uses restricted mode <n>
    "-S" uses silent mode
    However, if I remove the SQLPLUS variable assignment and changed all occurrence of
    $SQLPLUS <<-EOF to
    /usr/oracle/product/9.2.0/bin/sqlplus -s 'xxx/xxxxxx@xxxx as sysdba' <<-EOF
    Then the script runs successfully. But this solution is cumbersome.
    Any ideas as to how to have the script work with assigning the SQLPLUS variable????
    Any help is appreciated.

    I has an immediate suspicion it might be related to the issue
    mentioned in
    http://otn.oracle.com/support/tech/sql_plus/htdocs/sub_var2.html#2_7
    but this proved wrong: the SP2-306 still occurs in the latest
    SQL*Plus.
    I wonder what version of 8i you had working? With an old SQL*Plus
    8.1.7.0 my connection failed the same as in 9.2 and 10i.
    My solution was to do:
      SQLPLUS='sqlplus -s'
      UNPW='/ as sysdba'
      $SQLPLUS "$UNPW" &lt;&lt;EOF
      EOFThis worked in 9.2.0.5, 10.1.0.2 and 8.1.7.0.
    One common security risk on UNIX remains: putting the username and
    password on the command line. On some systems a "ps" command will
    show the password to any user. If OS authentication cannot be used
    for connection, perhaps putting the username/password in the SQL
    script may be more secure?
    A final note is that in SQL*Plus 10g, no quotes are needed around
    AS SYSDBA, i.e.
      sqlplus / as sysdba works from the OS prompt, whereas in 9.2 you need to do
      sqlplus "/ as sysdba"This makes a solution easy:
      SQLPLUS="/usr/oracle/product/10.1.0/bin/sqlplus -s xxx/xxxxxx@xxxx as sysdba"-- CJ

  • SQL Error [ORA-00933: SQL command not properly ended

    I have following installed:
    7.9.6 BI Apps
    10.1.3.4 DAC
    8.6.0 Informatica
    Container JDE Enterprise 9.0
    Out of 211 tasks 69 tasks executed successfully.
    Error in workflow [SDE_JDE_PartyOrganisationDimension_Full].
    I have checked the session log file and understand that there is error with the SQL statement.
    Since it is Pre-built, the workflow should have run properly with correct SQl statement. But in this case it is not working.
    Is it because the SQL statement is too long?
    Any help will be greatly appreciated.
    Part of the log file
    RR_4035 : SQL Error [
    ORA-00933: SQL command not properly ended
    Database driver error...
    Function Name : Execute
    SQL Stmt : SELECT
    F0101.ABAN8,F0101.ABALKY,F0101.ABTAX,F0101.ABALPH,F0101.ABMCU,F0101.ABSIC,F0101.ABAT1, F0101.ABTAXC, F0101.ABATP, F0101.ABATR,F0101.ABEFTB,F0101.ABAC01,
    F0101.ABAC02, F0101.ABAC03, F0101.ABAC04, F0101.ABAC05, F0101.ABAC06, F0101.ABAC07, F0101.ABAC08, F0101.ABAC09, F0101.ABAC10, F0101.ABAC11,
    F0101.ABAC12, F0101.ABAC13, F0101.ABAC14, F0101.ABAC15, F0101.ABAC16, F0101.ABAC17, F0101.ABAC18, F0101.ABAC19, F0101.ABAC20, F0101.ABAC21, F0101.ABAC22, F0101.ABAC23,
    F0101.ABAC24, F0101.ABAC25, F0101.ABAC26, F0101.ABAC27, F0101.ABAC28, F0101.ABAC29, F0101.ABAC30,F0101.ABUSER, F0101.ABUPMJ,F0101.ABUPMT,F0101.ABTICKER, F0101.ABEXCHG, F0101.ABDUNS,
    F0101.ABNOE,F0101.ABGROWTHR,F0101.ABYEARSTAR,F0101.ABREVRNG, D.FaxPhoneArea, d.Phonearea, D.Fax AS Fax ,D.Phone As Phone,D.WPUPMJ AS WPUPMJ,R.Email AS Email,R.Internet As Internet,R.EAupmj As EAUPMJ,F0111.WWAN8,F0111.WWIDLN,
    F0111.WWSLNM,F0111.WWGNNM,F0111.WWMDNM,F0111.WWSRNM,F0111.WWUSER,F0111.WWUPMJ,F0111.WWUPMT,F0111.WWNTYP,F0111.WWNICK,F0111.WWPCM,F0116.ALAN8,
    F0116.ALEFTB,F0116.ALADD1,F0116.ALADD2,F0116.ALADD3,F0116.ALADD4, F0116.ALADDZ, F0116.ALCTY1,F0116.ALADDS,F0116.ALCTR, F0116.ALUPMJ,F0116.ALUPMT,F03012.AIAN8, F03012.AICO,F03012.AIMCUR,F03012.AICRCD,F03012.AIACL,
    F03012.AIARPY,F03012.AIDB,F03012.AICRCA,F03012.AIASTY,F03012.AISPYE,F03012.AIOPY,F03012.AIPOPN,F03012.AIDAOJ,F03012.AIAN8R,F03012.AICPGP,F03012.AIFRTH,
    F03012.AIMAN8,F03012.AIUPMJ,F03012.AIUPMT, F03012.AICUSTS,F03012.AITERRID, F03012.AIDTEE, F0401.A6AN8, F0401.A6MCUP, F0401.A6CRRP,F0401.A6CRCA, F0401.A6AN8R,F0401.A6CPGP, F0401.A6FRTH, F0401.A6UPMJ,F0401.A6UPMT, CAST(F0101.ABAC03 AS CHAR(10)) AS FLEX_ATTRIB_1_CHAR,
    CAST(F0101.ABAC23 AS CHAR(10)) AS FLEX_ATTRIB_2_CHAR,
    CAST(F0101.ABAC05 AS CHAR(10)) AS FLEX_ATTRIB_3_CHAR,
    CAST(F0101.ABAC15 AS CHAR(10)) AS FLEX_ATTRIB_4_CHAR,
    CAST(F0101.ABAC09 AS CHAR(10)) AS FLEX_ATTRIB_5_CHAR,
    CAST(F0101.ABAC11 AS CHAR(10)) AS FLEX_ATTRIB_6_CHAR,
    CAST(F0101.ABAC19 AS CHAR(10)) AS FLEX_ATTRIB_7_CHAR,
    CAST(F0101.ABAC21 AS CHAR(10)) AS FLEX_ATTRIB_8_CHAR,
    CAST(F0101.ABAC27 AS CHAR(10)) AS FLEX_ATTRIB_9_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_10_CHAR,
    CAST(F0101.ABAC17 AS CHAR(10)) AS FLEX_ATTRIB_11_CHAR,
    CAST(F0101.ABAC06 AS CHAR(10)) AS FLEX_ATTRIB_12_CHAR,
    CAST(F0101.ABAC08 AS CHAR(10)) AS FLEX_ATTRIB_13_CHAR,
    CAST(F0101.ABAC14 AS CHAR(10)) AS FLEX_ATTRIB_14_CHAR,
    CAST(F0101.ABAC22 AS CHAR(10)) AS FLEX_ATTRIB_15_CHAR,
    CAST(F0101.ABAC28 AS CHAR(10)) AS FLEX_ATTRIB_16_CHAR,
    CAST(F0101.ABAC18 AS CHAR(10)) AS FLEX_ATTRIB_17_CHAR,
    CAST(F0101.ABAC10 AS CHAR(10)) AS FLEX_ATTRIB_18_CHAR,
    CAST(F0101.ABAC20 AS CHAR(10)) AS FLEX_ATTRIB_19_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_20_CHAR,
    CAST(F0101.ABAC30 AS CHAR(10)) AS LINE_OF_BUSINESS,
    CAST(F0101.ABAC14 AS CHAR(10)) AS REGION,
    CAST(NULL AS CHAR(10)) AS ACCNT_AHA_NUM,
    CAST(F0101.ABAC07 AS CHAR(10)) AS ACCNT_CLASS,
    CAST(F0101.ABAC11 AS CHAR(10)) AS ACCNT_HIN_NUM,
    CAST(F0101.ABAC02 AS CHAR(10)) AS ACCNT_REGION,
    CASt(F0101.ABAC08 AS CHAR(10)) AS ACCNT_VALUE,
    CAST(F0101.ABAC16 AS CHAR(10)) AS CUST_CAT_CODE, '0' AS X_CUSTOM
    from F0101
    INNER JOIN F03012 ON F0101.ABAN8 = F03012.AIAN8
    LEFT OUTER JOIN F0401 ON F0101.ABAN8 = F0401.A6AN8
    LEFT OUTER JOIN F0116 ON F0101.ABAN8 = F0116.ALAN8 AND F0101.ABEFTB = F0116.ALEFTB
    LEFT OUTER JOIN F0111 ON F0101.ABAN8 = F0111.WWAN8 AND F0111.WWIDLN =
    LEFT OUTER JOIN (select a.WPAN8 as an8,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) FaxPhoneArea,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Fax,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Phone,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) Phonearea,
    max(wpupmj) as WPUPMJ
    from F0115 a,
    (select WPAN8,WPPHTP ,min(WPRCK7) MinWPRCK7 from F0115
    group by WPAN8,WPPHTP
    ) b
    where a.WPAN8=b.WPAN8 and a.wpidln =0
    group by a.WPAN8)D on f0101.aban8 = D.an8
    LEFT OUTER JOIN (SELECT P.EAAN8 as an8,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Email,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Internet,Max(eaupmj) as EAupmj
    FROM F01151 P,
    (SELECT EAAN8,EAETP,MIN(EARCK7) MinRck7E from f01151
    group by eaan8,eaemal,eaetp)Q
    where
    P.EAAN8 = Q.EAAN8 and P.EAIDLN =
    GROUP BY P.EAAN8)R on f0101.aban8 = R.an8
    union
    SELECT
    F0101.ABAN8,F0101.ABALKY,F0101.ABTAX,F0101.ABALPH,F0101.ABMCU,F0101.ABSIC,F0101.ABAT1, F0101.ABTAXC, F0101.ABATP, F0101.ABATR,F0101.ABEFTB,F0101.ABAC01,
    F0101.ABAC02, F0101.ABAC03, F0101.ABAC04, F0101.ABAC05, F0101.ABAC06, F0101.ABAC07, F0101.ABAC08, F0101.ABAC09, F0101.ABAC10, F0101.ABAC11,
    F0101.ABAC12, F0101.ABAC13, F0101.ABAC14, F0101.ABAC15, F0101.ABAC16, F0101.ABAC17, F0101.ABAC18, F0101.ABAC19, F0101.ABAC20, F0101.ABAC21, F0101.ABAC22, F0101.ABAC23,
    F0101.ABAC24, F0101.ABAC25, F0101.ABAC26, F0101.ABAC27, F0101.ABAC28, F0101.ABAC29, F0101.ABAC30,F0101.ABUSER, F0101.ABUPMJ,F0101.ABUPMT,F0101.ABTICKER, F0101.ABEXCHG, F0101.ABDUNS,
    F0101.ABNOE,F0101.ABGROWTHR,F0101.ABYEARSTAR,F0101.ABREVRNG, D.FaxPhoneArea, d.Phonearea, D.Fax AS Fax ,D.Phone As Phone,D.WPUPMJ AS WPUPMJ,R.Email AS Email,R.Internet As Internet,R.EAupmj As EAUPMJ,F0111.WWAN8,F0111.WWIDLN,
    F0111.WWSLNM,F0111.WWGNNM,F0111.WWMDNM,F0111.WWSRNM,F0111.WWUSER,F0111.WWUPMJ,F0111.WWUPMT,F0111.WWNTYP,F0111.WWNICK,F0111.WWPCM,F0116.ALAN8,
    F0116.ALEFTB,F0116.ALADD1,F0116.ALADD2,F0116.ALADD3,F0116.ALADD4, F0116.ALADDZ, F0116.ALCTY1,F0116.ALADDS,F0116.ALCTR, F0116.ALUPMJ,F0116.ALUPMT,F03012.AIAN8, F03012.AICO,F03012.AIMCUR,F03012.AICRCD,F03012.AIACL,
    F03012.AIARPY,F03012.AIDB,F03012.AICRCA,F03012.AIASTY,F03012.AISPYE,F03012.AIOPY,F03012.AIPOPN,F03012.AIDAOJ,F03012.AIAN8R,F03012.AICPGP,F03012.AIFRTH,
    F03012.AIMAN8,F03012.AIUPMJ,F03012.AIUPMT, F03012.AICUSTS,F03012.AITERRID, F03012.AIDTEE, F0401.A6AN8, F0401.A6MCUP, F0401.A6CRRP,F0401.A6CRCA, F0401.A6AN8R,F0401.A6CPGP, F0401.A6FRTH, F0401.A6UPMJ,F0401.A6UPMT, CAST(F0101.ABAC03 AS CHAR(10)) AS FLEX_ATTRIB_1_CHAR,
    CAST(F0101.ABAC23 AS CHAR(10)) AS FLEX_ATTRIB_2_CHAR,
    CAST(F0101.ABAC05 AS CHAR(10)) AS FLEX_ATTRIB_3_CHAR,
    CAST(F0101.ABAC15 AS CHAR(10)) AS FLEX_ATTRIB_4_CHAR,
    CAST(F0101.ABAC09 AS CHAR(10)) AS FLEX_ATTRIB_5_CHAR,
    CAST(F0101.ABAC11 AS CHAR(10)) AS FLEX_ATTRIB_6_CHAR,
    CAST(F0101.ABAC19 AS CHAR(10)) AS FLEX_ATTRIB_7_CHAR,
    CAST(F0101.ABAC21 AS CHAR(10)) AS FLEX_ATTRIB_8_CHAR,
    CAST(F0101.ABAC27 AS CHAR(10)) AS FLEX_ATTRIB_9_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_10_CHAR,
    CAST(F0101.ABAC17 AS CHAR(10)) AS FLEX_ATTRIB_11_CHAR,
    CAST(F0101.ABAC06 AS CHAR(10)) AS FLEX_ATTRIB_12_CHAR,
    CAST(F0101.ABAC08 AS CHAR(10)) AS FLEX_ATTRIB_13_CHAR,
    CAST(F0101.ABAC14 AS CHAR(10)) AS FLEX_ATTRIB_14_CHAR,
    CAST(F0101.ABAC22 AS CHAR(10)) AS FLEX_ATTRIB_15_CHAR,
    CAST(F0101.ABAC28 AS CHAR(10)) AS FLEX_ATTRIB_16_CHAR,
    CAST(F0101.ABAC18 AS CHAR(10)) AS FLEX_ATTRIB_17_CHAR,
    CAST(F0101.ABAC10 AS CHAR(10)) AS FLEX_ATTRIB_18_CHAR,
    CAST(F0101.ABAC20 AS CHAR(10)) AS FLEX_ATTRIB_19_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_20_CHAR,
    CAST(F0101.ABAC30 AS CHAR(10)) AS LINE_OF_BUSINESS,
    CAST(F0101.ABAC14 AS CHAR(10)) AS REGION,
    CAST(NULL AS CHAR(10)) AS ACCNT_AHA_NUM,
    CAST(F0101.ABAC07 AS CHAR(10)) AS ACCNT_CLASS,
    CAST(F0101.ABAC11 AS CHAR(10)) AS ACCNT_HIN_NUM,
    CAST(F0101.ABAC02 AS CHAR(10)) AS ACCNT_REGION,
    CASt(F0101.ABAC08 AS CHAR(10)) AS ACCNT_VALUE,
    CAST(F0101.ABAC16 AS CHAR(10)) AS CUST_CAT_CODE, '0' AS X_CUSTOM
    from F0101
    LEFT OUTER JOIN F03012 ON F0101.ABAN8 = F03012.AIAN8
    INNER JOIN F0401 ON F0101.ABAN8 = F0401.A6AN8
    LEFT OUTER JOIN F0116 ON F0101.ABAN8 = F0116.ALAN8 AND F0101.ABEFTB = F0116.ALEFTB
    LEFT OUTER JOIN F0111 ON F0101.ABAN8 = F0111.WWAN8 AND F0111.WWIDLN =
    LEFT OUTER JOIN (select a.WPAN8 as an8,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) FaxPhoneArea,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Fax,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Phone,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) Phonearea,
    max(wpupmj) as WPUPMJ
    from F0115 a,
    (select WPAN8,WPPHTP ,min(WPRCK7) MinWPRCK7 from F0115
    group by WPAN8,WPPHTP
    ) b
    where a.WPAN8=b.WPAN8 and a.wpidln =0
    group by a.WPAN8)D on f0101.aban8 = D.an8
    LEFT OUTER JOIN (SELECT P.EAAN8 as an8,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Email,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Internet,Max(eaupmj) as EAupmj
    FROM F01151 P,
    (SELECT EAAN8,EAETP,MIN(EARCK7) MinRck7E from f01151
    group by eaan8,eaemal,eaetp)Q
    where
    P.EAAN8 = Q.EAAN8 and P.EAIDLN =
    GROUP BY P.EAAN8)R on f0101.aban8 = R.an8
    Oracle Fatal Error
    Database driver error...
    Function Name : Execute
    *****************************************************

    "ORA-00933: SQL command not properly ended"
    this error may be seen due to reasons like the Informatica properties are not set correct.
    Are all the informatica properties set correct? how many ETL jobs completed, what analytic apps are in the ETL process?

Maybe you are looking for

  • Mac mini keeps entering sleep mode

    Hi. I have a Mac mini that has this annoying problem where it keeps wanting to enter sleep mode. This problem seemed intermittent at first. What I notice is that my mini would enter sleep mode whenever I try to encode mp3. This seems reproducible. Wh

  • Convert HTML to PDF - API or utility

    Hi community, Our product generates HTML reports, after that the users can edit them, and finally they want to send them via e-mail to another party. They want to send PDF document generated from that HTML. So I need to convert the HTML to PDF. Till

  • How to know query execution time in sql plus

    HI I want to know the query execution time in sql plus along with statistics I say set time on ; set autotrace on ; select * from view where usr_id='abcd'; if the result is 300 rows it scrolls till all the rows are retrieved and finally gives me exec

  • RMB on WBS in CJ20N

    Hi Everybody, When i am doing  Right Click on a WBS in cj20n in the right side, iam not getting any popup windiwn whiich iam suppose to get. Pleae advise. Thanks in Advance. Regards.

  • Clips out of order in CS5 Media Browser

    Could someone please explain to me why my clips in media browser are completely out of order from the way they were shot?  I transferred the files directly into a file on the computer then called up those files from the media browser.  They don't app