SQL Plus Skipping Where Clause

Question: We are using .sql files, that are executed though SQLPlus to implement our production code, we have had instances where a developer put a extra line in the middle of his SQL statement. In the below examples, the 2nd script will execute and delete everything in the entire table, then give a error message message stating that it doesn't know what 'WHERE' is, and then commits(Only happens when executing from a .sql file, if you put the below SQL in the buffer and execute it... it doesn't happen)... does anyone know a way to tell SQLPlus to ignore carrage returns as the end of the SQL statement?
Example 1: Delete 1 Row
DELETE FROM TABLE1
WHERE ID = 1;
COMMIT;
Example 2: Delete's ALL Rows
DELETE FROM TABLE1
WHERE ID = 1;
COMMIT;

set sqlblankline on
(this default value is off)
and addtional...
set sqlterminator ;
(this default value is ;)
Message was edited by:
ushitaki

Similar Messages

  • Can a recursive sql have a where clause

    can the following sql have a where clause and I dont want to hard code the id is is that possible...
    select DISPLAY_NAME, ID, PARENT_ID, display_in_parent_folder, sub_folder_sequence
    from wwsbr_all_folders start with id = 8888
    connect by prior id= parent_

    actually g is another alias I created sorry I missed it... if I do this as a regular sub query I get three records but when I implement it as a recursive query it does not retutn any thing. Below is my regular query followed by the recursive query which I am using to organize the result but get no results:
    REGULAR Query that retrieves records with parent_id = from the list of parent ids
    select distinct f.DISPLAY_NAME, f.id, f.type_id, f.type_siteid, f.base_type_id, f.parent_id, f.sub_folder_sequence
    from WWSBR_ALL_FOLDERS f, WWSBR_ALL_FOLDERS g
         where g.parent_id = ( select g.parent_id from WWSBR_ALL_FOLDERS e
    where
         e.caid = 103 AND
    e.parent_id <> 0 AND
    e.type_id = 1 AND
    e.display_in_parent_folder <> 0 AND
         e.id = f.parent_id)
    order by f.id, f.sub_folder_sequence;
    Recursive query that results nothing:
    select distinct f.DISPLAY_NAME, f.id, f.type_id, f.type_siteid, f.base_type_id, f.parent_id, f.sub_folder_sequence
    from WWSBR_ALL_FOLDERS g, WWSBR_ALL_FOLDERS f start with f.id = ( select g.parent_id from WWSBR_ALL_FOLDERS e
    where
         e.caid = 103 AND
    e.parent_id <> 0 AND
    e.type_id = 1 AND
    e.display_in_parent_folder <> 0 AND
         e.id = f.parent_id)
         connect by prior f.id= g.parent_id
    order by f.id, f.sub_folder_sequence;

  • SQL Strings in Where Clause - single quotes issue

    All,
    I’m having issues related to SQL String literals when trying to deploy to flash. The complication works fine but I then get a message (see below) stating that a ; is missing. The SQL query and the iview runs fine when we use numeric values or do not apply a where clause on the table.
    I am using Visual Composer that has been packaged with NW2004sSP7_Preview
    VC & Flex Version: 645.7.0.3
    The Error message is get is;
    Error in executing a process for Flex compilation, Error 1033: ';' expected
          (C:usrsapJ2EJC01j2eeclusterserver0GUIMachine_Business_Packagestest_48731FLEX_COMPILATION_FOLEDRAADCN.mxml:269)
    Error 1205: The statement 'Test' is incomplete.
          (C:usrsapJ2EJC01j2eeclusterserver0GUIMachine_Business_Packagestest_48731FLEX_COMPILATION_FOLEDRAADCN.mxml:269)
    Failed to compile AADCN.mxml
    When I goto the deployment file – it has the below line;
    <i>'<Request type="EXECUTE_RELATIONAL" system="BI_JDBC" system_type="SAP_BI_JDBC" maxrows="500" templateid="BIR_SQL"><Objects type="INPUT" shape="OBJ" role="INPUT"><Object type="INPUT_FIELD" id="SQL_STATEMENT" appName="SQL" mapped="0" value=""/></Objects><Objects type="OUTPUT" shape="SET" role="OUTPUT"><Object type="OUTPUT_FIELD" id="name" appName="name"/></Objects><Objects id="1" type="TEMPLATE_PARAMETER"><Object id="2" type="SQL" value="select name from pub.srcompany where name ='Test Company'"/></Objects></Request>';</i>
    It seems that the parser for the flash deployment is prematurely finishing the parse when it hits the single quotation in the SQL string!
    We had a similar error where if we had a carriage return in the SQL (e.g. between the from & the where clause) then the deployment parser was stating that the line finished prematurely. In the deployment file the carriage return forced a new line thus making the message incomplete. Removing the carriage return resolve that issue
    The SQL Preview in the SQL Editor within VC works fine with the string literals in the where clause.
    The functionality compiles & deploys in web dynpro however it does not return the results to the table
    Questions
    1:> Has anyone successfully used flash with string literals in the SQL where clause or had seen this issue in the past?
    2:> Is there a setting to get the SQL working on Web dynpro for the information to be returned that I may have missed?
    Any assistance would be greatly appreciated.
    Best Regards,
    Ian.

    Hey,
    I have worked with SQL Editor a lot. Here's a how to guide I put together on it:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6339e7d4-0a01-0010-1c98-db00e52e989a
    Let me know if that helps...
    Prakash

  • Change JDBC select SQL query's where clause at runtime

    Hi,
    I have one JDBC sender channel with Select SQL Query which helps in fetching data from JDE table. We have defined where clause to fetch some particular records i.e. if ABC = NULL then fetch the record.. and then update query is used to turn that flag to "Y" i.e. ABC ="Y" so that next time the channel don't pick the same records again.
    Now the problem is that if we want to fetch some records again whose flag has been set to "Y" we cannot change the select query again and again in the production environment.
    Is there any way to change the select query of the JDBC channel at runtime e.g. Picking up some flat file where the conditions for the particular records to be picked are defined (ID=123) and changing the WHERE clause of select query in the JDBC channel for those records to be picked without using BPM.
    Thank you!
    With regards,
    Simran

    Hi Simran,
    Yes, it is possible with the help of store procedure. In SQL Server there is a IF-Else Conditional block, which you can use inside store procedure. Create a SP with 2 additional parameter something like FlagReadAgain and KeyField. Pass the flag always as True or False. For the Key field pass the record key which you want to read again if you are passing the Flag as True else pass it as 0 or whatever.
    In the procedure check if the value of flag is True -> If yes, Read the entry with key name specified in where part.
    In the else part put the query which you are using for the normal flow.
    IF (FlagReadAgain) = TRUE
    BEGIN
       SELECT EmpName, EmpAddress
       FROM Employee
       WHERE EmpID = 'E001'
    END
    ELSE
       BEGIN
         SELECT EmpName, EmpAddress
         FROM Employee
         WHERE Status = 'N'
       END
    You may also use the approach which Srini mentioned. Create an application to restore any value to intial stage so that it can be picked up by XI when it poll again.
    Choose any approach which you like.
    Regards,
    Jitender Chauhan

  • SQL: order of WHERE clauses important for performance?

    I wonder if the order of the WHERE clauses does affect performance or if the database optimize each query so that the order is irrelevant? Example: is
    SELECT *
    FROM Table1
    WHERE (fast condition check)
    AND (slow condition check)
    faster than
    SELECT *
    FROM Table1
    WHERE (slow condition check)
    AND (fast condition check)
    because the first condition check might be false and therefore the second is not executed? (Some kind of Java if (fast && slow) is faster than if (slow && fast) ?)

    It depends on how sophisticated the database optimizer is. IBM's DB2/UDB will completely rewrite the syntax of SQL as part of optimization and does not care what the order of the where clause is. Oracle actually has two optimizers RULE and COST. The RULE based optimizer is affected by the order of the where clause, COST is not (RULE is no longer available in the newest version of Oracle, Oracle 10g).

  • Simple finder results in huge slow sql query -- why WHERE clause?

    Hi all,
    wondering about the poor performance of my finder methods I took a look into the SQL that went to the database.
    "SELECT DISTINCT OBJECT(p) FROM Person p"
    results in
    SELECT PersonID, FirstName, LastName, [etc.] FROM person WHERE (PersonID='5354B71CC0A80113008BD3BB11A57FA1') OR (PersonID='5354B893C0A80113008BD3BB3C6918FF') OR (PersonID='5354B910C0A80113008BD3BBC83093BE') OR [etc.]
    where all 2000 primary keys are listed. This query costs ~ 4 seconds on my box.
    A query without WHERE costs ~ 0 seconds. So why this "WHERE" clause?
    Is this a JBoss specific problem? I am using version 3.2.3.
    thanx!
    Marcus

    It's not a bug - it's how JBoss implements it's own
    "findAll" methodology. Whether it's a good
    implementation or not is open to debate.Really strange.
    Anyway all my performance problems disappeared with setting the read-ahead strategy to "on-find". Although I don't fully understand why.
    Marcus

  • Sql Plus  Setting where It must  searching Scripts

    Hi
    How can I to define inside Sql Plus with command , where It must search scripts
    Why when I put :
    @myscript.sqland inside there is other scripts, It not found
    unable to open file "CONTIG_PS_LOC_ITM_TYPE.SQL"CONTIG_PS_LOC_ITM_TYPE.SQL is in same directory myscript.sql

    Hey
    inside the your first script you can execute the second one as "@@CONTIG_PS_LOC_ITM_TYPE.SQL"
    for the first script you can give the absolut path or the default path is $ORACLE_HOME/rdbms...
    Regards

  • Sql order in where clause...

    i want to ask about
    how oracle deal with the order of where cluase
    as in select * from where tname = 'EMP'
    and tabtype = 'TABLE'
    oracle strat from down (tabtype) or from up (tname)
    and there is difference between this order
    if the where clause contains (and) or (or)
    i always need to know this thing but no place i found say about it in strait way..
    thanks..
    null

    I am sorry for the late reply.
    I guess that ORDER doesn't matter in the WHERE clause. We should take 2 cases:
    1) Say, in a WHERE clause, U have a limiting condition on one of the indexed field of the table, then definitely that will be executed first and the result set will be passed to the other conditions.
    2) Say, in the WHERE clause, U don't have any indexed field then ORACLE will go for cost based execution. In this case, it will first go to the column, for which the SELECTIVITY is the highest ( ORACLE does so internally ) and then the result set is passed to the other conditions.
    Hope this helps.
    Correct me, if I am wrong.

  • Function is called in Where clause

    I am analyzing the script and found one function is called within the SQL statement in where clause. I like to know is there any alternate way to improve the performance.
    If I move the function call prior to this select statement and update the result of function value in new column in existing table/ are in new tmp table. Will there be performance improvement
    Or any other better way... Plz suggest me.
    - Mahesh

    You should include the query code as well as the execution plan.
    I figure out you mean your arguments in the where clause are evaluating a function and this prevents the index from being used, provoking a reduced query performance. If this is the case, then you should consider using function based indexes instead.
    ~ Madrid
    http://hrivera99.blogspot.com/

  • How to use CASE stmt in Where clause

    Hi,
    How to use CASE stmt in WHERE clause?. I need the code. Please send me as early as possible..........

    Hi,
    1004977 wrote:
    Hi,
    How to use CASE stmt in WHERE clause?. There's no difference between how a CASE expression is used in a WHERE clause, and how it is used in any other clause. CASE ... END always returns a single scalar value, and it can be used almost anywere a single scalar expression (such as a column, a literal, a single-row function, a + operation, ...) can be used.
    CASE expressions aren't needed in WHERE clauses very much. The reason CASE expressions are so useful is that they allow you to do IF-THEN-ELSE logic anywhere in SQL. The WHERE clause already allows you to do IF-THEN-ELSE logic, usually in a more convenient way.
    I need the code.So do the peple who want t help you. Post a query where you'd like to use a CASE expression in the WHERE clause. Post CREATE TABLE and INSERT statements for any tables used unless they are commonly available, such as scott.emp). Also, post the results you want from that sample data, and explain how you get those resuts from that data.
    See the forum FAQ {message:id=9360002}
    Please send me as early as possible..........As mentioned bfore, that's rude. It's also self-defeating. Nobody will refuse to help you because you don't appear pushy enough, but some people will refuse to help you if you appear too pushy.

  • Query using where clause

    I am not able to run a SQL query using where clause.
    the query is as follows:
    I extract the text input by the user in a text field say 'a' and
    store it in string 'y'.
    String y= a.getText();
    //running the query
    Select A from B where B.x=y;
    how do we run a where clause when y is a string variable instead of value?

    Use the following :
    String y = a.getText();
    String query ="select A.CODE from Port A where A.NAME=" + "'" + y + "'" ;
    ResultSet rs= stmt.executeQuery(query);

  • Where clause as a Paramter?

    So i am using a view for my report and my question is can i have a where clause parameter
    select * from vw_rpt_inv_report
    where=@where?
    The reason i want to use that is when my report is executed my view has 28 columns right so a user should be able to use any column from my report as a parameter.
    Does that make any sense ?
    I did some research and i found this as a solution :
    declare @whereclause nvarchar(1000)
    set @whereclause= 'select * from vw_rpt_inv_standard_format'
    select i.*, L.COMPANYNAME, L.LOCATIONNAME, L.ADDRESSLINE2, L.CITY, L.STATE, L.COUNTRY, L.ZIPCODE
    FROM VW_RPT_INV_STANDARD_FORMAT I
    JOIN LOCATION L ON L.LOCATIONID=I.LOCATIONID
    WHERE ' + @whereclause '
    When i try to run the report i get an error
    ORA-06550: line 1, column 9:
    PLS-00103: Encountered the symbol "@" when expecting one of the following:
    begin function package pragma procedure subtype type use
    <an identifier> <a double-quoted delimited-identifier> form
    current cursor
    The symbol "@" was ignored.
    ORA-06550: line 1, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    := ; not null default character
    I am using ORACLE AS my Database for creating reports on MS SSRS 2008.
    Can anyone help me ?

    Okay i am brand new to this so i am totally lost.
    What i am trying to do is i have a view which is my dataset right
    select * from vw_inv_report.
    once my report is done its deployed on a webservice.
    I have a report built on a query and I want to be able to send a parameter (@theWhere) that is a string which is a where clause (WORKORDERNUMBER LIKE '1563514%') and locationid in(63) these strings can vary depending on what columns the user selects and what operators they want to use. Generation of proper SQL for the where clause has been verified, I just need to be able to pass these, is there any way to do this...see example query below and how I was planning on using the @theWhere variable...
    So can i use
    declare @where nvarchar(1000)
    declare @clause nvarchar(5000)
    set @where= '(WORKORDERNUMBER LIKE '1563514%') and locationid in(63) '
    set @clause =
    'select i.*, L.COMPANYNAME, L.LOCATIONNAME, L.ADDRESSLINE2, L.CITY, L.STATE, L.COUNTRY, L.ZIPCODE
    FROM VW_RPT_INV_STANDARD_FORMAT I
    JOIN LOCATION L ON L.LOCATIONID=I.LOCATIONID
    WHERE ' + @whereclause
    EXEC
    @clause
    becuase when i run it i get this error now
    ORA-06550: line 1, column 9:
    PLS-00103: Encountered the symbol "@" when expecting one of the following:
    begin function package pragma procedure subtype type use
    <an identifier> <a double-quoted delimited-identifier> form
    current cursor

  • Sql*plus variable

    Hello,
    When we set some sql*plus variable, where does it set on server or client machine?
    Thanks.

    The variable command sets it as a bind variable on the server side.
    ~ Madrid.

  • How to use an UNIX shell variable in sql where clause

    Hi ,
    In my shell script first I get the Date and time from the system into the shell variable.At the end of the shell script I need to run a sql script in which I want to use the variable value in the where clause . Is there any way we can use a shell variable value in SQl script ?. Any help is greatly appriciated .
    Thanks in advance,
    Sampath

    Try the following
    In Unix
    SQLPLUS <username>/<password> @MyScript.sql <UNIX_Variable>
    In SQL*Plus
    Reference the variable as &1
    select *
    from MyTable
    where MyDate = to_date('&1','<date_format>');

  • Change my sql query where-clause in an extended controller

    Hello,
    i am trying to change my sql query where-clause in an extended controller
    personAplListVO.setWhereClause(null); // first set to null
    personAplListVO.setWhereClauseParams(null); // first set to null
    personAplListVO.setWhereClause(personAplListVOWhereClause +
    newWhereClause);
    personAplListVO.setWhereClauseParams(whereClauseParams);
    personAplListVO.executeQuery();
    System.out.println(">>>>>>>>getQuery = " + personAplListVO.getQuery());
    when i get the query ( personAplListVO.getQuery()) after executeQuery(), the new newWhereClause values are missing.
    Also i am getting null from personAplListVO.getWhereClause() after executeQuery()
    as if the above code is not making any effect.
    any ideas why?
    Thank you

    Hello,
    My Query:
    /* Formatted on 2011/06/15 15:50 (Formatter Plus v4.8.8) */
    SELECT /*+ FIRST_ROWS */
    NULL AS selectflag, ppf.full_name AS person_name,
    ppf.first_name AS person_first_name, ppf.last_name AS person_last_name,
    ppf.email_address, addr.derived_locale, addr.address_id,
    phn.phone_number, phn.phone_id, ppf.date_of_birth, addr.address_line1,
    (SELECT COUNT (*)
    FROM per_all_assignments_f paf2,
    per_all_people_f ppf2
    WHERE paf2.assignment_type = 'A'
    AND :1 BETWEEN paf2.effective_start_date AND paf2.effective_end_date
    AND paf2.person_id = ppf2.person_id
    AND paf2.effective_start_date BETWEEN ppf2.effective_start_date
    AND ppf2.effective_end_date
    AND ppf2.party_id = ppf.party_id
    HAVING COUNT (*) > 0) AS jobs_applied_for,
    (SELECT MAX (paf.effective_start_date)
    FROM per_all_assignments_f paf,
    per_all_people_f ppf2
    WHERE paf.assignment_type = 'A'
    AND :2 >= paf.effective_start_date
    AND paf.person_id = ppf2.person_id
    AND paf.effective_start_date BETWEEN ppf2.effective_start_date
    AND ppf2.effective_end_date
    AND ppf2.party_id = ppf.party_id) AS last_application,
    ppf.person_id, ppf.effective_start_date, ppf.effective_end_date,
    DECODE (vac.manager_id, :3, 'Y', 'N') AS my_applicants,
    vac.NAME AS vacancy_name, vac.vacancy_id, paf.assignment_id,
    (SELECT /*+ push_subq */
    MIN (pasf.effective_start_date)
    FROM per_all_assignments_f pasf
    WHERE pasf.assignment_id = paf.assignment_id) AS application_date,
    paf.effective_end_date AS assignment_end_date,
    ast.user_status AS application_status, ast.assignment_status_type_id,
    vac.status AS vacancy_status, mgr.full_name AS recruiting_manager,
    mgr.person_id AS recruiting_manager_id,
    mgr.effective_start_date AS effective_start_date1,
    mgr.effective_end_date AS effective_end_date1,
    rec.full_name AS recruiter, rec.person_id AS recruiter_id,
    rec.effective_start_date AS effective_start_date2,
    rec.effective_end_date AS effective_end_date2,
    ppf.per_information_category, ppf.per_information1,
    ppf.per_information2, ppf.per_information3, ppf.per_information4,
    ppf.per_information5, ppf.per_information6, ppf.per_information7,
    ppf.per_information8, ppf.per_information9, ppf.per_information10,
    ppf.per_information11, ppf.per_information12, ppf.per_information13,
    ppf.per_information14, ppf.per_information15, ppf.per_information16,
    ppf.per_information17, ppf.per_information18, ppf.per_information19,
    ppf.per_information20, ppf.per_information21, ppf.per_information22,
    ppf.per_information23, ppf.per_information24, ppf.per_information25,
    ppf.per_information26, ppf.per_information27, ppf.per_information28,
    ppf.per_information29, ppf.per_information30,
    FLOOR
    (irc_location_utility.sdo_miles (iwp.geometry, loc.geometry, 0.01)
    ) AS distance_to_location,
    loc.location_id, loc.derived_locale AS derived_locale1,
    doc.document_id, doc.file_name,
    NVL2 (doc.document_id, 'Y', 'N') AS previewenabled,
    inp.notification_preference_id, ppf.attribute_category, ppf.attribute1,
    ppf.attribute2, ppf.attribute3, ppf.attribute4, ppf.attribute5,
    ppf.attribute6, ppf.attribute7, ppf.attribute8, ppf.attribute9,
    ppf.attribute10, ppf.attribute11, ppf.attribute12, ppf.attribute13,
    ppf.attribute14, ppf.attribute15, ppf.attribute16, ppf.attribute17,
    ppf.attribute18, ppf.attribute19, ppf.attribute20, ppf.attribute21,
    ppf.attribute22, ppf.attribute23, ppf.attribute24, ppf.attribute25,
    ppf.attribute26, ppf.attribute27, ppf.attribute28, ppf.attribute29,
    ppf.attribute30, TO_CHAR (ROWNUM) AS rownumber,
    TO_CHAR
    ((irc_utilities_pkg.get_recruitment_person_id (ppf.person_id, :4))
    ) AS root_person_id,
    TO_CHAR
    (irc_skills_matching_pkg.vacancy_match_percent
    (irc_utilities_pkg.get_recruitment_person_id (ppf.person_id,
    :5
    vac.vacancy_id,
    :6
    ) AS match_percent,
    ppf.party_id, paf.effective_start_date AS assignment_start_date,
    pov.vendor_id, pov.vendor_name, regatmpt.attempt_id AS reg_attempt_id,
    TO_NUMBER (DECODE (regatmpt.raw_score, -1000, NULL, regatmpt.raw_score)
    ) AS reg_attempt_score,
    NVL2
    (regatmpt.mastery_score,
    DECODE (GREATEST (regatmpt.mastery_score, regatmpt.raw_score),
    regatmpt.raw_score, 'P',
    'F'
    NVL2 (fnd_profile.VALUE ('IRC_REGISTER_TEST'),
    NVL2 (inp.attempt_id, 'A', 'N'),
    NULL
    ) AS reg_attempt_status,
    aplatmpt.attempt_id AS apl_attempt_id,
    TO_NUMBER (DECODE (aplatmpt.raw_score, -1000, NULL, aplatmpt.raw_score)
    ) AS apl_attempt_score,
    NVL2
    (aplatmpt.mastery_score,
    DECODE (GREATEST (aplatmpt.mastery_score, aplatmpt.raw_score),
    aplatmpt.raw_score, 'P',
    'F'
    NVL2 (vac.assessment_id, NVL2 (iad.attempt_id, 'A', 'N'), NULL)
    ) AS apl_attempt_status,
    hrl.meaning, hrl.lookup_type, hrl.lookup_code,
    iad.assignment_details_id, iad.considered AS considered,
    vac.business_group_id,
    NVL
    ((SELECT iav.manage_applicants_allowed
    FROM irc_agency_vacancies iav
    WHERE iav.vacancy_id = vac.vacancy_id
    AND iav.agency_id = fnd_profile.VALUE ('IRC_AGENCY_NAME')),
    'Y'
    ) AS manage_applicants_allowed,
    DECODE (paf.source_type, 'ER', 'Y', 'N') AS referred,
    ircreferralinfoeo.start_date, ircreferralinfoeo.end_date,
    (SELECT meaning
    FROM hr_lookups
    WHERE lookup_code = ircreferralinfoeo.source_type
    AND lookup_type = 'REC_TYPE') AS sourcetype,
    DECODE (ircreferralinfoeo.source_type,
    'ER', (SELECT full_name
    FROM per_all_people_f
    WHERE person_id = ircreferralinfoeo.source_person_id
    AND SYSDATE BETWEEN effective_start_date
    AND effective_end_date),
    ircreferralinfoeo.source_name
    ) AS sourcename,
    ircreferralinfoeo.object_id, ircreferralinfoeo.object_type
    FROM per_addresses addr,
    per_phones phn,
    per_all_people_f ppf,
    per_all_assignments_f paf,
    per_all_vacancies vac,
    per_assignment_status_types_v ast,
    per_all_people_f mgr,
    per_all_people_f rec,
    irc_notification_preferences inp,
    hr_locations_all_vl loc,
    irc_documents doc,
    irc_search_criteria iwp,
    per_all_people_f irc_ppf,
    po_vendors pov,
    ota_attempts regatmpt,
    irc_assignment_details_f iad,
    ota_attempts aplatmpt,
    hr_lookups hrl,
    irc_referral_info ircreferralinfoeo
    WHERE irc_utilities_pkg.get_recruitment_person_id (ppf.person_id, :7) =
    irc_ppf.person_id
    AND :8 BETWEEN ppf.effective_start_date AND ppf.effective_end_date
    AND irc_ppf.party_id = ppf.party_id
    AND ppf.person_id = paf.person_id
    AND paf.assignment_type = 'A'
    AND paf.vacancy_id = vac.vacancy_id
    AND :9 BETWEEN paf.effective_start_date AND paf.effective_end_date
    AND paf.assignment_status_type_id = ast.assignment_status_type_id
    AND irc_ppf.person_id = doc.person_id(+)
    AND irc_ppf.person_id = phn.parent_id(+)
    AND phn.parent_table(+) = 'PER_ALL_PEOPLE_F'
    AND phn.phone_type(+) = 'H1'
    AND :10 BETWEEN NVL (phn.date_from(+), :11) AND NVL (phn.date_to(+), :12)
    AND vac.manager_id = mgr.person_id(+)
    AND :13 BETWEEN mgr.effective_start_date(+) AND mgr.effective_end_date(+)
    AND vac.recruiter_id = rec.person_id(+)
    AND :14 BETWEEN rec.effective_start_date(+) AND rec.effective_end_date(+)
    AND irc_ppf.person_id = inp.person_id(+)
    AND inp.person_id = addr.person_id(+)
    AND NVL (inp.address_id, DECODE (addr.address_type(+), 'REC', addr.address_id(+),
    -1)) = addr.address_id(+)
    AND :15 BETWEEN addr.date_from(+) AND NVL (addr.date_to(+), :16)
    AND loc.location_id(+) = vac.location_id
    AND doc.TYPE(+) LIKE '%RESUME'
    AND doc.end_date(+) IS NULL
    AND irc_ppf.person_id = iwp.object_id(+)
    AND iwp.object_type(+) = 'WPREF'
    AND :17 BETWEEN irc_ppf.effective_start_date AND irc_ppf.effective_end_date
    AND ( inp.agency_id = fnd_profile.VALUE ('IRC_AGENCY_NAME')
    OR fnd_profile.VALUE ('IRC_AGENCY_NAME') IS NULL
    AND inp.agency_id = pov.vendor_id(+)
    AND inp.attempt_id = regatmpt.attempt_id(+)
    AND paf.assignment_id = iad.assignment_id(+)
    AND :18 BETWEEN iad.effective_start_date(+) AND iad.effective_end_date(+)
    AND iad.latest_details(+) = 'Y'
    AND iad.attempt_id = aplatmpt.attempt_id(+)
    AND hrl.lookup_type(+) = 'VACANCY_STATUS'
    AND vac.status = hrl.lookup_code(+)
    AND paf.assignment_id = ircreferralinfoeo.object_id(+)
    AND SYSDATE BETWEEN ircreferralinfoeo.start_date(+) AND ircreferralinfoeo.end_date(+)
    AND ( 1 = 1
    AND (NVL (doc.document_id, 1) =
    NVL ((SELECT MAX (idoc1.document_id)
    FROM irc_documents idoc1
    WHERE idoc1.person_id = irc_ppf.person_id
    AND idoc1.TYPE IN ('RESUME', 'AUTO_RESUME')
    AND idoc1.end_date IS NULL
    AND idoc1.last_update_date =
    (SELECT MAX (idoc2.last_update_date)
    FROM irc_documents idoc2
    WHERE idoc2.person_id = irc_ppf.person_id
    AND idoc2.TYPE IN
    ('RESUME', 'AUTO_RESUME')
    AND idoc2.end_date IS NULL)),
    1
    and my where clause that i want to append to the existing one:
    and ppf.sex = 'M' and ppf.nationality = '1680'
    my processFormRequest function in my extended CO
    public void processFormRequest(OAPageContext pageContext,
    OAWebBean webBean) {
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    String genderValue = pageContext.getParameter("gender");
    String nationality = pageContext.getParameter("nationality");
    ViewObject personAplListVO = am.findViewObject("PersonAplListVO");
    String personAplListVOWhereClause = personAplListVO.getWhereClause();
    Object[] whereClauseParams = personAplListVO.getWhereClauseParams();
    String newWhereClause = "";
    //gender
    if (genderValue != null && !genderValue.trim().equals("")) {
    newWhereClause += " and ppf.sex = '" + genderValue + "'";
    //nationality
    if (nationality != null && !nationality.trim().equals("")) {
    newWhereClause += " and ppf.nationality = '" + nationality + "'";
    System.out.println("\n>>>>>>>>getQuery = " + personAplListVO.getQuery());
    System.out.println("\n>>>>>>>>newWhereClause = " + newWhereClause);
    if (!newWhereClause.equals("")) {
    personAplListVO.clearCache();
    personAplListVO.setWhereClause(null); // first set to null
    personAplListVO.setWhereClauseParams(null); // first set to null
    personAplListVO.setWhereClause(personAplListVOWhereClause +
    newWhereClause);
    personAplListVO.setWhereClauseParams(whereClauseParams);
    personAplListVO.executeQuery();
    // System.out.println(">>>>>>>>newWhereClause" +
    // personAplListVOWhereClause + newWhereClause);
    // System.out.println(">>>>>>>>getWhereClause" +
    // personAplListVO.getWhereClause());
    // System.out.println(">>>>>>>>getQuery = " +
    // personAplListVO.getQuery());
    any tips?
    thanks a lot

Maybe you are looking for

  • Error - Name jdbc is not bound in this Context

    Hi, i wanted to use Datasource in JDBC to make connection with mysql suport and want to excute Jsp page but not able to execte some error is getting. 1)Jsp Page: data_source.jsp <%@ page session="true" import="java.sql.*,javax.sql.*,javax.naming.*" %

  • Problems with iCloud and my iPad

    It's been four weeks since I've backed up my iPad to iCloud; a window appeared and proceeded to sit there, stating that the requirements to backup my iPad to iCloud. However, when I push OK, it doesn't go away, and it's blocking usage of my iPad... D

  • How to convert BPA model to BPEL process flow?

    Hi All, I am looking for documentation which explains below concepts 1. Converting BPA model into a BPEL process 2. Just wanted to add single human task definition from BPA model to BPEL process Can anybody please point me to correct documentation? R

  • No user defined for service /sap/bc/contentserver

    Dear ALL,   Transaction : OAAD While i am up loading photo Business Obeject : PRELI                                            Document Type    : HRICOLFOTO While i am going to create next  step personal no :(any per no) next enter I am getting this

  • Integration of HR of Solman 7.0 with ECC 6.0 HR

    Hi everyone, My scenario: 1. I have customized service desk and it works perfeclty. 2. I need to integrate hr of ecc 6.0 with solman 7.0 ie) when i terminate an employee in ec hr (PA40) the same employee if present in solution manager should also be