Sql Query to replace the square bracket and the whole text inside with a single charecter

Hi All,
I  have a question.
I am using Sql Server 2012.
I have a  situation where i need to replace the entire text and the square bracket with a single charecter.
Eg:-> 
I have atext    san[123456dd]text
i just wanted to replace all teh text inside the sqaure bracket to another charecter say 'X' 
My end result should be sanXtext.
Could anyone help me regarding this?
Samproo

Prashanth ,
Thanks 
It works if i have a single square bracket like 
'san[123456dd]text'but presently i do have multiple square brackets like'san[123456dd]text[898989dd]note'I wanted to have teh result as 'sanXtextXnote'
Samproo

Similar Messages

  • Replacing the Rich Text Editor with FCKeditor

    Hi,
    I've seen a few people mention that they've replaced Portals RTE with FCKeditor in the Portal 10.1.2 release. As ever Oracles documentation is scant (that's being generous) as to how to do this. If anyone has, can you give me an example of how you have modified your buildUIembed.html file.
    I've currently got this partially working, the new RTE is displaying, but the page won't submit. Portals JS is trying to .save() the RTE content, a method which it apparently doesn't support!
    Any help would be much appreciated.
    Regards
    Dan

    Hi Dan,
    Per the OracleAS Portal User's Guide (available at http://www.oracle.com/technology/documentation/appserver1012.html)
    Possibility of extending or replacing the seeded rich text editor
    You can customize the OracleAS Portal rich text editor to support your needs: from simple changes, for example, replacement of buttons on the editor's toolbar, to more complex changes, for example, replacement of the seeded editor with one of your own.
    Such changes involve altering the files that comprise the user interface and functions of the seeded rich text editor. This being the case, this feature is intended for advanced OracleAS Portal administrators. Additionally, you should be aware that future upgrades of OracleAS Portal may impact any modifications made to these files. Support for this feature is offered through the Portal Content Area discussion forum and not through Oracle Support;
    You may want to pose this question in that forum.
    Regards,
    Pete

  • SQL Query (updateable report) Region - Conditionally Hide and Set Values

    SQL Query (updateable report) Region - Conditionally Hide and Set Values
    Outline of requirement :-
    Master / Detail page with Detail updated on same page using SQL Query (updateable report).
    The detail region has the following source
    SELECT item_id,
           contract_id,
           CASE WHEN hardware_id IS NOT NULL THEN
                   'HA'
                WHEN backup_dev_id IS NOT NULL THEN
                   'BD'
                WHEN hardware_os_id IS NOT NULL THEN
                   'HS'
           END item_type,
           hardware_id,
           backup_dev_id,
           hardware_os_id
    FROM   "#OWNER#".support_items
    WHERE  contract_id = :P26_CONTRACT_IDThe table support_items implements arced relationships and has the following columns
    CREATE TABLE SUPPORT_ITEMS
      ITEM_ID         NUMBER                        NOT NULL,
      CONTRACT_ID     NUMBER                        NOT NULL,
      HARDWARE_ID     NUMBER,
      BACKUP_DEV_ID   NUMBER,
      HARDWARE_OS_ID  NUMBER
    )A check type constaint on support_items ensures that only one of the fk's is present.
          (    hardware_id    IS NOT NULL
           AND backup_dev_id  IS NULL
           AND hardware_os_id IS NULL
    OR    (    hardware_id    IS NULL
           AND backup_dev_id  IS NOT NULL
           AND hardware_os_id IS NULL
    OR    (    hardware_id    IS NULL
           AND backup_dev_id  IS NULL
           AND hardware_os_id IS NOT NULL
          )    Hardware_Id is a FK to Hardware_Assets
    Backup_dev_id is a FK to Backup_Devices
    Hardware_os_id is a FK to Hardware_op_systems
    The Tabular Form Element based on item_type column of SQL query is Displayed As Select List (based on LOV) referencing a named list of values which have the following properties
    Display Value     Return Value
    Hardware Asset    HA
    Backup Device     BD
    Computer System   HSThe Tabular Form Elements for the report attributes for hardware_id, backup_dev_id and hardware_os_id are all Displayed As Select List (Based on LOV).
    What I want to do is only display the Select List for the FK depending on the value of the Select List on Item Type, e.g.
    Item_Type is 'HA' then display Select List for hardware_id, do not display and set to NULL the Select Lists for backup_dev_id and hardware_os_id.
    Item_Type is 'BB' then display Select List for backup_dev_id, do not display and set to NULL the Select Lists for hardware_id and hardware_os_id.
    Item_Type is 'HS' then display Select List for hardware_os_id, do not display and set to NULL the Select Lists backup_dev_id and hardware_id.
    There are properties on elements to conditionally display it but how do we reference the values of the SQL query Updateable region? they are not given a page item name?
    Also on the Tabular For Elements there is an Edit tick against a report item - however when you go to the Column Attributes there is not a property with which you can control the Edit setting.
    What's the best way of implementing this requirement in APEX 3.1?
    Thanks.

    >
    Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "user13515136".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    I have a multi-row region that displays values and allows entries in a number of fields.Provide exact details of how this has been implemented. (An example on apex.oracle.com is always a good way to do this.)
    I should like the fields to be conditional in that they do not permit entry, but still display, if certain conditions apply (e.g. older rows greyed out). Can this be done? Almost anything can be done, often in multiple ways. Which are appropriate may be dependent on a particular implementation, the skills available to implement it, and the effort you're willing to expend on it. Hence it's necessary to provide full details of what you've done so far...

  • Give me the sql query which calculte the table size in oracle 10g ecc 6.0

    Hi expert,
    Please  give me the sql query which calculte the table size in oracle 10g ecc 6.0.
    Regards

    Orkun Gedik wrote:
    select segment_name, sum(bytes)/(1024*1024) from dba_segments where segment_name = '<TABLE_NAME>' group by segment_name;
    Hi,
    This delivers possibly wrong data in MCOD installations.
    Depending on Oracle Version and Patchlevel dba_segments does not always have the correct data,
    at any time esp. for indexes right after being rebuild parallel (Even in DB02 because it is using USER_SEGMENTS).
    Takes a day to get the data back in line (never found out, who did the correction at night, could be RSCOLL00 ?).
    Use above statement with "OWNER = " in WHERE for MCOD or connect as schema owner and use USER_SEGMENTS.
    Use with
    segment_name LIKE '<TABLE_NAME>%'
    if you like to see the related indexes as well.
    For partitioned objects, a join from dba_tables / dba_indexes to dba_tab_partitions/dba_ind_partitions to dba_segments
    might be needed, esp. for hash partitioned tables, depending on how they have been created ( partition names SYS_xxxx).
    Volker

  • SQL Query to get the # of files in folders in a library

    Anyone has the SQL query to list the number of files in each folders in a SharePoint library?

    Technically it's a grey area of support as MS don't mind you doing it but won't help you if you encounter problems, the script is much better though.
    Scratch that, the script isn't that good. It's using .items which won't work on large lists and is slow. The version below is untested but should be significantly faster and work on large lists.
    $starttime = Get-Date
    #Creating new site object
    $siteurl = Read-Host "Enter the name of your site and press enter"
    $site = New-Object Microsoft.SharePoint.SPSite($siteurl)
    #Assigning all webs (sites) to $webs
    $webs = $site.Allwebs
    #System Libraries defined so they won't be touched##
    $systemlibs =@("Converted Forms", "Customized Reports", "Documents", "Form Templates",
    "Images", "List Template Gallery", "Master Page Gallery", "Pages",
    "Reporting Templates", "Site Assets", "Site Collection Documents",
    "Site Collection Images", "Site Pages", "Solution Gallery",
    "Style Library", "Theme Gallery", "Web Part Gallery", "wfpub")
    Write-Host "Total number of webs that will be traversed: " $webs.count
    $DocLibsCount = 0
    $DocLibwItems = 0
    $totalitems = 0
    $subfolderitems = 0
    foreach($web in $webs)
    $listcoll = $web.lists
    foreach($list in $listcoll)
    if($list -eq $null)
    Write-Host
    else
    $base = $list.GetType()
    if($base.name -eq "SPDocumentLibrary")
    if ($systemlibs -contains $list)
    { continue}
    else
    $DocLibsCount += 1
    $totalitems += $List.itemcount
    $name = $list.Title
    $folders = $web.GetFolder($name).SubFolders
    for($etr = 0;$etr -lt $folders.count; $etr++)
    if($folders[$etr].Name -ne "Forms")
    Write-Host "Processing SubFolder ItemCount" -ForegroundColor Red
    $tempcount = $folders[$etr].ItemCount
    $subfolderitems += $tempcount
    Write-Host
    Write-Host
    Write-Host "Total # of Document Libraries: " $DocLibsCount -ForegroundColor Green
    Write-Host "Total # of Document Libraries that contain items: " $DocLibwItems -ForegroundColor Green
    Write-Host "Total # of items: " $totalitems -ForegroundColor Green
    Write-Host "Total # of items in DocLib\Subfolders: " $subfolderitems -ForegroundColor Green
    $finishtime = Get-Date
    Write-Host
    Write-Host “Script Duration” –ForegroundColor Yellow
    Write-Host “Started: “ $starttime –ForegroundColor Yellow
    Write-Host “Finished: “ $finishtime –ForegroundColor Yellow
    Stop-SPAssignment -Global

  • SQL query to populate the records, the maximum processed should be less than 10 records per week.

    Dear All,
    I have a requirement, to write a SQL query to populate the records which are inserted less than 10 no of records.
    The tables has the cretaed_date column and along with other key column which will have unique values.
    Ex1:  The user might have inserted records from application, per week basis, between the date range '01-jun-2013' - 08-jun-2013  , the no of records created by the user during this week may be less than 10 records or more.
    But I want to populate the records by giving date range that too, it should pick the records the count which fall with in 10 records.
    I dont want the query to populate the records if the user has inserted more than 10 records in a week.
    Ex2:
    User 1 has created 15 records during the week 1 ( the query should not populate this ).
    User 2: has cretaed less than 10 records from the UI during the week 2. ( This details should get populated ).
    Thanks

    Use COUNT to find how many rows where inserted in a week.
    If this does not answer your question then please read Re: 2. How do I ask a question on the forums? And provide necessary details.

  • SQL query to get the Datetime 06 hours prior to the table Datetime value

    Hi Experts,
                    I'm just trying to create a SQL query to get the Datetime which should be 06 hours prior to my Table column value(Executiontime),
    Eg: my Executiontime(column) value is 07:00AM means, this query should fetch the detail of first VMName from table at 01:00AM, 
    SQL Table Name: TestTable
    Columns: VMName(varchar),status(varchar) Executiontime(Datetime)
    SQL Query : Select Top 1 VMName from
    TestTable where convert(date,Exeutiontime)=convert(date,getdate()) and
    status='0' and ExecutionTime > dateadd(hour,6,getdate())
    Request someone to alter this Query to my requirement or give me the new one.
    Regards,
    Sundar
    Sundar

    Hi All,
            Thanks for your Prompt response. I tried the below queries, but still I don't have any luck. Actually the queries are returning the value before the condition met (say when the time difference is more than 06 hours). I want the
    query to return exactly @ 06 hour difference or less than 06 hours,
    Query 01: Select Top 1 VMName from TestTable where
    convert(date,Exeutiontime)=convert(date,getdate())
    and status='0'
    and ExecutionTime >
    dateadd(hour,-6,getdate())
    Query 02: Select
    Top 1 VMName from TestTable where
    status='0'
    and ExecutionTime >
    dateadd(hour,-6,getdate())
    Query 03: Select
    Top 1 VMName from TestTable where status='0'
    and ExecutionTime >
    dateadd(hour,-6,ExecutionTime)
              Can someone point out the mistake please.
    Regards,
    Sundar
    Sundar

  • Sql query to achive the running division

    Hi all, plz help me out with the sql query to achive the below output
    create table emp_a (empno number, deptno number, sal number)
    insert into emp_a values(901, 10,100);
    insert into emp_a values(902, 10,400);
    insert into emp_a values(901, 20,300);
    insert into emp_a values(902, 20,2100);
    i want the ouput in below format
    empno deptno sal div_sal
    901 10 100 (300/100)
    901 20 300 (300/100)
    902 10 400 (2100/400)
    902 20 2100 (2100/400)
    the div_sal column should have the output of greatest sal/second smallest sal for each empno

    Hi,
    781649 wrote:
    Hi all, plz help me out with the sql query to achive the below output
    create table emp_a (empno number, deptno number, sal number)
    insert into emp_a values(901, 10,100);
    insert into emp_a values(902, 10,400);
    insert into emp_a values(901, 20,300);
    insert into emp_a values(902, 20,2100);
    i want the ouput in below format
    empno deptno sal div_sal
    901 10 100 (300/100)
    901 20 300 (300/100)
    902 10 400 (2100/400)
    902 20 2100 (2100/400)
    the div_sal column should have the output of greatest sal/second smallest sal for each empnofor empno=901, then second smallest sal is 300. For empno=902, the second smallest sal is 2100.
    Instead of "second *smallest* ", do you mean "second *greatest* "?
    What if there's a tie (e.g.
    INSERT INTO emp_a (empno, deptno, sal) VALUES (903, 10, 300);
    INSERT INTO emp_a (empno, deptno, sal) VALUES (903, 20, 300);
    INSERT INTO emp_a (empno, deptno, sal) VALUES (903, 30, 200);) Would you count 200 or 300 as the second greatest?
    Here's one way:
    WITH     got_r_num     AS
         SELECT     empno, deptno, sal
         ,     ROW_NUMBER () OVER ( PARTITION BY  empno
                                   ORDER BY          sal     DESC
                           )         AS r_num
         FROM    emp_a
    SELECT       e.empno
    ,       e.deptno
    ,       e.sal
    ,       '(' || TO_CHAR (r1.sal)
               || '/'
               || TO_CHAR (r2.sal)
               || ')'          AS div_sal
    FROM       emp_a           e
    JOIN       got_r_num     r1  ON      e.empno     = r1.empno
    JOIN       got_r_num     r2  ON   e.empno     = r2.empno
    WHERE       r1.r_num     = 1
    AND       r2.r_num     = 2
    ;

  • SQL query to get the list of approvals

    Hi,
    Could someone let me know the SQL query to get the list of all the pending approvals for a user in OIM 11g R2.
    Thanks

    There are a few ways to do this:
    -  The easiest would be to use a Relationship Query from the CMC. To do this, go to the Universes section on the CMC, right click on the relevant universe, select tools >> Check Relationships.
    - Use Query Builder. You will need more than one query to pull the information you need. You could try something like the below (for Webi)
    SELECT SI_NAME, SI_WEBI, SI_DATACONNECTION FROM CI_APPOBJECTS
    WHERE SI_KIND = 'universe' and SI_NAME = 'Universe Name'
    This will give you a list of Webi Reports by SI_ID.
    You'll need another query to list Webi report names:
    SELECT SI_NAME FROM CI_INFOOBJECTS WHERE SI_ID IN (SI_ID from query above)
    - This is trivial via Auditing / the Activity universe. This of course will only return reports that have already run.
    Best.
    Srinivas

  • Sql query to find the balances for a customer account wise.

    Hi,
    Could someone help me with the sql query to find the balances for each customer account wise. This is need to generate the report.
    presently we are using this query, but the output doesnot return the expected result.
    SELECT sum(nvl(ps.acctd_amount_due_remaining,0)) "Balance"
    FROM      ra_cust_trx_line_gl_dist_all gld,
              gl_code_combinations c,
              ar_payment_schedules_all ps,
              RA_CUSTOMER_TRX_ALL rat,
              ra_customers rc
    WHERE      c.CHART_OF_ACCOUNTS_ID = 101
    and gld.code_combination_id = c.code_combination_id
         and rat.CUSTOMER_TRX_ID=gld.CUSTOMER_TRX_ID
         and rat.CUSTOMER_TRX_ID=ps.CUSTOMER_TRX_ID
    and ps.customer_id=rc.customer_id
         and ps.status='OP'
         and ps.gl_date <= :PDATE
         and ps.org_id=:PORGID
         and ps.class in ('GUAR','INV','DM','DEP')
    and c.SEGMENT4=:Account_id
    and ps.customer_id=:Customer_id
    Thanks in advance.
    Kalyan.

    Can someone help us with this.

  • SQL Query To Select The 5th Element

    In the report I am currently working on, I am using an Add Command custom SQL query to pull the data that I need. The structure is a Call and a list of associated Activities. In this particular scenario, there are 8 activity notes for a type of call and I want to return the 5th one. The activity notes are a specific sequence of captured actions and I need the note from the 5th step in the sequence.
    This is what I have come up with:
    SELECT CALL.call_id,
         (select top 1 from (select top 5 CONVERT(char(8000),ACTIVITY.activity_note) from ACTIVITY
          where CALL.call_id = ACTIVITY.call_id
          order by ACTIVITY.creat_date desc))
         as activity_tx
    FROM CALL
    The intent of the Top 5 was to get the first 5 activity notes, of which the 5th note would be the last, then reverse sort them so I could take the Top 1 (which would be the 5th of 8). But I am getting a vague syntax error between "from" and "order by". Any suggestions would be appreciated.
    Thanks!
    Fuskie
    Who thought he had a solution but is flummoxed he can't bring it home...

    Hello,
    Let me explain that Crystal assumes the user knows how to write SQL. We only report on the data provided by the SQL you write.
    I did a quick search using Microsofts new search engine - www.bing.com and it returned this as well as lots more:
    http://forums.devshed.com/php-development-5/how-to-access-a-certain-element-in-the-results-of-606217.html
    Try searching in MSSQL's site also for more info on how to get the results you are looking for.
    Thank you
    Don

  • Sql query to indetify the identical data

    Hi
    I would like to know the query to identify the identical data in same table.
    Example: I have table called 'AA" having same data for load_ctry i.e. 'MY' and 'HK' ,I need sql query to indetify the identical data for above countries in that table.
    Thanks
    MR

    Hi,
    Table called "AA" with columns col1,col2,col3,load_ctry with following sample date
    col1 col2 col3 load_ctry
    3 bg xx TH
    4 op xc TH
    3 bg xx MY
    4 op xc MY
    3 vb nb MY
    When query ,if data is identical for both countries ,no data to fecth or data identical .If data is differ ,it will return the mismatching data becuase we are using same table for both countries .
    Thanks
    MR

  • GRC - SQL Query to retrive the Approver/Rejecter Names

    Hello,
    I was trying to write a sql query to retrive the name of the user who has approved or rejected a particular Approval Notification in GRC Flow rule.
    This query should retrive the user , who has taken the action. This user name will be added to the Role, which inturn will be attached to the Approval Group
    Thanks,
    Gowri

    Basically, We have GRC Flow rule, with a process flow written to send Notification
    Here we have added a Approver Group with approval type as Wait for Approval and Vote Percentage as 100
    Two users are added to the Role which inturn is added to the Approval Group. What is the SQL query to retrieve the Username who has Approval or Rejection for a notification?
    Can anyone please help
    Thanks,
    Gowri

  • Can anybody provide the SQL query to find the files uploaded in a particular folder?

    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

    Nevin,
    Be great if we could know the version of Portal. For Rel. 1, here's the query
    select id,masterthingid from wwv_things
    where siteid = &site
    and cornerid = &corner
    &site - Content Area id
    &corner - Folder id
    if you don't know the folder id, use
    select id from wwv_corners where siteid = &site
    and name = &folder
    Hope this helps. I have run into this situation before. Usually, the culprits were
    one of the following:
    1. Junk Characters in description of item (caused due to Copy-Paste)
    2. Special Characters in the File name
    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

  • Is it possible to trace users sql query disconnected from the session

    One of my users used to run the sql query daily, Now her machine rebooted and she lost all the sql query. is there any way to trap the sql what she used to run? I have the os/sql username....
    thx

    user587112 wrote:
    Yes we are using 10.2.0.3. main requirement of user is all the sql query she used to run.To get this query she is giving me her os user.And says why it is not possible?What would that be possible? If this database is reserved for her only that could be possible.
    Once she lost her session, there's no reliable method to trace all her SQL queries. The SID will be reused by Oracle, her SQL could be flushed out of shared pool, consider Oracle is designed to tackle with thousands of queries per seconds there's no feasible way to save all these information without impact on performance.
    So unless you had sql trace turned on her session or the database is reserved for her use only, then no it's not possible to retrieve all her SQLs and guarantee it. You might be able recover some of SQL from the mentioned DBA views but no guarantee what so ever.
    PS. it's no guarantee to get all her SQLs even her session is still active, unless SQL trace were turned on.
    Edited by: yingkuan on Jan 13, 2009 11:48 AM

Maybe you are looking for

  • Iweb help - blog entries problem

    Hello, I am trying to create a highly customized blog in iweb '08 and so far am doing very well, all the pages look perfect over all browsers however i have tried to edit the blog entries page but am having grave difficulty, i have set the page attri

  • Error occurred while getting a schedule list.The system cannot find the fil

    Hi all, If i open the "packages shedule status".I am getting error like  "Error occurred while getting a schedule list.The system cannot find the file specified".How to fix this issue?.Anyone have idea please share. Thanks in advance AD

  • SAP DOCUMENT ACCESS BY OPENTEXT Sizing guide

    Could you please help me to find the sizing guide for SAP DOCUMENT ACCESS BY OPENTEXT? I've been looking for it but I just found the Installation guide. Any tip that you could give me will be appreciated. Thank you all.

  • TS1372 can't restore ipod shuffle error 1442

    how xan i restart my ipod shuffle with unknown error occured 1442?

  • Two SubForms with one having dynamic table

    Hello, I am having a problem regarding subforms and dynamic tables.  Here is the situation: 1.  I have one main form where the content is "Flowed" 2.  I have two subforms, both have the content of "Positioned" 3.  The first subform has a dynamic tabl