Help required- Searching Particular string in column

Hi,
I have a table by name temp and 2 values in the table. I'm using LIKE caluse to search a string. I'm getting output for some particular string. Please correct the below query for me.
I have given a table/data reference for you:
Create table temp(col1 varchar2(255));
insert into temp values ('Test_Scale_High');
1 row inserted
insert into temp values ('Test_Scale_High');
1 row inserted
commit;
select * from temp;
col1
Test_Scale_High
Test_Scale High
select * from temp where upper(col1) like '%TEST_SCALE%';
COL1
Test_Scale_High
Test_Scale High
select * from temp WHERE UPPER(COL1) LIKE '%TEST_SCALE_%';
COL1
Test_Scale_High
Test_Scale High
select * from temp WHERE UPPER(COL1) LIKE '%TEST_SCALE_H%';
No Row Selected
Thanks,
Santhosh.S

santhosh.shivaram wrote:
select * from temp;
col1
Test_Scale_High
Test_Scale High
select * from temp where upper(col1) like '%TEST_SCALE%';
COL1
Test_Scale_High
Test_Scale High
select * from temp WHERE UPPER(COL1) LIKE '%TEST_SCALE_%';
COL1
Test_Scale_High
Test_Scale High
If I understand your requirement correctly you need to escape the Wild Card '_'
Hope the following code helps:
SQL> set feedback on;
SQL> SELECT * FROM TEMP
  2  /
COL1
Test_Scale_High
Test_Scale High
2 rows selected.
SQL> SELECT *
  2    FROM temp
  3   WHERE UPPER (col1) LIKE '%TEST_SCALE%'
  4  /
COL1
Test_Scale_High
Test_Scale High
2 rows selected.
SQL> SELECT *
  2    FROM temp
  3   WHERE UPPER (col1) LIKE '%TEST_SCALE\_%' ESCAPE '\'
  4  /
COL1
Test_Scale_High
1 row selected.
SQL> SELECT *
  2    FROM temp
  3   WHERE UPPER (col1) LIKE '%TEST_SCALE_H%'
  4  /
COL1
Test_Scale_High
Test_Scale High
2 rows selected.
SQL> SELECT *
  2    FROM temp
  3   WHERE UPPER (col1) LIKE '%TEST_SCALE\_H%' ESCAPE '\'
  4  /
COL1
Test_Scale_High
1 row selected.
SQL>Regards,
Jo
Edited by: Joice John : Added 2 Sample Codes

Similar Messages

  • Help required on Datetime string conversion

    Hello Experts,
    I have a string with value '2010-07-16T07:30:00+03:00' which came from a webservice string data.Please advice how to declare variable in abap to get the correct date and time from this string?
    From my previous exp, if I had the xml structure with this field as xsddatetime and in abap proxy, if I assign it to a char/string variable it used to do the calculation based on the timezone and give me the value as 20100716043000.
    Please advice.
    (I'm not sure if I had to post this in the ABAP forum, but thought the PI experts might have faced and solved this problem before)
    Mat

    Thanks Sandeep for your time and effort, but the problem here is this wont consider the +3 timezone in below example.
    Generally if you have a date time field in xml structure, while generating proxy ..it creates the field in abap with XSDDATETIME_Z dataelement and automatically converts to the correct  date time.(below ex date = '2010-07-16'  time = 04:30:00'
    If I offset and do the math myself, I have to handle various cases like different time zones as well as time closer to midnights( then the date has to be changed too ).
    I was hoping for a straight forward way of declaring it and getting the values.
    Thanks again.
    Mat

  • Searching for a string in the xml present in a particular row and column.

    Hi All,
    We have a table in which in one of the column a complete payload xml is getting stored.
    Is there any way to search for a particular string in the stored xml of a particular row?
    Thanks in Advance,
    Bob

    Here is a simple example of what Blu is saying
    I have create a table temp_dept like this
    SQL> desc temp_dept
    Name                          Null?    Type
    DEPTNO                                 NUMBER
    DNAME                                  VARCHAR2(10)
    LOC                                    VARCHAR2(8)
    EMP_XML                                XMLTYPE
    I have loaded employee detail from emp table into emp_xml as xml data. here is a sample
    SQL> select * from temp_dept;
        DEPTNO DNAME      LOC      EMP_XML
            10 ACCOUNTING NEW YORK <?xml version="1.0"?>
                                   <ROWSET>
                                    <ROW>
                                     <EMPNO>7782</EMPNO>
                                     <ENAME>CLARK</ENAM
            20 RESEARCH   DALLAS   <?xml version="1.0"?>
                                   <ROWSET>
                                    <ROW>
                                     <EMPNO>7369</EMPNO>
                                     <ENAME>SMITH</ENAM
            30 SALES      CHICAGO  <?xml version="1.0"?>
                                   <ROWSET>
                                    <ROW>
                                     <EMPNO>7499</EMPNO>
                                     <ENAME>ALLEN</ENAM
    Now i can convert the emp_xml into a table and query like this
    SQL> select d.deptno
      2       , d.dname
      3       , d.loc
      4       , e.*
      5    from temp_dept d
      6       , xmltable
      7         (
      8              '/ROWSET/ROW' passing d.emp_xml
      9              columns empno          number        path 'EMPNO'
    10                    , ename          varchar2(100) path 'ENAME'
    11                    , job            varchar2(100) path 'JOB'
    12                    , mgr            number        path 'MGR'
    13                    , hiredate       varchar2(100) path 'HIREDATE'
    14                    , sal            number        PATH 'SAL'
    15                    , com            number        PATH 'COM'
    16         ) e
    17  /
        DEPTNO DNAME      LOC           EMPNO ENAME      JOB               MGR HIREDATE          SAL     COM
            10 ACCOUNTING NEW YORK       7782 CLARK      MANAGER          7839 09-JUN-81        2450          0
            10 ACCOUNTING NEW YORK       7839 KING       PRESIDENT             17-NOV-81        5000          0
            20 RESEARCH   DALLAS         7369 SMITH      CLERK            7902 02-APR-81        2975          0
            20 RESEARCH   DALLAS         7566 JONES      MANAGER          7839 02-APR-81        2975          0
            20 RESEARCH   DALLAS         7788 SCOTT      ANALYST          7566 19-APR-87        3000          0
            20 RESEARCH   DALLAS         7876 ADAMS      CLERK            7788 23-MAY-87        1100          0
            30 SALES      CHICAGO        7499 ALLEN      SALESMAN         7698 20-FEB-81        1600        300
            30 SALES      CHICAGO        7521 WARD       SALESMAN         7698 22-FEB-81        1250        500
            30 SALES      CHICAGO        7654 MARTIN     SALESMAN         7698 28-SEP-81        1250       1400
            30 SALES      CHICAGO        7698 BLAKE      MANAGER          7839 01-MAY-81        2850          0
            30 SALES      CHICAGO        7844 TURNER     SALESMAN         7698 08-SEP-81        1500          0
    11 rows selected.
    SQL>
    You can apply filter for the necessary value that you are searching.

  • Search Help with in a serach help required in SRM 4.0

    Hi,                                                     
    Requirement: Search help required for Product Category field in the Search help for Product(BBPH_PRODUCT) in SRM portal.
    This search help is used in Create shopping Cart transaction. The hyper link on Internal Goods/Services leads to the search help BBPH_PRODUCT. 
    My analysis:           
    The field Product Category (CATEGORY_ID) has search help(COM_CAT_HIER) attached to its data element. When I single test the search help BBPH_PRODUCT in SAP GUI,I can see the search help for field product category in the selection dialogue box. However the same does not appear on the corresponding screen in HTML.
    Please let me know whether I need to do some thing to make the search help appear on the HTML screen?
    With Regards,         
    Prakash Kamath

    Hi Prakash,
    I have the same problem but with another field. Unloading point. Could you please tell me how did you solve this problem with displaying F4 help on html/ SRM portal?
    Thank you very much.
    Best regards,
    Danijela ZIvanovic

  • How to attach search help in a particular field in se80 screen

    Hi All,
    Can any one tell me how to attach a search help in a particular field in a screen.
    Wat search help is used to display material no and description
    Thanks in Advance
    Regards,
    Priya

    Hi Priya,
    In the Screen Layout, Double click on the field on which you wish to attach the search help.
    In the properties window you can specify the search help for that field.
    Search help for Material No. is MAT1.
    You can find it in the Table structure (SE11) , "Entry help/check" tab.
    Regards,
    Himanshu

  • Help required on search help

    In my requirement I have a table for which a search help needs to be designed. The product hierarchy has 8 levels. To identify the correct product hierarchy, search help will be used by the user to select the level of product hierarchy and to navigate to next level of product hierarchy.
    Please give me some idea to design this.

    Hi,
    You have to use collective search help.
    A collective search help describes an input help process in which the
    user can choose one of several alternative search paths. Each
    alternative search path corresponds to an elementary search help, i.e. a
    collective search help contains several elementary search helps.
    Both elementary search helps and other collective search helps can be
    included in a collective search help. if a collective search help
    contains other collective search helps, they are resolved down to the
    level of the elementary search helps when the input help is called.
    Like an elementary search help, a collective search help has an
    interface of import and export parameters. The data is exchanged between
    the screen template and the parameters of the elementary search helps
    contained in it using this interface. The parameters of the search helps
    included in a collective search help must be assigned to the parameters
    of the collective search help.
    During the input help process, the collective search help only controls
    the user's selection of the required search path. The rest of the dialog
    and data collection is controlled by the selected elementary search
    help. If selection of the required elementary search help should be made
    flexible (e.g. with context-specific definition of the set of available
    search paths), the collective search help must be assigned a search help
    exit.
    Hope now you can design accordingly and i think this helps you.
    Regards,
    Rama Chary.Pammi.

  • Help to search for a string value and return the index in the arraylist

    Hello,
    I just start java programming for the last three weeks and I cannot find a solution for this problem. I have the following List with string and integer value as shown below:
    List<Empl> list= new ArrayList<Empl>();
         list.add(new Empl(1,"Jim", "Balu",88);
         list.add(new Empl(3,"Bob", "Howards",2);
         list.add(new Empl(2,"Chris", "Hup",8);
    I have no problem of sorting this arraylist either by firstname or lastname. However, I cannot think of a way to search for a firstname or lastname and returing the whole row. I do not want to use index since I am asking user to enter the name to search. Here is my code to search for an empl based on index.
    System.out.print("Please enter index to search or (q)uit: ");
              String ans = sc.next();
              System.out.println();
              int ians = Integer(ans);
              if (ans.equalsIgnoreCase("q"))
                        choice = "n";
              else
              System.out.println("index " + list.get(ians)); //this will print out the whole row based on the index
    Since the user will never seen the contents of the arraylist, is there a way that I can search by string last/first name and will get the index location in int if the result is met?
    Please advice and thank you.
    Bob.

    user11191663 wrote:
    Since the user will never seen the contents of the arraylist, is there a way that I can search by string last/first name and will get the index location in int if the result is met?Another possibility is to set up an ArrayList for each thing you want to search on and then every time you add an employee, add the piece of data you want as well, viz:
    Empl e = new Empl(1,"Jim", "Balu",88);
    list.add(e);
    firstNames.add(e.firstName());As long as you always add them in the same order, the indexes will match, so you could do something like
    ians = firstNames.indexOf(nameToFind);to return the index of the name, if it's there (if not, it will return -1).
    I wouldn't recommend this as standard practise, but it should be OK for the level you're at.
    NOTE: indexOf() returns the index of the FIRST matching item. You may want to think about what you want to do if there are more than 1.
    Winston

  • Pricing Error (help required)

    Is there any routine which includes the tax value in R100 as well ,currently  the problem is that the 100% Discount condition is only including the net price
    And in the pricing procedure i m using two prices one price of tax calculation and the other is consumer price first i calculate the tax from base price then i deduct the tax from the consumer price this calculation is working fine through standard routines.
    Only problem is that when i enter NRAB and R100 at end it only includes Net Value which is calculated through Formual using condition type NTPS
    Kindly Help Required ASAP

    Hi ABAPAR,
    I m not getting the exact picture of what U desired, from your pricing procedure.
    As you r using multiple free goods condition type...anyway.
    If you wanted to make the calculated tax "amount + "as a basis for the calculation of particular condition type.you can use the functionality of subtotal.
    That mean go and assign one subtotal no. to subtotal column in your pricing procedur to all condition type to which you wanted to make as a basis for furthur calculation.(this settings allow the total of all values in one subtotal).
    And finally U can assign this subtotal no.to the "alt.cal.B.value "of pricing procedure for the calculation of particular condition type.
    If you r using any std condion type that come up with certain routine like NRAB or somthing...possibly that will not allow u to do this settings. so in this case clear your free goods requirement or use any new condition type. i.e . Z creation.
    consult your SD consultant.
    karnesh

  • How to search a string in some folder.

    Hi ,
    In my application users will upload some pdf,xls files to server. files will be saved in server. From the front end can search on all files with some specific string. If that string is there in any of the file, user has to get link to download that file and the text just before and after that user string. Its like how we get in google. This type of search we need to implement, Could any one please let me know how to implement, any free API are there in java. Please its urgent, help on this.
    Thanks
    Mohan

    user594301 wrote:
    I have 2 columns in a table. entry_no and msg_txt. entry_no is number(12) and msg_txt is LONG. I want to search one string in msg_txt. How can I write a query for this ?You can't write a query for this. The only thinks you can do with a long in a query is put something in and take it out again - with diffiuclty, usually.
    You can write a PL/SQL function to do this for you if necessary. The function will have to perform the search directly if the long < 32760 bytes or use DBMS_SQL to break the LONG up into 32760 byte segments that can then be manually searched. If you are lucky someone has done this already and posted the code online. Either way the solution will be slow and probably painful to implement.
    If possible convert your data to a CLOB and use DBMS_CLOB to find the data you need.

  • How to make a particular row and column field editable in ALV

    Hi Experts,
    I have a requirement to make a particular row and column field editable in ALV output. Like i need to make 2nd row - 4th column editable of ALV output.
    Kindly help me out to solve this.
    Any help would be appreciated.
    Thanks,
    Ashutosh

    Hi Ashutosh,
    please check below, explained by some experts.
    In the below link  editing two columns MOD_RANK and TECH_RANK.
    These two columns will be in edit mode once after selecting the required record
    Editing single cell in a row of ALV table
    And also look for more info
    http://scn.sap.com/thread/884976

  • Searching a string in Forms V5.

    Hi all,
    My requirement is to search a string in a Form (Forms Version 5.0.6.8.0. However If I go to <Filie-Administration-Object list report), I am getting a ascii file. All the objects in the form are listed in the file. So, I do a 'Search' of my required String in the ascii file.
    However, in the <Ascii> file, I find that the program units are not converted to txt file. Only the program unit's name is present.
    Is there any other method, by which I can search my required string in the form(includding all program units, viz., triggers, program units)?
    Thanks in advance for ur help.
    null

    Maybe this will help you:
    We have FREE versions of FormDiff and FormGrep,the productivity tools for Oracle Developer, available for downloading now.
    There are NO FORMS to fill out, NO LIMIT on how long you can use them and best of all NO COST.
    Check out the latest FormDiff features and download your FREE VERSION now: http://www.aug10.com/products/FormDiff
    Using FormDiff, you can now document changes made to Forms and perform meaningful code reviews.
    Checkout the latest FormGrep features and download your FREE VERSION now: http://www.aug10.com/products/FormGrep
    Using FormGrep, you can 'Find and Replace PL/SQL code' across hundreds of FMBs at a time.
    Thank you for your time,
    Jesse Johnson - Managing Principal
    August Tenth Systems, Inc.
    PO Box 3682
    Boulder, CO 80307-3682 http://www.aug10.com/
    Helena

  • Urgent help required: Query regarding LC Variables

    Hi All
    Sometime earlier I was working on a performance issue raised by a customer. It was shell script that was taking almost 8-9 hrs to complete. During my research I came across a fact that there were some variables which were not set, the LC variables were impacting the sort funnel operations because of which the script was taking a long time to execute.
    I asked them to export the following commands, after which the program went on smoothly and finished in a couple of mins:
    export LC_COLLATE=en_US.ISO8859-1
    export LC_MESSAGES=C
    export LC_MONETARY=en_US.ISO8859-1
    export LC_MONETARY=en_US.ISO8859-1
    export HZ=100
    export LC_CTYPE=en_US.ISO8859-1
    export LANG=en_US.UTF-8
    Later I did recover that setting the LC_COLLATE to C, is not helping and the program was again taking a lot of time. Few questions that I want to ask are:
    1. Can someone please tell me, what each of these variable mean and how these values make a difference.
    2. When I exported LC_COLLATE=en_US.ISO8859-1, it worked fine, but when i tried with the defalut value LC_COLLATE=C, then why the program didnt work.
    As this issue is still going on, hence I would request All to provide their valuable inputs and let me know as much as possible.
    Appreciate your help in this regard.
    Thanks
    Amit
    Hi All
    A new development in this regard. The customer has send us a screen shot in which they were trying to export the locale variable using the commands which I have pasted above. I can see in the screen shot that while exporting LC_COLLATE and LC_TYPE, they get a message that ""ksh: export: couldn't set locale correctly"".
    Request everyone to please give their inputs as it's a bit urgent.
    Thanks for all the help in advance.
    Thanks
    Amit
    Some help required please...
    Edited by: amitsinhaengg on Jul 22, 2009 2:03 AM
    Edited by: amitsinhaengg on Jul 22, 2009 2:06 AM

    LC_CTYPE
    Controls the behavior of character handling functions.
    LC_TIME
    Specifies date and time formats, including month names, days of the week, and common full and abbreviated representations.
    LC_MONETARY
    Specifies monetary formats, including the currency symbol for the locale, thousands separator, sign position, the number of fractional digits, and so forth.
    LC_NUMERIC
    Specifies the decimal delimiter (or radix character), the thousands separator, and the grouping.
    LC_COLLATE
    Specifies a collation order and regular expression definition for the locale.
    LC_MESSAGES
    Specifies the language in which the localized messages are written, and affirmative and negative responses of the locale (yes and no strings and expressions).
    You can use command
    # locale -k LC_CTYPE
    to see more detail about each type.

  • How to fill color in a cell having particular string when using convertto-html

    Hello Scripters,
    I have downloaded AD health check script but I am wondering if the cell color be changed for a particular string. Like all the cells having text "Failed"..should be in red color.
    Here is the script-
    Function Getservicestatus($service, $server)
    $st = Get-service -computername $server | where-object { $_.name -eq $service }
    if($st)
    {$servicestatus= $st.status}
    else
    {$servicestatus = "Not found"}
    Return $servicestatus
    $Forest = [system.directoryservices.activedirectory.Forest]::GetCurrentForest()
    [string[]]$computername = $Forest.domains | ForEach-Object {$_.DomainControllers} | ForEach-Object {$_.Name}
    #Section -1
    $report= @()
    foreach ($server in $computername){
    $temp = "" | select server, pingstatus
    if ( Test-Connection -ComputerName $server -Count 1 -ErrorAction SilentlyContinue ) {
    $temp.pingstatus = "Pinging"
    else {
    $temp.pingstatus = "Not pinging"
    $temp.server = $server
    $report+=$temp
    $b = $report | select server, pingstatus | ConvertTo-HTML -Fragment -As Table -PreContent "<h2>Server Availability</h2>" | Out-String
    #Section - 2
    $report = @()
    foreach ($server in $computername){
    $temp = "" | select server, KDC, NtFrs, DFSR, netlogon, w32Time
    $temp.server = $server
    $temp.KDC = Getservicestatus -service "KDC" -server $server
    $temp.NtFrs = Getservicestatus -service "NtFrs" -server $server
    $temp.DFSR = Getservicestatus -service "DFSR" -server $server
    $temp.netlogon = Getservicestatus -service "netlogon" -server $server
    $temp.w32Time = Getservicestatus -service "w32Time" -server $server
    $report+=$temp
    $b+= $REPORT | select server, KDC, NtFrs, DFSR, netlogon, w32Time | ConvertTo-HTML -Fragment -As Table -PreContent "<h2>Service Status</h2>" | Out-String
    #Section - 3
    add-type -AssemblyName microsoft.visualbasic
    $strings = "microsoft.visualbasic.strings" -as [type]
    $report = @()
    foreach ($server in $computername){
    $temp = "" | select server, Netlogon, Advertising, Connectivity, Replication
    $temp.server = $server
    $svt = dcdiag /test:netlogons /s:$server
    $svt1 = dcdiag /test:Advertising /s:$server
    $svt2 = dcdiag /test:connectivity /s:$server
    $svt3 = dcdiag /test:Replications /s:$server
    if($strings::instr($svt, "passed test NetLogons")){$temp.Netlogon = "Passed"}
    else
    {$temp.Netlogon = "Failed"}
    if($strings::instr($svt1, "passed test Advertising")){$temp.Advertising = "Passed"}
    else
    {$temp.Advertising = "Failed"}
    if($strings::instr($svt2, "passed test Connectivity")){$temp.Connectivity = "Passed"}
    else
    {$temp.Connectivity = "Failed"}
    if($strings::instr($svt3, "passed test Replications")){$temp.Replication = "Passed"}
    else
    {$temp.Replication = "Failed"}
    $report+=$temp
    $b+= $REPORT | select server, Netlogon, Advertising, Connectivity, Replication | ConvertTo-HTML -Fragment -As Table -PreContent "<h2>DCDIAG Test</h2>" | Out-String
    #Section - 4
    $workfile = repadmin.exe /showrepl * /csv
    $results = ConvertFrom-Csv -InputObject $workfile | where {$_.'Number of Failures' -ge 1}
    #$results = $results | where {$_.'Number of Failures' -gt 1 }
    if ($results -ne $null ) {
    $results = $results | select "Source DSA", "Naming Context", "Destination DSA" ,"Number of Failures", "Last Failure Time", "Last Success Time", "Last Failure Status"
    $b+= $results | select "Source DSA", "Naming Context", "Destination DSA" ,"Number of Failures", "Last Failure Time", "Last Success Time", "Last Failure Status" | ConvertTo-HTML -Fragment -As Table -PreContent "<h2>Replication Status</h2>" | Out-String
    } else {
    $results = "There were no Replication Errors"
    $b+= $results | ConvertTo-HTML -Fragment -PreContent "<h2>Replication Status</h2>" | Out-String
    $head = @'
    <style>
    body { background-color:#dddddd;
    font-family:Tahoma;
    font-size:12pt; }
    td, th { border:1px Solid Black;
    border-collapse:collapse; }
    th { color:white;
    background-color:DarkGoldenRod; }
    table, tr, td, th { padding: 2px; margin: 0px }
    table { margin-left:50px; }
    </style>
    $s = ConvertTo-HTML -head $head -PostContent $b -Body "<h1>Active Directory Checklist</h1>" | Out-string
    $emailFrom = ""
    $emailTo = ""
    $smtpserver= ""
    $smtp=new-object Net.Mail.SmtpClient($smtpServer)
    $msg = new-object Net.Mail.MailMessage
    $msg.From = $emailFrom
    $msg.To.Add($emailTo)
    $msg.IsBodyHTML = $true
    $msg.subject="Active Directory Health Check Report From Dlhdc02"
    $msg.Body = $s
    $smtp.Send($msg)
    Like in the Ping Status (section - 1), I'd like all the cell having text "Not Pinging" should be in RED color.
    Also I am facing an issue in the (Section - 4). When the value of $Results is not null I am getting the desired output but when the value is null the text ""There were no Replication Errors""  is not getting displayed in
    the HTML body. Instead it comes as "*32" (32 is the number of letters in the text).
    Please help me in fixing this ....
    BR
    Himanshu
    MCTS|MCSE|MCSA:Messaging|CCNA

    Here are instructions on  ways to color cells based on content.
    http://tech-comments.blogspot.com/2012/07/powershell-dynamically-color-posh.html
    \_(ツ)_/

  • Help required in changing to str for dynamic sql

    Hi
    I am trying to make this to string for dynamic sql, this is a part of the sql which is giving problem with p_..as parameters from proc. Help me in this , iam also seeing dbms _output but stil unable to format it to required error free string.
    || ' AND ( po.abbreviationprojectopportid LIKE '
    || '%'
    || 'NVL'
    || '('
    || p_opp_code
    || ', ''NULL'')'
    || '%'
    || ' OR co.companyname LIKE '
    || '%'
    || 'NVL'
    || '('
    || p_client_name
    || ', '' NULL'')'
    || '%'
    || ' OR le.line_item_amount = NVL '
    || ' ('
    || p_booking_amt
    || ', -0.197) '
    || 'OR po.dealcurrency = NVL '
    || '('
    || p_currency
    || ',''NULL'')'
    || 'OR be.booking_entry_id LIKE '
    || '%'
    || 'NVL ('
    || p_entry_id
    || ',''NULL'')'
    || '%'
    || ' OR le.line_item_id LIKE '
    || '%'
    || 'NVL ('
    || p_line_item
    || ',''null'')'
    || '%'
    || ' OR be.ticket_num LIKE '
    || '%'
    || 'NVL ('
    || p_ticket_num
    || ',''NULL'')'
    || '%'
    || ' OR be.updatedby LIKE '
    || '%'
    || 'NVL ('
    || p_user_name
    || ',''NULL'')'
    || '%'
    || ' OR credittransaction.acct_code ='
    || 'NVL ('
    || p_gl_account
    || ','
    || '-0.197)'
    || 'OR debittransaction.acct_code ='
    || 'NVL ('
    || p_gl_account
    || ', '
    || '-0.197) '
    || 'OR credittransaction.profit_ctr_code ='
    || 'NVL ('
    || p_profit_center
    || ','
    || ' -0.197)'
    || 'OR debittransaction.profit_ctr_code ='
    || 'NVL ('
    || p_profit_center
    || ','
    || '-0.197)'
    || ' OR le.sap_posting = NVL ('
    || p_sap_posting
    || ',''$'')'
    || 'OR cmis.cmis_code = NVL ('
    || p_cmis_nominal
    || ','' -0.197)'
    || 'OR sa.sap_code = NVL ('
    || p_sap_booking_entity
    || ', -0.197)'
    || ' OR (be.booking_date BETWEEN '
    || v_booking_date_from
    || 'AND '
    || v_booking_date_to
    || ')'
    || ' )'
    || 'ORDER BY '
    || p_sort_by
    || ' '
    || p_order;

    some errors.. Try this...
    ' SELECT be.booking_date bookingdate, '
    || ' be.booking_entry_id entryid, le.line_item_id itemid,'
    || ' po.abbreviationprojectopportid opportunitycode,'
    || ' co.companyname clientname, '
    || ' le.line_item_amount bookingamount,'
    || ' be.ticket_num ticketnum, po.dealcurrency currency,'
    || ' cmis.cmis_code cmis_nominal,'
    || ' sa.sap_code sap_booking_entity,'
    || ' (SELECT full_name '
    || ' FROM iba_employee '
    || ' WHERE TO_CHAR (employeeid) = be.updatedby) updatedby,'
    || ' be.updateddate updateddate, '
    || ' (SELECT le.line_item_amount * rate '
    || ' FROM iba_currencyconversion '
    || ' WHERE tocurrencycd = '
    || 'USD'
    || ' AND currencycd = po.dealcurrency '
    || ' AND conversiondate = be.booking_date) amountusd,'
    || 'debittransaction.acct_code debitglaccount,'
    || ' credittransaction.acct_code creditglaccount,'
    || ' debittransaction.profit_ctr_code debitprofitcenter,'
    || ' credittransaction.profit_ctr_code creditprofitcenter,'
    || ' debittransaction.amt debitamount,'
    || ' credittransaction.amt creditamount'
    || ' FROM rb_booking_entry be, '
    || ' rb_line_item le, '
    || ' rb_booking_period bp,'
    || ' rb_cmis_gl_account cmisgl,'
    || ' rb_cmis_account cmis,'
    || ' iba_projectopportunity po,'
    || ' iba_company co,'
    || ' rb_sap_account sa,'
    || ' (SELECT acctr.line_item_id line_item,'
    || ' sapgl_acc.account_code acct_code,'
    || ' acctr.amount amt,'
    || ' sappr.profit_center_code profit_ctr_code'
    || ' FROM rb_account_transaction acctr,'
    || ' rb_sap_profit_center sappr,'
    || ' rb_sap_gl_account sapgl_acc'
    || ' WHERE acctr.profit_center_id = sappr.profit_center_id '
    || ' AND acctr.gl_account_id = sapgl_acc.gl_account_id '
    || ' AND acctr.transaction_type = ''D'') debittransaction,'
    || ' (SELECT acctr.line_item_id line_item,'
    || ' sapgl_acc.account_code acct_code,'
    || ' acctr.amount amt,'
    || ' sappr.profit_center_code profit_ctr_code '
    || ' FROM rb_account_transaction acctr, '
    || ' rb_sap_profit_center sappr, '
    || ' rb_sap_gl_account sapgl_acc '
    || ' WHERE acctr.profit_center_id =sappr.profit_center_id '
    || ' AND acctr.gl_account_id = sapgl_acc.gl_account_id '
    || ' AND acctr.transaction_type = ''C'') credittransaction '
    || ' WHERE po.projectopportunityid = be.projectopportunityid '
    || ' AND be.booking_entry_id = le.booking_entry_id '
    || ' AND po.companyid = co.companyid '
    || ' AND bp.booking_period_id = be.booking_period_id '
    || ' AND cmis.cmis_id = cmisgl.cmis_id '
    || ' AND le.sap_id = sa.sap_id '
    || ' AND le.cmis_id = cmis.cmis_id '
    || ' AND debittransaction.line_item(+) = le.line_item_id '
    || ' AND credittransaction.line_item(+) = le.line_item_id '
    || ' AND ( po.abbreviationprojectopportid LIKE ' || '''%' || NVL(p_opp_code,'NULL') || '%'''
    || ' OR le.line_item_id LIKE '
    || '''%'
    || NVL (
    || p_line_item
    || ,'null')
    || '%'''
    | ' OR le.line_item_amount = '
    ||NVL(|| p_booking_amt, -0.197)
    || ' OR po.dealcurrency ='
    || NVL(p_currency,'NULL')
    || ' OR be.booking_entry_id LIKE '
    || '''%'
    || NVL (p_entry_id,'NULL')
    || '%'''
    || ' OR be.ticket_num LIKE '
    || '''%'
    || NVL (p_ticket_num,'NULL')
    || '%'''
    || ' OR be.updatedby LIKE '
    || '''%'
    || NVL (p_user_name,'NULL')
    || '%'''
    || ' OR credittransaction.acct_code ='
    || NVL (p_gl_account,-0.197)
    || ' OR debittransaction.acct_code ='
    || NVL (p_gl_account,  -0.197)
    || ' OR credittransaction.profit_ctr_code ='
    || NVL (p_profit_center, -0.197)
    || ' OR debittransaction.profit_ctr_code ='
    || NVL (p_profit_center, -0.197)
    || '  OR le.sap_posting = '
    ||NVL (p_sap_posting,'$')
    || ' OR cmis.cmis_code = '
    ||NVL (p_cmis_nominal, -0.197)
    || ' OR sa.sap_code = '
    || NVL (p_sap_booking_entity, -0.197)
    || '  OR (be.booking_date BETWEEN to_date('''
    || v_booking_date_from
    || ''') AND  to_date('''
    || v_booking_date_to
    || ''')'
    || ' OR co.companyname LIKE '
    || '''%'
    || NVL(p_client_name,'NULL')
    || '%'''
    || ' )'
    || 'ORDER BY  ' || p_sort_by || ',' || p_order;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to tail log files from particular string

    Hello,
    We would like to tail several log files "live" in powershell for particular string. We have tried to use "get-content" command but without luck because everytime as a result we received only results from one file. I assume that it was
    caused by "-wait" parameter. If there is any other way to tail multiple files ?
    Our sample script below
    dir d:\test\*.txt -include *.txt | Get-Content -Wait | select-string "windows" |ForEach-Object {Write-EventLog -LogName Application -Source "Application error" -EntryType information -EventId 999 -Message $_}
    Any help will be appreciated.
    Mac

    Because we want to capture particular string from that files. Application writes some string time to time and when the string appears we want to catch it and send an eventy to application log, after it our Nagios system will raise alarm.
    Mac
    Alright, this is my answer, but I think you won't like it.
    Run this PowerShell code in PowerShell ISE:
    $file1='C:\Temp\TFile1.txt'
    '' > $file1
    $file2='C:\Temp\TFile2.txt'
    '' > $file2
    $special='windowswodniw'
    $exit='exit'
    $sb1={
    gc $using:file1 -Wait | %{
    if($_-eq$using:exit){
    exit
    }else{
    sls $using:special -InputObject $_ -SimpleMatch
    } | %{
    Write-Host '(1) found special string: ' $_
    $sb2={
    gc $using:file2 -Wait | %{
    if($_-eq$using:exit){
    exit
    }else{
    sls $using:special -InputObject $_ -SimpleMatch
    } | %{
    Write-Host '(2) found special string: ' $_
    sajb $sb1
    sajb $sb2
    In this code, $file1 and 2 are the files being waited for.
    As I understood you, you care only for the special string, which is in the variable $special.
    All other variables, will be discarded.
    Also, whenever a string equals to $exit is written to the file, the start job corresponding to that file will be terminated, automatically! (simple, right?)
    In the example above, I use only 2 files (being watched) but you can extend it, easily, to any number (as long as you understand the code).
    If you are following my instructions, at this point you have PowerShell ISE  running, with 2 background jobs,
    waiting for data being inputed to $file1 and 2.
    Now, it's time to send data to $file1 and 2.
    Start PowerShell Console to send data to those files.
    From its command line, execute these commands:
    $file1 = 'C:\Temp\TFile1.txt'
    $file2='C:\Temp\TFile2.txt'
    $exit='exit'
    Notice that $file1 and 2 are exactly the same as those defined in P
    OWERSHELL ISE, and that I've defined the string that will terminate the background jobs.
    Command these commands in PowerShell Console:
    'more' >> $file1
    'less' >> $file1
    'more' >> $file2
    'less' >> $file2
    These commands will provoke no consequences, because these strings will be discarded (they do not contain the special string).
    Now, command these commands in PowerShell Console:
    'windowswodniw' >> $file1
    '1 windowswodniw 2' >> $file1
    'more windowswodniw less' >> $file1
    'windowswodniw' >> $file2
    '1 windowswodniw 2' >> $file2
    'more windowswodniw less' >> $file2
    All these will be caugth by the (my) code, because they contain the special
    string.
    Now, let's finish the background jobs with these commands:
    $exit >> $file1
    $exit >> $file2
    The test I'm explaining, now is DONE, TERMINATED, FINISHED, COMPLETED, ...
    Time to get back to PowerShell ISE.
    You'll notice that it printed out this (right at the beginning):
    Id Name PSJobTypeName State HasMoreData Location Command
    1 Job1 BackgroundJob Running True localhost ...
    2 Job2 BackgroundJob Running True localhost ...
    At PowerShell ISE's console, type this:
              gjb
    And you'll see the ouput like:
    Id Name PSJobTypeName State HasMoreData Location Command
    1 Job1 BackgroundJob Completed True localhost ...
    2 Job2 BackgroundJob Completed True localhost ...
              (  They are completed!  )
    Which means the background jobs are completed.
    See the background jobs' outputs, commanding this:
              gjb | rcjb
    The output, will be something like this:
    (1) found special string: windowswodniw
    (1) found special string: 1 windowswodniw 2
    (1) found special string: more windowswodniw less
    (2) found special string: windowswodniw
    (2) found special string: 1 windowswodniw 2
    (2) found special string: more windowswodniw less
    I hope you are able to understand all this (the rubbishell coders, surely, are not).
    In my examples, the strings caught are written to host's console, but you can change it to do anything you want.
    P.S.: I'm using PowerShell, but I'm pretty sure you can use older PowerShell ( version 3 ). Anything less, is not PowerShell anymore. We can call it RubbiShell.

Maybe you are looking for

  • I updated the photos that share with Apple TV but old photos display during music

    I updated the photo file that shares with Apple TV, and they display correctly when I play the slide show, but when they play slideshow with music playing it's the old photo file. How do I get the new photos to display during music? Thanks

  • Need help merging two users

    I mistakenly have 2 users profiles for my desktop and want to merge them into one. Any advice?

  • Multiple captivate graded simulations in single SCO

    Hi All, I have a situation where I need to create a single SCO Captivate course with multiple Assessment simulations and some assessment questions as well. As the the simulations are heavy, they are broken into multiple files. Each file will have its

  • Desperately need solution for multiple menus

    I'm using Dreamweaver 8 and am using only CSS for layout and controlling all the page elements. One thing I've never found any instruction books it is naming conventions when you're using multiple menus on a page. I give all my menus unique IDs and t

  • Sheering effect on a cube

    hi i m new to java 3d. i don't know all its classes. here is my problem. i want to display in animation sheering effect on a cube. how to do that? can anybody help me thanx ashish