CreateQuery() using LIKE and % wildcard: wrong parameter Name :(

Hi, I cant find an example of an EJB-QL that uses a LIKE statement and wildcards surrounding a parameter.
I`d tried this:
queryString = "SELECT p FROM Prestadores p WHERE p.nombre LIKE '%?1%'"and also:
queryString = "SELECT p FROM Prestadores p WHERE p.nombre LIKE '%:nombre%'"in ths code.
try {
            Query q = em.createQuery("queryString");
            //q.setParameter(1, nombre);
            q.setParameter("nombre", nombre);
            listaPres = q.getResultList();
            cargarBusquedaPrestadores(listaPres);
            return listaBPres;
        } catch (Exception e) {
            System.err.println("PrestadoresBean.getDatosPestadorxNombre(String Nombre) Exception Inesperada");
            System.err.println(e.getMessage());
            return null;
        }but i get:
You have attempted to set a parameter at position 1 which does not exist in this query string SELECT p FROM Prestadores p WHERE p.presNombre LIKE '%?1%'or
You have attempted to set a parameter value using a name of nombre that does not exist in the query string SELECT p FROM Prestadores p WHERE p.presNombre LIKE '%:nombre%'.respectively from the SUN App server log.
any help would be appreciated.
Thanks in advance!

If you use wildcards inside parameters and fix other bugs the problem will disappear.
Try this:
queryString = "SELECT p FROM Prestadores p WHERE p.nombre LIKE ?1";  //quotes aren't necessary
Query q = em.createQuery(queryString); //Of course there can't be "queryString"
q.setParameter(1, "%" + nombre + "%");
listaPres = q.getResultList();

Similar Messages

  • I need to use a reserved word as parameter name in proc called from URL

    Let me preface this post by saying I already know this is terrible to attempt, but it's short term fix only.
    Ok, so I have to create a procedure that will be called by a vendors application via a API that calls our URL to send data over. The terrible part is
    that the API they have uses the parameter FROM=vendor_data A change is on the way so in the future the API won't use FROM as a paramter, so this isn't something I want to do, but it's a workaround.
    So the nastiness is this..., I can create a procedure that'll compile when I enclose FROM in double quotes "FROM" as my input parameter
    but if I try to call my procedure via URL (as their application will do) the procedure isn't working. I searched for someway to do an inline
    replace of the FROM parameter to something else, but no luck. I'm open to all positive comments. I cannot go outside of Oracle
    to do this, so I can't call a shell script and replace. Basically I need some way to use a reserved word as a parameter name, and then be able to call
    that proc from a URL, or someway to change the FROM in the URL inline. Any help on this admittedly whacky situation would be appreciated much.
    I tried ...\myproc?from=text
    ...\myproc?"from"=text
    ...\myproc?'from'=text
    proc is simple test procedure
    create or replace procedure myproc
    ("from" in varchar2 default 0)
    is
    v_from varchar2(30);
    begin
    v_from:="FROM";
    insert into test(col1) values(v_from);
    end;
    **** Update
    I didn't get any more replies but came to a solution that I thought I'd post. It's much better, more elegant and maybe can help others.
    So instead of using FROM as the parameter name I did some research and decided I can use flexible parameters. Basically you end up having
    2 input parameters for a procedure, one holds a parameter name the other holds the parameter value. They get loaded into arrays
    and you access the values with regular name_array(1), value_array(1), etc. ?v=parameter&v2=value
    Once I figued I could use flexible parameter it took me tons of research to find out the actual syntax. I'll post some examples for others
    later, but was suprised with the lack of resources consideriing how "flexible" they are.
    Thanks again for the replies. Cheers.
    Edited by: Mitz on Jul 29, 2009 11:37 PM

    Scott,
    Thanks for the reply. I'm not familiar with the wwv_flow_epg_include_mod_local, however I know that the
    myproc is available via URL. I passed the my procedure name(myproc) on to the dba a while back to make it "accessible" so, I'm assuming that he
    added it to this the www_flow_epg_mod_local (assuming this has something to do with access control).
    If I modify myproc procedure and remove "FROM" as the input variable, and replace with say,
    IN_FROM I can then call the procedure via the URL ./myproc?in_from=test without any problems.
    I'm pretty confident that it's the "FROM" that is the hurdle and not a security or setup issue. The proc is fine to call from the URL until I got the curveball that the only available parameter was FROM. How the URL should be when inputing to that parameter?
    Edited by: Mitz on Jul 25, 2009 7:36 PM
    Edited by: Mitz on Jul 25, 2009 9:16 PM

  • Why CBO don't use function-base index when I use like and bind variable

    Hello
    I have litle problem with function-base index and like with bind variable.
    When I use like with bind variable, the CBO don't use my function-base index.
    For example when I create table and index:
    ALTER SESSION SET NLS_SORT='BINARY_CI';
    ALTER SESSION SET NLS_COMP='LINGUISTIC';
    alter session set nls_language='ENGLISH';
    -- DROP TABLE TEST1;
    CREATE TABLE TEST1 (K1 VARCHAR2(32));
    create index test1_idx on test1(nlssort(K1,'nls_sort=BINARY_CI'));
    INSERT INTO TEST1
    SELECT OBJECT_NAME FROM ALL_OBJECTS;
    COMMIT;
    When I run:
    ALTER SESSION SET NLS_SORT='BINARY_CI';
    ALTER SESSION SET NLS_COMP='LINGUISTIC';
    SELECT * FROM TEST1 WHERE K1 = 'abcd';
    or
    SELECT * FROM TEST1 WHERE K1 LIKE 'abcd%';
    CBO use index.
    PLAN_TABLE_OUTPUT
    SQL_ID 4vrmp7cshbvqy, child number 1
    SELECT * FROM TEST1 WHERE K1 LIKE 'abcd%'
    Plan hash value: 1885706448
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 1 (100)| |
    | 1 | TABLE ACCESS BY INDEX ROWID| TEST1 | 2 | 98 | 1 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | TEST1_IDX | 2 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("TEST1"."SYS_NC00002$">=HEXTORAW('6162636400') AND
    "TEST1"."SYS_NC00002$"<HEXTORAW('6162636500') )
    but when I run
    SELECT * FROM TEST1 WHERE K1 LIKE :1;
    CBO don't use index
    PLAN_TABLE_OUTPUT
    SQL_ID 9t461s1669gru, child number 0
    SELECT * FROM TEST1 WHERE K1 LIKE :1
    Plan hash value: 4122059633
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 89 (100)| |
    |* 1 | TABLE ACCESS FULL| TEST1 | 2 | 48 | 89 (3)| 00:00:02 |
    Predicate Information (identified by operation id):
    1 - filter("K1" LIKE :1)
    What should I change to force CBO to use index.
    I don't wont use index hint in query.
    My oracle version:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE     11.2.0.1.0     Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    OK. But why if I create normal index (create index test1_idx on test1(K1)) and return to default nls settings this same query use index.
    PLAN_TABLE_OUTPUT
    SQL_ID 9t461s1669gru, child number 0
    SELECT * FROM TEST1 WHERE K1 LIKE :1
    Plan hash value: 598212486
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 1 (100)| |
    |* 1 | INDEX RANGE SCAN| TEST1_IDX | 1 | 18 | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - access("K1" LIKE :1)
    filter("K1" LIKE :1)
    Note
    - dynamic sampling used for this statement (level=2)
    when index is function-base (create index test1_idx on test1(nlssort(K1,'nls_sort=BINARY_CI')))
    PLAN_TABLE_OUTPUT
    SQL_ID 9t461s1669gru, child number 1
    SELECT * FROM TEST1 WHERE K1 LIKE :1
    Plan hash value: 4122059633
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 89 (100)| |
    |* 1 | TABLE ACCESS FULL| TEST1 | 3 | 54 | 89 (3)| 00:00:02 |
    Predicate Information (identified by operation id):
    1 - filter("K1" LIKE :1)
    Note
    - dynamic sampling used for this statement (level=2)
    when I create index with upper function "index test1_idx on test1(upper(K1))" the query use index
    SELECT * FROM TEST1 WHERE upper(K1) LIKE :1
    Plan hash value: 1885706448
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 1 (100)| |
    | 1 | TABLE ACCESS BY INDEX ROWID| TEST1 | 4481 | 157K| 1 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | TEST1_IDX | 806 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("TEST1"."SYS_NC00002$" LIKE :1)
    filter("TEST1"."SYS_NC00002$" LIKE :1)
    Note
    - dynamic sampling used for this statement (level=2)

  • Using LIKE and IN at the same time

    Is it possible to use both LIKE and IN at the same time such as:
    select first_name from emp where user_id LIKE IN('1%','2%')
    Thanks in advance
    --Joshua                                                                                                                                                                                                                                                                                                                                   

    Or consider the IN - parameters as a string. Then you can do the following:
    SQL> SELECT ename
      FROM emp
    WHERE EXISTS (
              SELECT NULL
                FROM (SELECT RTRIM (SUBSTR (nums,
                                            INSTR (nums, ',', 1, iter.pos) + 1,
                                              INSTR (nums, ',', 1, iter.pos + 1)
                                            - INSTR (nums, ',', 1, iter.pos)
                                   ) nums
                        FROM (SELECT ',' || 'SCO,BLA,CLA' || ',' nums
                                FROM DUAL) csv,
                             (SELECT ROWNUM pos
                                FROM all_objects
                               WHERE ROWNUM < 50) iter
                       WHERE iter.pos <=
                                  (  (  LENGTH (csv.nums)
                                      - LENGTH (REPLACE (csv.nums, ','))
                                   / LENGTH (',')
                                - 1)
               WHERE ename LIKE '%' || nums || '%')
    ENAME    
    BLAKE    
    CLARK    
    SCOTT    
    3 rows selected.

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

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

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

  • Passing parameters to a report via URL : using 'like' and '%' ?

    Hi,
    I have created a report by sql query, and I'm calling it by the means of a URL with a '.show' extension, and then I can specify as many parameters as I wish.
    In my case I use a string as a bind variable ans I would like to pass it as a condition to render the report.
    Thus I tried to use that :
    "[call_url].show?p_arg_names=_[...]_cond&p_arg_values=like&p_arg_names=_[...]_[bind_variable]&p_arg_values=[xxx]"
    To be able to use it I have to add a '%' at the end of it, so that I get all the rows beginning with the letters I specified, ie 'xxx' could be 'A%', so that I get all the rows beginning with an A.
    The problem is that this character is not effective. I succeeded with the '_' character, but it brings a limitation to the length of the field, and it's not what I want. I also tried this : "...p_arg_values=A'&'%'", but I didn't manage to make it work !
    Any idea appreciated !
    Regards,
    gael.

    Hi Gael,
    your URL is made up of :
    [ProcedureName]?[parameter1]=[value1]&[parameter2]=[value2]
    creating URLs like this can have problems especially with spaces and punctuation.
    the answer is a FORM
    the following will create a hidden form :
    FORM ACTION="[ProcedureName]" METHOD="POST" name="F1"
    INPUT type="HIDDEN" name="[parameter1]" value="[value1]"
    INPUT type="HIDDEN" name="[parameter2]" value="[value2]"
    /FORM
    you can set the values in the form using:
    document.F1.[parameter1].value="abc123%%&&$$!";
    document.F1.submit();
    will submit the form and the PL/SQL procedure should receive the text as it was contained in the form.
    the only characters that can now cause problems are :
    " as it delimits the field.
    ' as it may cause problems in PL/SQL.
    \ as it is a special character.
    Regards Michael

  • Unable to load multiple files to Essbase using MaxL and wildcards

    I have multiple data files to load:
    Files:
    Filename.txt
    Filename_1.txt
    Filename_2.txt
    According to the following link, Essbase is able to load multiple files to BSO databases via MaxL by using wildcards:
    http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/frameset.htm?launch.html
    However, when I try to run the following I receive the following error:
    MaxL:
    import database MyApp.DB data from server text data_file "../../MyApp/Filename*.txt" using server rules_file "L_MyRule" on error append to "\\Server\Folder\L_MyRule.err";
    Error:
    ERROR - 1003027 - Unable to open file [DB01/oracleEPM/user_projects/epmsystem2/EssbaseServer/essbaseserver1/app/MyApp/DB/../../Filename*.txt].
    ERROR - 1241101 - Unexpected Essbase error 1003027.
    I can run the following fine without any problem, but this only deals with the first of several files, and I’d rather not hard-code multiple files since the number might vary in the future:
    MaxL:
    import database MyApp.DB data from server text data_file "../../MyApp/Filename.txt" using server rules_file "L_MyRule" on error append to "\\Server\Folder\L_MyRule.err";
    Any ideas? And how about ASO databases?

    JamesD wrote:
    According to the following link, Essbase is able to load multiple files to BSO databases via MaxL by using wildcards:
    http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/frameset.htm?launch.html
    That is the tech ref for 11.1.2.2, are you on 11.1.2.2?
    Import Data
    11.1.2.2 - http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/frameset.htm?maxl_imp_data.html
    11.1.2.1 - http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref_1112100/frameset.htm?maxl_imp_data.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Send email (c#) using ews and set custom display name (from)

    How to connect to exchange service via exchange web services send a mail and the display name is custom ?
    With this code, just connect to exchange server (ews) and send a mail.
    How to change my code ?
    private void t() {
    const string subjectBody = "test email ";
    const string username = "username";
    const string password = "password";
    const string domain = "domain";
    const string ewsURL = "http://exchangesrv/ews/exchange.asmx";
    unews.ExchangeServiceBinding esb = new unews.ExchangeServiceBinding();
    esb.Credentials = new System.Net.NetworkCredential( username, password, domain );
    esb.Url = ewsURL;
    unews.CreateItemType newItem = new unews.CreateItemType();
    newItem.MessageDisposition = unews.MessageDispositionType.SendAndSaveCopy;
    newItem.MessageDispositionSpecified = true;
    unews.MessageType msg = new unews.MessageType();
    msg.Subject = subjectBody;
    msg.Body = new unews.BodyType();
    msg.Body.BodyType1 = unews.BodyTypeType.Text;
    msg.Body.Value = subjectBody;
    msg.ToRecipients = new unews.EmailAddressType[1];
    msg.ToRecipients[0] = new unews.EmailAddressType();
    msg.ToRecipients[0].EmailAddress = "[email protected]";
    newItem.Items = new unews.NonEmptyArrayOfAllItemsType();
    newItem.Items.Items = new unews.ItemType[1];
    newItem.Items.Items[0] = msg;
    try {
    unews.CreateItemResponseType createItemResponse = esb.CreateItem( newItem );
    if (createItemResponse.ResponseMessages.Items[0].ResponseClass == unews.ResponseClassType.Error) {
    throw new Exception( createItemResponse.ResponseMessages.Items[0].MessageText );
    else {
    Console.WriteLine( "Item was created" );
    catch (Exception ex) {
    Console.WriteLine( ex.ToString() );
    With this code, can connect to a exchange server (smtp) and send a mail, with a custom display name.
    System.Net.Mail.SmtpClient smtpc = new System.Net.Mail.SmtpClient( "exchangesrv" );
    System.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage( "CustomDisplayName <[email protected]>", "[email protected]", "test email", "test email" );
    smtpc.Credentials = new System.Net.NetworkCredential( "username", "password", "domain" );
    smtpc.Send( mm );

    That won't work the way you want it in EWS, like when you send via Outlook or OWA when you send a messages via EWS it's submitted via the Exchange store so the Sender Address will be resolved back to the default Reply address for whatever account your trying
    to send as. If you need some sort of custom display name I would suggest you stick to SMTP or possible create a Transport Agent that would rewrite the address before its sent externally.
    Cheers
    Glen

  • SQL Statement using LIKE and Subquery?

    Hi,
    I have two tables, one table is called "Restricted_Words", the other table is called "Content" .   I have a field called "short_desc" in the Content table and a field called "word" in the Restricted Words
    table.
    I want to write a query that will compare all the words in the restricted words table against the short_desc field in the content table and just return all the records in the content table that contain 1 or more of these words.
    I started with this:
    SELECT short_desc
    FROM Content
    WHERE short_desc LIKE ( SELECT word FROM Restricted_Words )
    I know the above isn't valid and won't work, but that's what I'm trying to do.
    Any help appreciated...

    Sorry cannot test it right now...
    SELECT short_desc
    FROM Content
    WHERE short_desc LIKE ( SELECT word FROM Restricted_Words where
    word  like '%'+short_desc
    +'%' )
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Specify Custom Parameter Names

    Hi,
    I could successfully publish and test dababase procedures as web services.
    But WSDL is generated using "param0" and "param1" for parameter names.
    Is there any way I can specify meaningful names for parameters?
    When I invoke service, it always expects parameters as "param0", "param1"
    I would like to specify "Name" for param0 and "Code" for param1 etc.,
    Can any one let me know if it is possible?
    Thanks,
    NM

    Java introspection uses reflection and this information wasn't accessible in previous versions of the JVM...

  • Trouble with Search using MSSQLFT and Like

    I am using SPServices to run a search on a scope I have defined. When the page first loads, I run a query that retrieves all the items from the search scope using
    var queryExtra = '';
    var q = "SELECT Title,Path,Description,Write,Rank,Size,SiteTitle FROM SCOPE() WHERE ";
    q += queryExtra + " (\"SCOPE\"='LC Engagement Sites') ORDER BY Rank";
    var queryText = makeQuery(q);
    $().SPServices({
    operation: "Query",
    queryXml: queryText,
    completefunc: function(xData, Status) {
    The function makeQuery turns the sql into the required xml.  When run, this works.
    I also have a textbox that allows the user to show only ones where the title contains some text.  I have tried using like and contains to restrict the search but both return no results.
    var queryExtra = getAll || title == "" ? "" : " Title like '%" + title + "%' AND ";
    var queryExtra = getAll || title == "" ? "" : " CONTAINS(title,'" + title + "') and ";
    The query ends up looking like this
    SELECT Title,Path,Description,Write,Rank,Size,SiteTitle FROM SCOPE() WHERE  CONTAINS(title,'taiwan') and  ("SCOPE"='LC Engagement Sites') ORDER BY Rank
    or 
    SELECT Title,Path,Description,Write,Rank,Size,SiteTitle FROM SCOPE() WHERE  title LIKE '%taiwan%' and  ("SCOPE"='LC Engagement Sites') ORDER BY Rank
    and the query packet looks like this
    <QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'>
    <Query>
    <Context>
    <QueryText language='en-US' type='MSSQLFT'><!
    [CDATA[SELECT Title, Path, Description, Write, Rank, Size, SiteTitle
    FROM SCOPE()
    WHERE CONTAINS(title,'taiwan') and
    ("SCOPE"='LC Engagement Sites') ORDER BY Rank
    ]]>
    </QueryText>
    </Context>
    <IncludeSpecialTermResults>
    true
    </IncludeSpecialTermResults>
    <Range>
    <Count>1000</Count>
    </Range>
    </Query>
    </QueryPacket>
    Is there something I'm doing wrong? I've seen many examples that show that this is possible but so far no luck.

    Hi,
    The following code for your reference:
    <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <meta name="WebPartPageExpansion" content="full" />
    <script language="javascript" src="jquery-1.8.2.min.js"></script>
    <script language="javascript" src="jquery.SPServices-0.7.2.min.js"></script>
    <script language="javascript">
    (function () {
    function querySearchService(scopeName, keywordToSearch, maxItemCount) {
    keywordToSearch = keywordToSearch.trim().replace(/\s+/g, "+");
    var queryText = "<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'>"
    queryText += "<Query>"
    queryText += "<Range><StartAt>1</StartAt><Count>" + maxItemCount + "</Count></Range>"
    queryText += "<Context>"
    queryText += "<QueryText language='en-US' type='MSSQLFT'>"
    queryText += "SELECT Title,Path,Description,Write,Rank,Size,SiteTitle FROM scope() WHERE CONTAINS ('" + keywordToSearch + "') AND \"scope\"='" + scopeName + "' AND ISDOCUMENT=true ORDER BY Rank DESC"
    queryText += "</QueryText>"
    queryText += "</Context>"
    queryText += "</Query>"
    queryText += "<EnableStemming>True</EnableStemming>"
    queryText += "<TrimDuplicates>True</TrimDuplicates>"
    queryText += "</QueryPacket>";
    //alert(queryText);
    $().SPServices({
    operation: "Query",
    queryXml: queryText,
    completefunc: function (xData, Status) {
    $(xData.responseXML).find("QueryResult").each(function () {
    var array = new Array();
    alert($(this).text());
    var result = $.parseXML($(this).text());
    var matches = result.find("Document");
    if (matches.length == 0) {
    alert("Nothing Found!");
    return;
    $("#dynamic-search-results").empty();
    matches.each(function () {
    url = $("Properties>Property:nth-child(2)>Value", $(this)).text();
    title = $("Properties>Property:nth-child(1)>Value", $(this)).text();
    $("#resultDiv").append($("<p></p>").append($("<a></a>").prop("href", url).text(title)));
    $(document).ready(function () {
    querySearchService("LC Engagement Sites", "SharePoint", 10);
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled 2</title>
    </head>
    <body>
    <div id="resultDiv"></div>
    </body>
    </html>
    More information is here:
    http://jeffywang.blogspot.com/2014/01/utilizing-spservices-to-call-sharepoint.html
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected].

  • How tio use like operator in textitem to get the name

    Oracle forms6i
    Hai All
    I have created an form to create an hierarchy list. I that I had an Text_item how can i use like operator to get the name to select. which trigger i need to use. when i select the name i need to get his employee code and other details
    Thanks In Advance
    Srikkanth.M

    A is the head of Dept 10 and three person are under A namelyHow will you know that B, C and D are under A is there any parent child relationship between Leader and Employee code? If yes, Then you can create the relationship between blocks no need to set where_clause programatically. So, relationship can be like...
    leader_block.emp_code = emp_block.leader_code
    AND leader_blokc.dep_code = emp_block.dep_codeSo, when you will query data in LEADER block it will show employees which are under LEADER which you queried in LEADER block.
    Or if there is no relationship then how will you know that which employee under which leader?
    b 002 10 1
    c 003 10 1
    d 004 10 1
    When i enter the name of head corresponding other members in the department will need to display in the
    Tabular format Or if you want to query the records only for department relation. Then as you said you create two blocks then create create the relationship using dep_code between those blocks.
    like...
    leader.dep_code = emp_block.dep_code-Ammad

  • Like and type...

    Kindly let me know when I have to use LIKE and when I have to use TYPE Exactly.
    What is the difference b/w both..
    Akshihta.

    hi,
    <b>TYPE <type></b>
    to refer to any data type <type> that is already known at this point in the program. It can be used in any of the statements listed below. The expression <obj> is either the name of the data object or the expression.
    <b>ABAP Statements with TYPE References</b>
    Definition of local program types using
    TYPES <t> TYPE <type>.
    The new data type <t> has the same type as <type>.
    Declaration of data objects using
    DATA <f> TYPE <type>.
    CLASS-DATA <f> TYPE <type>.
    CONSTANTS <f> TYPE <type>.
    STATICS <f> TYPE <type>.
    PARAMETERS <f> TYPE <type>.
    The data object <f> has a data type corresponding to the type <type>.
    Dynamic creation of data objects using
    CREATE DATA <dref> TYPE <type>.
    Specification of the type of a formal parameter in a subroutine using
    FORM <sub> ... USING|CHANGING <p> TYPE <type> ...
    The technical attributes of the formal parameter <p> are inherited from those of the declared data type <type>. You can then only pass actual parameters that have these attributes.
    Specification of the type of a formal parameter in a method using
    METHODS <meth> ... IMPORTING|EXPORTING|CHANGING <p> TYPE <type> ...
    The technical attributes of the formal parameter <p> are inherited from those of the declared data type <type>. You can then only pass actual parameters that have these attributes.
    Specification of the type of a field symbol
    FIELD-SYMBOLS <fs> TYPE <type>.
    You use the LIKE addition, similarly to the TYP E addition , in various ABAP statements for defining data types and specifying the types of interface parameters or field symbols. The addition
    <b>LIKE <obj>.</b>
    ABAP Statements with LIKE References
    Definition of local types in a program using
    TYPES <t> LIKE <obj>.
    The new data type <t> inherits all of the technical attributes of the data object <obj>.
    Declaration of data objects using
    DATA <f> LIKE <obj>.
    CLASS-DATA <f> LIKE <obj>.
    CONSTANTS <f> LIKE <obj>.
    STATICS <f> LIKE <obj>.
    PARAMETERS <f> LIKE <obj>.
    The data object <f> inherits all of the technical attributes of the data object <obj>.
    Dynamic creation of data objects using
    CREATE DATA <dref> LIKE <obj>.
    Specification of the type of a formal parameter in a subroutine using
    FORM <sub> ... USING|CHANGING <p> LIKE <obj> ...
    The technical attributes of the formal parameter <p> are inherited from those of the declared data object <obj>. You can then only pass actual parameters that have these attributes.
    Specification of the type of a formal parameter in a method using
    METHODS <meth> ... IMPORTING|EXPORTING|CHANGING <p> LIKE <obj> ...
    The technical attributes of the formal parameter <p> are inherited from those of the declared data type <type>. You can then only pass actual parameters that have these attributes.
    Specification of the type of a field symbol
    FIELD-SYMBOLS <fs> LIKE <obj>.
    The technical attributes of the field symbol <FS> are inherited from those of the declared data object <obj>. You can then only assign data objects that have these attributes.
    <b>You should also avoid using the LIKE addition in other ABAP programs except to refer to data objects</b>
    regards,
    Ashokreddy.

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

  • Scanning using C410a and iMac Yosemite 10.10 OS

    I am unable to scan more than a single page.  I have tried the Mac scanning software as well as two HP methods - connecting to the printer's webpage and double clicking the printer icon.  I am able to scan a single page, but have some difficulty saving the image.  I am cannot find a way to scan a multi page document -  there appears to be no multi page prompt or option.  Anyone have any thoughts?

    Hello @doughboy914,
    Welcome to the HP Support Forums!
    I understand that you're experiencing issues when attempting to scan from your HP Photosmart Premium Fax e-All-in-One C410a Printer to your Mac OS X 10.10 computer. I would like to assist you today with resolving this issue. Now, due to the age of your printer HP does not have a downloadable Full Feature Software and Driver available for this model of printer on the Mac OS X 10.10 computer. Therefore, you are relying solely on an Apple Update driver in order to use the functions of your machine. Because you are only able to scan single page documents only there is a chance that the Apple Update driver failed to load successfully for your machine. To correct any software or driver conflicts that may be occuring, can I please have you follow the steps below.
    Step 1: Uninstall Printer:
    It is important for troubleshooting purposes that we remove any existing instances of your printer from your computer so we have a nice clean slate to work with. Please click here to access the proper steps on how to remove your device. Once the support page opens please select the dropdown for 'Mac OS X v10.6, OS X v10.7, OS X v10.8, and OS X v10.9' as the steps are the same for your Mac OS X 10.10 computer. Next, please follow the steps under Method one, and Method two to reset your print system and uninstall your device. Once your HP Photosmart has been successfully removed please proceed to the next step.
    Step 2: Verify and Repair your Disk Permissions on the Mac:
    Open Macintosh HD and go to Applications
    Go to the Utilities Folder
    Open the Disk Utility
    Select the Hard Drive volume you are using (usually on the left)
    Select Verify Disk Permissions
    Once that process is done, select Repair Disk Permissions
     Step 3: Manually Load Driver:
    Please click here to manually download and install the HP Printer Drivers v3.0 package for your Apple computer. Once the driver package has been downloaded, follow any onscreen instructions to install the package.
    Once the driver package has been loaded successfully, please proceed to the next step.
    Step 4: Check for Apple Updates:
    Go to Apple
    Select System Preferences
    Select Software Update
    Click Update Now
    Install your available updates
    Restart your computer
    Step 5: Add the Printer:
    1. Click the Apple menu, and then click System Preferences.
    2. Click Print & Scan, and then check if the name of your printer displays in the Printers list.
    3. If your printer is already listed, remove and re-add the printer to confirm communication with the Mac. Click the name of your printer, click the minus sign (), and then delete the printer
    4. Click the plus sign (), click Add Printer or Scanner, click the name of your printer
    5. Click the Use or Print Using box, and then select the name of your printer in the pop-up menu. Ensure that you have the HP Photosmart driver selected and not the AirPrint.
    6. Click Add to add the printer to the list.
    - Source
    Now that your printer is installed, please test printing and scanning to confirm that everything is now functioning properly. For instructions on the three supported methods of scanning in Mac OS X 10.10 please click here. Once the support document opens please follow the steps under 'Step 3: Scan the Document of Photo' and then choose the method you want to scan through.
    Please respond to this post with the result of your troubleshooting. Best of luck!
    X-23
    I work on behalf of HP
    Please click "Accept as Solution" if you feel my post solved your issue, it will help others find the solution.
    Click the "Kudos, Thumbs Up" on the right to say "Thanks" for helping!

Maybe you are looking for

  • Indian Localization cumulative patchset

    Need indian localization cumulative patchset (patch number) for 12.1.3?

  • [SOLVED] Did something break 'find'?

    I don't use the find command a whole lot, so (a.) I could just be missing something, and (b.) I have no idea exactly when this started. However, the find command seems to be totally broken on my system even after a reboot. Even simple things like 'fi

  • Can't select item in Pages

    I've been working with a company that uses its own templates for any correspondence. But I have found that the template looks a bit different when I open it in Pages. As you could guess by now, I am unable to click on one particular image or select i

  • Mac address report

    Hi, Can I with Ciscoworks, make a report like: "switchport that have more than x MAC adresses" or "switchport without voice vlan that have more than x MAC adresses " The purpose is to track rogue non-Cisco hubs and switches on my lan/man. I can do it

  • " Product / Software Component " Concept

    Hello Everyone Can you pls. explain the concept of <b>Product & S/W component</b>. I mean the relationship between the two. How they are important while transportation of the objects. Best Regards Lalit