Problem using LIKE function

Hi Guyz,
I am having small problem using LIKE function . The problem is I am using LIKE function in the WHERE clause
to compare a column to a particular value, which gets this value from the front end. If the user has a single quote in the string he entered then the LIKE function is not working because of the single quote. Is there any way I can escape the single quote like we escape '%' and '_'.
Thankyou.

Mod_plsql supports bind variables, as do almost all front-end tools that deal with Oracle (and most other databases). I do not code mod pl/sql myself, but others here do, and I see bind variables in their code all the time (if I don't, they hear from me :-)).
If you pass a bind variable, the quote problem goes away. As far as I know (which is not very far), you should be able to take the string with the quote directly from your input field, bind it to the variable in your query and have no problems.
I suspect that the reson you are having issues is that you are just gluing strings together to create a sql statement. this is the wrong approach.
The java term for what you are looking for is prepared statement, I'm not sure what the equivalent is i mod plsql, but that should give you a start.
John

Similar Messages

  • Problem using two function based indexes at once!

    Hello Oracle!
    I've got problems using two function based indexes on geometries at once.
    The problem occures, when I use a spatial join between two geometries both using function based indexes.
    The test case:
    CREATE TABLE quad (centroid NUMBER);
    CREATE TABLE points (no NUMBER, point MDSYS.SDO_GEOMETRY);
    CREATE OR REPLACE FUNCTION getQuad (centroid NUMBER) RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC IS
    BEGIN
    RETURN MDSYS.SDO_GEOMETRY(2003, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(centroid-5,centroid-5,centroid+5,centroid-5,centroid+5,centroid+5,centroid-5,centroid+5,centroid-5,centroid-5));
    END;
    INSERT INTO USER_SDO_GEOM_METADATA VALUES('quad','tiedge.getQuad(centroid)',MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X', -100, 100, .0000001), MDSYS.SDO_DIM_ELEMENT('Y', -100, 100, .0000001)),NULL);
    CREATE INDEX quad_idx on quad(getQuad(centroid)) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    INSERT INTO quad VALUES (0);
    INSERT INTO quad VALUES (5);
    INSERT INTO quad VALUES (10);
    INSERT INTO points VALUES (1, MDSYS.SDO_GEOMETRY(1001,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1),MDSYS.SDO_ORDINATE_ARRAY(4,4)));
    ALTER SESSION SET QUERY_REWRITE_INTEGRITY=TRUSTED;
    ALTER SESSION SET QUERY_REWRITE_ENA[i]Long postings are being truncated to ~1 kB at this time.

    hi there,
    For a better audience for this question, I'd look at the database forum.
    guys on that will be a lot more familiar with FBIs
    thanks
    Barry

  • Problem using Ago function

    Hi all,
    My problem is that when i use ago function it displays next months value for example first column shows balance of april month and next to it ago column displays balance of the may not march. I am really confused. Please help,
    AGO(SR02BriefIncome.sr02_cube.BALANCE, SR02BriefIncome.timesDim."times Detail", 1);

    Hi Nico,
    Another question in relation to Ago function; I need to get value/balance a year ago which is 12 months ago, and also previous year's last months balances; the problem is that Ago function takes only integer, I have tried to put a variable, Is there is way i can get balances of the previous year's last month because it will be much easier to get it using built-in ago function.
    Also i need help with your answer for thread How to use row values in Presentation or Administration for calculation
    Re: How to use row values in Presentation or Administration for calculation
    "Yes, I forgot this one. Of course, this solution work when you have a pivot column.
    If you talk about period to period comparison, really often I must do a share like this one : ($2-$5)/$5.
    And unfortunately, this is not possible in a calculated item. Is it ?"
    We have a lot of reports with inter-row calculations, we have already used a lot sql model but we would like use answer also. Can u explain it with exact examples or steps.
    thank you again,

  • How to use LIKE function with a parameter in Oracle REPORT builder??

    how could i use parameter inside a LIKE function in Oracle reports builder?
    it works in SQL plus, but not in report builder!!
    Example:
    select code,desc from item_master where desc
    like '%&give_desc%'; ---works in SQL
    like '%:give_desc%' ---doesn't work in report builder!!

    Hi Renil,
    You will need to use the wildcard character (%) and the concatenation character (||) to join to your user parameter.
    i.e. like '%'||:give_desc||'%'
    Regards,
    John

  • Turkish Character Problem using GO function

    Hi,
    We have a requirement of opening new dashboard page as a new page when a link is followed in an analytical request. We are using GO function and we are passing parameters also.
    Our formula for the column producing the link is like following (I have to drop html tags as they are not rendered on the forum page):
    saw.dll?Go&_scid=WAP*ginmv-g&Path=/shared/ASGBOARD/KRN_ISL/DENEME_ISL&Action=Navigate&P0=1&P1=eq&P2=ISLETME_DIM.SUBEKODU&P3=1+"@"&Done=Close
    The parameters are coming from primary request columns. However, if those parameters contain turkish characters like ş ç ö ü etc. the parameters are not passed correctly to the target dashboard page, instead of those characters, an empty box is rendered and the data on the page is not filtered correctly.
    Any idea on this?
    Thanks

    Hi,
    I am also not sure whether this is somehow because of OC4J settings or Oracle BI settings.
    Thanks

  • Problem using jolt function checkAuthentication. chkauth:J_CHECKAUTH FAILED

    Hi, I'm using jolt 8.1.
    When I attemp to chek security requirements using the function checkAuthenticationLevel() of the class JoltSessionAttributes it gives an error.
    I have previously setted the address:
    JoltSessionAttributes = new JoltSessionAttributes();
    sattr.setString(JoltSessionAttributes.APPADDRESS, "//50.88.43.237:6005");
    sattr.checkAuthenticationLevel();
    Then it fails:
    bea.jolt.SessionException: Cannot connect to any //50.88.43.237:6005.
    Reason:NwHdlr: Network Error: chkauth: J_CHECKAUTH FAILED
    Any idea? thx.

    Hi,
    I was facing a similiar problem but when i changed the port number it didnot give me this error but now its giving me bea.jolt.ServiceException:Service is not available:GETKEYS.
    Can you help me solve this

  • Problem using MDX functions in Answers Filter

    I'm using OBIEE 10.1.3.2.
    I'm using an Essbase cube as my datasource (aggregate storage).
    My level 0 members in my Date dimension are of the format yyyy-mm-dd (e.g., 2011-08-13)
    I have a dashboard prompt selecting the date from a calendar which returns the date and time (yyyy-mm-dd hh:mm:ss). So naturally I can't do just a straight equals between the prompt value and the member value.
    What I've written in the filter sql in Answers is: Date.Days = Evaluate('SUBSTRING(%1,1,10)','@{varStartDate}')
    The log shows the following:
    -------------------- SQL Request:
    SELECT Date.Days saw_0, main.total_completed_orders saw_1 FROM SIKAgg2 WHERE Date.Days = Evaluate('SUBSTRING(%1,1,10)','2011-08-09 00:00:00') ORDER BY saw_0
    -------------------- Sending query to database named mezen (id: <<9648>>):
    With
    set [Date4] as 'Filter([Date].Generations(4).members, (([Date].CurrentMember.MEMBER_ALIAS = "2011-08-09 00:00:00" OR [Date].CurrentMember.MEMBER_Name = "2011-08-09 00:00:00")))'
    select
    { [Measures].[total_completed_orders]
    } on columns,
    NON EMPTY {SUBSTRING(,1,10)SUBSTRING(,1,10)SUBSTRING(,1,10){[Date4]}} properties ANCESTOR_NAMES, GEN_NUMBER on rows
    from [SIKAgg2.main]
    So with all that being said it doesn't appear that the MDX function SUBSTRING is actually doing anything.
    1) Am I using the function incorrectly?
    2) Is there a better way to do this? I really just need to get rid of the time portion of the variable from the date prompt.
    Any help/guidance would be greatly appreciated. Spending too much time with trial and error approach.
    Thanks,
    Brad

    Brad,
    Try this way..In OBIEE RPD - Physical Layer for level 0 members in my Date dimension. Double click this member and check its type. Change the type to 'DATE' from 'DATETIME'. Delete the Date Dimension in BMM layer & Presentation Layer for again drag and drop from Physical Layer after changing the Type in physical layer.
    Normal way of building the RPD using Essbase
    Something similar to this http://www.rittmanmead.com/2009/03/dates-timestamp-and-oracle-bi-answers-filters/
    This shud solve your timestamp problem everywhere. This is one of the most common problem for Oracle sources. I have essbase as a source but unfortunately I can't replicate it as this is not having time level.
    Let me know if this solves your problem...
    In case the type is DATE only in RPD then I'll try to provide a diff soln here.
    Hope this helps

  • Problem using extract function (PL/SQL) with "&#34"

    Hi,
    When I use extract function (PL/SQL), it does not transform well "&#34". Insted of returning ' " ' , it returns ' &quot '.
    I know this works changing the code replacing xml.extract for SELECT extractvalue(xml,'//A/text()') into v from dual;
    But Is there another way to do this using PL/SQL? any patch, option..?
    Regards

    Had to use my website to demonstrate the code...
    As said, whatever I try here the code gets automatically converted...
    See for answer on your question: http://www.liberidu.com/blog/?p=635

  • Compilation problems using NVL function in Pro*C subselect

    I have come across a weird oracle problem. When I execute the following query in SQLPlus it works but when
    I include it in Pro*C code in a EXEC SQL statement it gives syntax errors and fails to compile. Any idea what I am doing wrong.
    SELECT DISTINCT
         A.ID_PERSON,
         C.ID_STAGE_PERSON_LINK ,
         A.NM_PERSON_FULL,
         A.NBR_PERSON_AGE,
         A.ADDR_PERSON_ST_LN_1,
         A.ADDR_PERSON_CITY,
         A.ADDR_PERSON_ZIP,
         A.CD_PERSON_STATE,
         A.CD_PERSON_COUNTY,
         A.NBR_PERSON_PHONE,
         C.CD_STAGE_PERS_REL_INT
         FROM
              PERSON A,
              STAGE_PERSON_LINK C
         WHERE
         C.ID_CASE = 88776721
         AND          A.IND_INVALID_PERS IS NULL
         AND          C.CD_STAGE_PERS_TYPE = 'PRN'
         AND          C.ID_PERSON = A.ID_PERSON
         AND C.ID_STAGE_PERSON_LINK =
    NVL (
                   (SELECT MAX(F.ID_STAGE_PERSON_LINK)
                   FROM STAGE_PERSON_LINK F
                   WHERE F.ID_PERSON=C.ID_PERSON
                   AND F.ID_CASE = C.ID_CASE
                        AND F.CD_STAGE_PERS_TYPE = 'PRN'
                        AND F.CD_STAGE_PERS_REL_INT IS NOT NULL)
                   (SELECT MAX(G.ID_STAGE_PERSON_LINK)
                   FROM STAGE_PERSON_LINK G
                   WHERE G.ID_PERSON=C.ID_PERSON
                   AND G.ID_CASE = C.ID_CASE
                        AND G.CD_STAGE_PERS_TYPE = 'PRN')
    AND A.ID_PERSON NOT IN
    SELECT S.ID_PERSON
    FROM STAGE_PERSON_LINK S,STAGE T
    WHERE S.ID_CASE = C.ID_CASE
    AND S.ID_CASE = T.ID_CASE
    AND S.ID_STAGE = T.ID_STAGE
    AND T.CD_STAGE &lt;&gt; 'INT'
    MINUS
    SELECT H.ID_PERSON
    FROM STAGE_PERSON_LINK H, STAGE F
    WHERE H.ID_CASE = F.ID_CASE
    AND H.ID_STAGE = F.ID_STAGE
    AND H.ID_CASE = C.ID_CASE
    AND H.CD_STAGE_PERS_ROLE &lt;&gt; 'XE'
    AND F.CD_STAGE &lt;&gt; 'INT'
    This query returns data when run in sqlplus.When used in a Pro*C C program and compiled the precompiler complains with syntax errors when used with EXEC SQL DECLARE CLSS82D_CURSOR CURSOR FOR &lt; query above &gt;.However removing the NVL function and retaining the subselect clause compiles but that is not what I want to do.
    Syntax error at line 262, column 20, file clss82d.pc:
    Error at line 262, column 20 in file clss82d.pc
    SELECT MAX( F.ID_STAGE_PERSON_LINK )
    ...................1
    PCC-S-02201, Encountered the symbol "MAX" when expecting one of the following:
    ( ) * + - / . @ | at, day, hour, minute, month, second, year,
    The symbol "(" was substituted for "MAX" to continue.
    Syntax error at line 263, column 10, file clss82d.pc:
    Error at line 263, column 10 in file clss82d.pc
    FROM STAGE_PERSON_LINK F
    .........1
    PCC-S-02201, Encountered the symbol "FROM" when expecting one of the following:
    , ) * + - / | at, day, hour, minute, month, second, year,

    Pro*C works bit differently tha sqlplus. try removing the blank line after
    SELECT MAX(G.ID_STAGE_PERSON_LINK)
    FROM STAGE_PERSON_LINK G
    WHERE G.ID_PERSON=C.ID_PERSON
    AND G.ID_CASE = C.ID_CASE
    AND G.CD_STAGE_PERS_TYPE = 'PRN')
    good luck,
    Gauranga

  • Problem using WIN_API function (Urgent...)

    dear all,
    I am using Forms 6i, I try to use the WIN_API_ENVIROMENT functions in the d2kwutil.pll. I have attached the pll to my form and the form was compiled OK. But when I run the form, Internal Error was shown, it seems that the form cannot start the WIN_API function. Luckily enough, I use the old d2kwutil.pll that come with Forms 6, it works 'OK', .... but when I tried to run it on my user machine, it still got Internal Error. I really don't know what's the problem. After several testing, I know if I run the form on a machine that have Form Builder installed will have a greater chance to work correctly. Does anyone have the same problem ???

    The machine that the form runs on needs to have the d2kwutil file on it. This is in the Oracle Developer - Demos and Add-ons product, which should be available in the Oracle Installer.

  • Problem using javascript function?

    Hallo,
    i integrate a file for javascript functions with this code
    <afh:head title="#{res['pob.login']}">
    <meta http-equiv="Content-Type"
    content="text/html; charset=ISO-8859-15"/>
    <script type="text/javascript" src="../Javascript/Funktionen.js"></script>
    </afh:head>
    in the file Funktionen.js i have the following functions
    function deleteWarning()
    return confirm("Wollen Sie den ausgew" + String.fromCharCode(228) + "hlten Datensatz wirklich l" + String.fromCharCode(246) + "schen ?");
    function testFall()
    return confirm("Wollen Sie den ausgew" + String.fromCharCode(228) + "hlten Datensatz wirklich l" + String.fromCharCode(246) + "schen ?");
    the first function i can use, the second not. Why?

    Thank you for checking the code Frank. So i can look what is the problem.
    The reason is i/we using firefox and changes in the javascript definition only checked when the cache has been cleared!

  • Problem using atan2 function

    Hi everyone, I'm developing an application that needs to calculate the angle between two vectors. While this is fairly simple, you just need to use the Math.atan2() function, i am having a few problems.
    Here's a code snippet:
    alpha = (Math.atan2((tx*ry)-(rx*ty), (tx*rx)+(ty*ry)) % (2*Math.PI)) ;Strangely enough, this gives me the following error: "The method atan2(double, double) is undefined for type Math"
    This should only occur if the method atan2 weren't implemented in the Math library.. but from the javadoc and the GIS it definitively is!
    I'm confused and stuck, any ideas? (i'm using jdk 1.6.0_07)

    This is a GWT application and therefore the rest of the code doesn't matters. I'll post it anyway, but if i take that simple line using the atan2, i can run the gwt application without problems nor errors. If i use the atan2 it doesn't presents any error in the IDE, but when i try to run the GWT application, it gives me exactly the error described previously:
    " The method atan2(double, double) is undefined for the type Math"
    Here's the code:
    /* the mouse vector 1 */
                tx = x - aux_obj.getCenterX();
                ty = y - aux_obj.getCenterY();
                /* the rotation vector. i.e. the fixed vector that will be used as origin composed by the subtraction of the object center with the rotation point */
                rx = lastPosition[0] - aux_obj.getCenterX();
                ry = lastPosition[1] - aux_obj.getCenterY();
                lenght = Math.sqrt((tx*tx) + (ty*ty));
                tx = tx / lenght;
                ty = ty / lenght;
                lenght = Math.sqrt((rx*rx) + (ry*ry));
                rx = rx / lenght;
                ry = ry / lenght;
                alpha = (java.lang.Math.atan2((tx*ry)-(rx*ty), (tx*rx)+(ty*ry)) % (2*Math.PI)) ;
                Window.alert("alpha:"+alpha);I think there's no big reason why this shouldn't work.. maybe it's the gwt library that doesn't finds the math class when it's trying to compile the java code..

  • Problem using number function

    Hi!
    I used Publisher Desktop to design RTF template for FSG report.
    I had to make comparison between two values in XML I got from FSG and based on their values show or hide a field in the report.
    I used following commands to get values in variables:
    <?variable:prihod?><?translate( /MasterReport/fsg:RptDef/fsg:RptLine[@LinCnt='l100090']/fsg:RptCell[@ColCnt='c1004'],’,’,’’)?><?end variable?>
    <?variable:rashod?> <?translate(/MasterReport/fsg:RptDef/fsg:RptLine[@LinCnt='l100091']/fsg:RptCell[@ColCnt='c1004'],’,’,’’)?><?end variable?>
    then I used following choose to decide wether to show or not the values:
    <?choose: ?>
    <?when: @LinCnt='l100090'?><?end when?>
    <?when: @LinCnt='l100091'?><?end when?>
    <?when: @LinCnt=’l100092’?><?if: boolean(number($prihod) >= number($rashod))?><?fsg:RptCell[2]?><?end if?><?end when?>
    <?when: @LinCnt=’l100096’?><?if: boolean(number($prihod) < number($rashod))?><?fsg:RptCell[2]?><?end if?><?end when?>
    <?otherwise: ?><?fsg:RptCell[2]?><?end otherwise?>
    <?end choose?>
    It worked just as I planned but then I uploaded it to EBS.
    I generated XML from FSG.
    Then I invoked XML Report Publisher for that XML.
    But it ended with error with following message:
    Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert 0.00 to number.
    The value I'm checking with number function is 0.00.
    Now I don't understand where is the problem.
    My computer is set to Croatia-Croatian, whole text in word is set to Croatian.
    I uploaded the template with Croatia-Croatian.
    When invoking XML Report Publisher I choosed Croatia-Croatian.
    And locally it works and on the server it's not.
    Any ideas?

    I also tried now one trick but it didn't help and I ended even more confused.
    Originally number is in xml in following format:
    First I removed all the comas from the number because I read that group separators tend to confuse the xslt number function.
    Now I went one step further and I changed remaining decimal divider from dot to coma.
    Uploaded new template to EBS.
    Repeated the procedure and only difference is that now error says:
    Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert 0,00 to number.
    I was sure that decimal separator was cause of the problems but now I'm not so sure anymore.
    Any ideas?

  • Problem Using NVL Function

    I ran across a problem with the format of an ASCI output file of an SQL script. The problem I have is with handling a particular column that contains account numbers. The column is defined with 8 characters. However not every entry has data. I have several fields that don't have any information.
    Originally in my script I had the following line that made the script fail:
    LPAD(TO_CHAR(TO_NUMBER(konten_nr)),8,'0'),
    I then changed the line to the following: (The script ran but now I notice that the formatting is wrong)
    LPAD(TO_NUMBER(LTRIM(konten_nr)),8,'0'),
    I attempted to use the NVL function that will return a value when there is nothing in the column field but it doesn't work. Does anyone know what I'm doing wrong?
    LPAD(NVL(TO_CHAR(TO_NUMBER(konten_nr),'FM999999999'),'0'),8,'0'),

    what is exactly your problem ?
    you want to translater " 1234" in "00001234" ? then simply use to_char(konten_nr,'FM00000000') .
    You want to translate " 1 1 1 1" in "01010101", then use replace(konten_nr,' ','0')
    Give us some samples

  • Problem using cover() function

    I have used the cover() function to cover the background of
    my presentation.
    my problem is when the piece is minimized and other
    application windows are active the background is still covered with
    black.
    I have used the uncover() function before the piece exits but
    it didn't fixed it.
    any help is welcomed
    thank you

    When you minimize, the piece is not exiting - of course - so
    just doing
    Uncover won't help if you're minimizing.
    There may be a function in the BudAPI Xtra (
    http://www.mods.com.au) that
    allows you to detect when a window is minimized so you could
    call the
    Uncover function, then hopefully detect when the window is
    restored to
    call the Cover function again...
    Otherwise, don't allow your users to minimize the piece by
    not including
    the menu nor title bars in the File Properties of your piece.
    Erik
    mahamang wrote:
    > I have used the cover() function to cover the background
    of my presentation.
    > my problem is when the piece is minimized and other
    application windows are
    > active the background is still covered with black.
    > I have used the uncover() function before the piece
    exits but it didn't fixed
    > it.
    > any help is welcomed
    > thank you
    >
    Erik Lord
    http://www.capemedia.net
    Adobe Community Expert - Authorware
    http://www.adobe.com/communities/experts/
    http://www.awaretips.net -
    samples, tips, products, faqs, and links!
    *Search the A'ware newsgroup archives*
    http://groups.google.com/group/macromedia.authorware

Maybe you are looking for

  • How to watch tv with FX 5600 XT vtdr 128

    How to watch tv with FX 5600 XT vtdr 128?

  • Finding the source code from Jar file

    Hi, I am a beginner java programmer but have been entrusted with learning our company's Java application. The architect of the application is not forthcoming in sharing information and so I need help in tracing the source code for the application. I

  • HTC DNA Backup Assistant won't work since 1/1/13

    HELP!  No matter what we've done - hard reset and GOT A BRAND NEW HTC DNA - still backup assistant won't work since 1/1/13.  This is NOT anything to do with Facebook. This all started with that same 1/1/13 error that so many of you got.  The tech als

  • Moving photos from several computers to iPad

    I have photos on different computers and I want to sync some of them to my iPad. Being locked to ONE computer is a nuisance. It feels very oldfashioned to carry around photos on a USB memory. How can I do this in an easy way? I would also like to fin

  • I have an iMac, version 10.8.5 and can no longer open a new private window.

    I am using Firefox 25.0.1 and my OS is up to date. A few days ago, I could no longer open a new private window. When I click on that tab, I get a new open window. When you reply, please keep in mind that I am not computer literate and would appreciat