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

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;

  • How to pass a string variable in a single quote

    Hi,
    I am trying to pass a single quoted string, 'some string', into a concat expression.
    My situation is some thing like
    I have an array of states
    <copy>
    <from>
    <ListOfValues xmlns="http://tbone.coi.test/amis">
    <!-- State -->
    <Value>A</Value>
    <Value>B</Value>
    <Value>C</Value>
    </ListOfValues></from>
    <to variable="StateList"/>
    </copy>
    then I loop through the StateList array to get each state as
    <copy>
    <from variable="StateList" query="/tns:ListOfValues/tns:Value[bpws:getVariableData('iterator')]"></from>
    <to variable="currentState"/>
    </copy>
    I then build an xpath expression like:
    <copy>
    <from expression="concat('/nsxml0:GetSummariesResponse/nsxml1:Summaries[nsxml1:State = ',bpws:getVariableData('currentState'), ']')"></from>
    <to variable="xpath"/>
    </copy>
    As the result, my xpath look like:
    /nsxml0:GetSummariesResponse/nsxml1:Summaries[nsxml1:State = A]
    but I need a state surrounded by single quote as 'A' or xpath query like
    /nsxml0:GetSummariesResponse/nsxml1:Summaries[nsxml1:State = 'A']
    Any ideas how can I single quote a value of bpws:getVariableData('currentState') in my concat expression
    Thanks,
    -V

    Have you tried 'the string contain''s an &apos;'?

  • How to construct a sql query when field having single quote

    Hi all,
    I have been working on web application , here is my requirement:
    I'm constructing sql statement dynamically from dynamic user input (form data). In one of the field having single quote.
    while executing the query it is getting problem because of single quote .. so how do i resolve my problem.
    single quote should be there. (I'm using Ms-Access as my database).
    Thanks in advance
    abel

    Use PreparedStatement. Always. It not only eases setting Java objects in a SQL query, but also protects you against SQL injections.
    Prepare yourself: [http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html].

  • 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

  • Single Quotes Issue??

    Hi,
    Bit of a strange one - hopefully there is a really simple answer that I will kick myself over….!
    I have a query which references a partioned table. When the following condition is added, the query references the intended partion - evident by looking at the explain plan:
    and e.dac_end_date >= '20080401'
    (VARCHAR2 (8 Byte))
    However, I want to automate my script. When I use a variant of the Sysdate function (detailed below) and execute the query, the explain plan indicates that Oracle is doing a full table scan….. Not good!!
    e.dac_end_date >= to_char(add_months(sysdate,-1),'YYYYMM')||'01'
    I'm guessing this may have something to do with single quotes… I have done a forum trawl, and tried some of the suggestions (char(39)||, three quotes surrounding the 'YYYYMM', concatenating single quotes around the format mask etc) - but I either get an error message, or the query just bombs out after a few seconds.
    Anyone have any ideas or suggestions??
    Any help greatly appreciated….
    Cheers in advance.

    Firstly - thanks for the replies.
    Just to confirm - the table I'm referring too is ranged partioned on a varchar2 column that contains a date-as-a-string. I didn’t build the tables - I'm not a developer. I'm just trying to automate a query that I have written which on the surface appears to do a full table scan when I use the Sysdate function (instead of a hard coded date).
    'Bomb out' - bad grammar, apologies. What I meant was the query appears to complete within a few seconds, however does not return any data.
    peticH - I was using 'Session Browser' within Toad to monitor the query (running in another session) - I didn’t realise that even in this instance Explain Plan provides expected rather than actual behaviour. I'll do some reading up on the 'Trace' functionality, to try and see what is actually happening.
    Cheers guys.

  • Can you help me with the WHERE clause? Any issue with this code block?

    Hi,
    I am looking for blogs or any document on how to implement a Lookup during data loads in BW.
    The problem is that all those that I find on this site are mostly about u201CLookup in XIu201D
    I have read bits and hints on different postings on this site and this is the best I could do for the scenario shown below:
    I need to add the Chars: Char1, Char2, Char3 to CubeX
    so that I can display the data for these 3 Chars in a report.
    Char1 and Char2 are filled in ODS12 and Char3 is filled in Cube3.
    Can you help me write a routine so that while loading data to CubeX, it will read Char1, Char2, Char3 from ODS12 and Cube3; and make them available in CubeX?
    This is my attempt so far:   continue:
    u201C----
    select /bic/Char1 from /bic/ODS12
    select /bic/Char2 from /bic/ODS12
    select /bic/Char3 from /bic/Cube3
    into result
    WHERE u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
    and objvers = 'A' .        
    end select.
    u201C----
    1. What should be my WHERE clause?
    2. In the select statement, by studying samples on this where should there be an u201CMu201D in front of the ODS? e.g. select /bic/Char1 from /bic/MODS12
    If so, what is the significance and the other options?
    3. Should this code be in the Start routing of CubeX? Or any other possible location? Also, in the start routine does it matter where within the start routine this code needs to be placed?
    4. Can you please fix this code and add any lines I may be missing?
    Is what I am looking to do refer to as u201Cdoing a lookupu201D?
    Thanks

    ok

  • 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.

  • Single Quote issue

    Hi
    i have a string value as IN's/Out Report for Repairs
    i need to take the count of table records for above matching string value
    ex
    select count(*) from Table_x where doc_type in ('IN's/Out Report for Repairs')
    its throwing me sytanctical error as single quore already exists in the data.. how to get it work.
    Thanks
    Naren

    What's not working?
    SQL> create table table_x as select 'IN''s/Out Report for Repairs' doc_type from dual;
    Table created.
    SQL> select count(*) from Table_x where doc_type in ('IN''s/Out Report for Repairs');
      COUNT(*)
             1
    1 row selected.
    SQL> -- or perhaps you'd better try it case-insensitive:
    SQL> select count(*) from Table_x where lower(doc_type) = lower('IN''s/Out Report for Repairs');
      COUNT(*)
             1
    1 row selected.

  • In output String should be in single quoted

    Hi All
    How following is achieved.......
    If the string is ABC,PQR,XYZ,......... then in output it should appear as 'ABC','PQR','XYZ','....','.....','.....'
    regards,
    Kalyan

    Hi, Kaylan,
    So you want to add quotes around each comma-delimited sub-string?
    If you replace the commas with quote-comma-quote, then you're almost there; you just need additional quotes at the very beginning and the very end of the string.
    SELECT  Q'[']'
         || REPLACE ( txt
                 , Q'[',']'
         || Q'[']'
    FROM     table_x;The code above works in Oracle 10 and up.
    The version below works in any version of Oracle:
    SELECT  ''''
         || REPLACE ( txt
         || ''''
    FROM     table_x;Edited by: Frank Kulash on Oct 27, 2009 7:21 AM
    Many of the answers below use REGEXP_REPLACE instead of REPLACE. I don't understand why. REPLACE is simpler to use (to the tune of 7 keystrokes) and faster to run.

  • 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

  • How to pass dynamically constructed string to where clause

    select name from mytable
    where l_condition
    and sal=20;
    l_condition is value coming from the function.
    ex: l_condition is first_name='abc' and last_name='xyz' and first_name='def' and last_name='zef'

    Dynamic SQL can help in this case:
    variable ref refcursor
    DECLARE
      l_condition VARCHAR2(1000) :=
          ' salary > 3000  and first_name like ''L%''';
    BEGIN
      OPEN :REF FOR
      ' SELECT first_name, salary FROM hr.employees ' ||
      ' WHERE ' || l_condition;
    END;
    print :ref;
    FIRST_NAME           SALARY                
    Laura                3630                  
    Lindsey              8800                  
    Lex                  18700                 
    Luis                 7590                  
    Louise               8250                  
    Lisa                 12650                 

  • Using hex string in where clause

    I am trying to search for some information in a varchar2 column that has
    Arabic characters in it. Unfortunately I don't have an Arabic keyboard.
    Is there a way of easily doing something like the following.
    where column like '%\xE3\xCD\xE3\xCF%"
    Where the \xE3 is hex E3
    TIA
    Steve

    Eric,
    Thanks for that I had considered that way, but its a bit of a pain if theres lot of characters to convert to decimal.
    BTW
    NLS_LANG=NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256
    Which is an arabic characterset.

Maybe you are looking for

  • How do I recover a device deleted from the Finder sidebar?

    I connected a Garmin Edge 800 GPS unit to my MacBook Pro to backup its files. I made a file on the computer named "Garmin" to copy the files into. In the sidebar, in Finder, two devices showed, one named "Garmin" and the other "No Name" which is the

  • Incompatibility of Acrobat 6 between Win XP & Win 7

    I was using Adobe Acrobat V6.0 easly on a former laptop based on Win XP. I re-installed the application on a new laptop based on Win 7 and since then, I am experiencing problems related to printing & converting files into pdf. Apparently, the incompa

  • Clear file extension in browser

    Hello I am interested in how can I preview a web page without the file extension. In other words I want my users to acces my page like this: www.mydomain.com/about instead of "about.html" Thanks!

  • Mldonkey 2.5.22 with daemon script

    I created PKGBUILD file # Contributor: Tomasz Bakiera <[email protected]> pkgname=mldonkey pkgver=2.5.22 pkgrel=1 pkgdesc="Multiple p2p client" url="http://mldonkey.org" license="" depends=(sysvinit glibc) makedepends=() conflicts=() replaces=() ba

  • How do I modify PDFs On iPad

    Please help