How to write XSJS Select Query with input parameters

Hello Experts,
I am creating a xsjs file and in that file I am trying to write a Select Query based on a Calculation View
I have tried it the following way:
var query = 'SELECT TOP 100 \"Name\", \"Address\", \"City\", \"Country\" FROM \"_SYS_BIC\".\"Test.HL/AddressView\"'
    + 'WITH PARAMETERS(\'PLACEHOLDER\' = (\'$$P_Name$$\', \' Akhil \'),'
  + '\'PLACEHOLDER\' = (\'$$P_City$$\', \' Lucknow \'))';
But it gives me the "Mixed spaces and tabs error".
How should I write XSJS Select Query with input parameters?
Regards,
Rohit

>But it gives me the "Mixed spaces and tabs error".
Mixed spaces and tabs has nothing to do with the syntax of the statement. You used both spaces and the tab in the content - which JSLint doesn't like.  Remove the beginning spaces of each line and use only one or the other.
The actual syntax of your statement doesn't look right.  The problem is that you are escaping the \ when you don't need to if you are using ' instead of " for your string.  You escape with \" in the first line but then escape with \' in the 2nd and 3rd line.  That is going to cause serious parsing problems with the command.

Similar Messages

  • How to write the select query with complex where condition

    Hi all,
    Can u help me in writing  following select query.
    select * from zu1cd_corr where time_stamp between firstday and lastday .
    In the above query time_stamp contains the date and time.
    where as firstday and lastday contains the dates.
    I need to compare the date in the time_stamp with the firstday and lastday.
    But time_stamp contains the time also and it is char of 14 characters length.

    Hi,
    If that is the case u can do as advait specified....
    if the firstday and secondday are select-options then declare two more variables having 14 character length and then concatenate '000000' to firstday variable and '240000' to last day variable and then write ur query.
    CLEAR : lv_firstday,
                 lv_lastday.
    concatenate firstday '000000' to lv_firstday.
    concatenate lastday '240000' to lv_lastday.
    ranges : r_Date for zu1cd_corr-time_stamp.
    r_date-sign = 'I'.
    r_date-option = 'BT'.
    r_Date-low = lv_firstday.
    r_Date-high = lv_lastday.
    append r_date.
    select * from zu1cd_corr  into table it_zu1cd_corr where time_stamp in  r_Date.
    I hope it helps.
    Regards,
    Nagaraj

  • How to write EJB-QL query with IN notation and list values EJB3.0?

    hi,
    I would like to write an EJB-QL query where the query would return the objects whose name equals to one of the names in the list.
    SELECT DISTINCT OBJECT(feature) FROM MAPSHEET_LOCK feature WHERE feature.name IN ?1
    For ?1 I would like to pass in a list. How can I write this query?
    Thanks

    List<String> names;
    StringBuilder sb = new StringBuilder("SELECT DISTINCT OBJECT(feature) FROM MAPSHEET_LOCK feature WHERE feature.name IN (");
    String separator = "";
    for (String name : names) {
      sb.append(separator);
       sb.append("'");
       sb.append(name);
       sb.append("'");
       separator = ", ";
    sb.append(")");
    String ejbql = sb.toString();
    // Code for execute query
    ....Message was edited by:
    Rulas

  • How to write the below query with parameter and is null

    Hi, I need to retrive the data if the parameter is passed on the field, else retrive all records whose field is null
    Example
    CREATE TABLE DEPT
           (DEPTNO NUMBER(2),
            DNAME VARCHAR2(14),
            LOC VARCHAR2(13) );
    INSERT INTO DEPT VALUES (10, 'ACCOUNTING', 'NEW YORK');
    INSERT INTO DEPT VALUES (20, 'RESEARCH',   'DALLAS');
    insert into dept values (30, 'SALES',      'CHICAGO');
    INSERT INTO DEPT VALUES (40, 'OPERATIONS', 'BOSTON');
    alter table dept add(object_id number);
    insert into dept values (50, 'OPERATIONS', 'BOSTON',1);
    insert into dept values (60, 'OPERATIONS', 'BOSTON',1);
    INSERT INTO DEPT VALUES (70, 'OPERATIONS', 'BOSTON',2);
    select * from dept where object_id =:p_object_id
    If i pass the object_id as 1 , it shloud retrive the values of dept with object_id 1, but if i dont pass the object_id, it should retrive all the records whose object_id is null
    IF 1 is passed, as object id , it should retrive, 50, 60, if 1 is not passed as object_id it should retive 10,20,30,40
    It works fine for me seperately as,
    select * from dept where object_id =:p_object_id -- 1
    select * from dept where object_id is null;
    Is this possible to do in single query.
    Thanks

    SELECT *
    FROM dept
    WHERE object_id = :p_object_id
    OR (object_id is null and :p_object_id is null)
    is one approach.  It's a bit verbose but the meaning is clear.  If you can identify a value that would never appear in the data (-1 for example)
    WHERE nvl( object_id, -1 ) = nvl(p_object_id, -1 );
    Justin

  • SQL QUERY How to write a sql query with a complex where clause.

    I would like to get a list of all my invoices from the past year plus any open invoices that are more than a year old.
    I don't want any overlapping rows.
    Debra has a question

    Debra,
    Sorry but you have posted to a forum that deals exclusively with questions/issues about customizing and programming Microsoft Project, a planning and scheduling application. I suggest you delete this post and find a more appropriate forum.
    John

  • Query with input parameters (as int)

    Hello all,
    I am trying to run the following query but i keep getting the following message:
    Conversion failed when converting the varchar value '[%0]' to data type int.
    in SQL 2005.
    I understand what the error is saying i just cant find a way to pass a parameter as a int?
    Any help would be appreciated.
    declare @PONum int
    declare @DocEntry int
    declare @POLine int
    declare @WONum int
    declare @WOLine int
    SELECT @PONum = T0.DocNum FROM OPOR T0 WHERE T0.DocNum = '[%0]'
    SELECT @DocEntry = T1.DocEntry FROM OPOR T1 WHERE DocNum  =  @PONum
    SELECT @POLine = T2.LineNum FROM POR1 T2 WHERE T2.DocEntry = @DocEntry and T2.LineNum  = '[%1]'
    select @WONum = T3.U_WO from [@CDIJCHDR] T3 WHERE T3.U_WO = '[%2]'
    select @WOLine = T4.U_Line from [@CDIJCHDR] T4 WHERE T4.U_WO = @WONum and T4.U_Line ='[%3]'
    Update [@CDIPOWO]
    set   [@CDIPOWO].U_WO = @WONum,
           [@CDIPOWO].U_WOLine = @WOLine
    where [@CDIPOWO].U_PO = @PONum
      and [@CDIPOWO].U_POLine = @POLine
      and [@CDIPOWO].U_QtyRecvd = 0
    and @WONum > 0
    update [@CDIJCEST]
    set [@CDIJCEST].U_WO = @WONum,
         [@CDIJCEST].U_Line = @WOLine
    from [@CDIJCEST]
    where [@CDIJCEST].U_3DREF = 'P'
       and [@CDIJCEST].U_3DDocNum = @PONum
       and [@CDIJCEST].U_3DDocLn = @POLine
       and @WONum > 0
    -Chuck

    Hi Charles,
    Where are you running this query (ie SBO or SQL Management Studio)? This is exactly the error you will get if you try running this query in SQL Management Studio, outside of SBO. This is because [%0] is SBO syntax and is not recognised as a parameter in SQL.
    Kind Regards,
    Owen

  • How to write a SQL query in SAP B1 2007 B with input parameters?

    How to write a SQL query in SAP B1 2007 B with input parameters, on execution of which will ask for some input value from the user and the values will be selected from a list such as item list?

    The syntax like
    SELECT * FROM OITM T0 WHERE T0.ItemCode = '[%0\]'
    Thanks,
    Gordon

  • How to re-write this big SELECT Query with INNER JOINs?

    Hi Experts
    I have a performance killer SELECT query with an inner join of 3 tables u2013 VBAP, VBAK and VBEP together, which populates records to an internal table INT_COLL_ORD. Based on these records selected, in another SELECT query, records are fetched from VBUK table to the internal table INT_VBUK.
    SELECT A~VBELN A~POSNR A~MATNR A~KWMENG A~KBMENG A~ERDAT A~ERZET A~PSTYV D~AUART E~ETTYP E~EDATU
    INTO TABLE INT_TAB_RES
    FROM VBAP AS A INNER JOIN VBAK AS D
    ON D~VBELN EQ A~VBELN AND D~MANDT EQ A~MANDT
    INNER JOIN VBEP AS E
    ON E~VBELN EQ A~VBELN AND E~POSNR EQ A~POSNR AND E~MANDT EQ A~MANDT
    WHERE  A~VBELN IN s_VBELN AND
           D~auart in s_auart AND
           D~vkorg in s_vkorg AND
           D~vbtyp eq 'C'     AND
           ( ( matnr LIKE c_prefix_sp AND zz_msposnr NE 0 AND kbmeng EQ 0 )
           OR ( matnr LIKE c_prefix_fp AND kwmeng NE A~kbmeng ) ) AND
           A~ABGRU EQ SPACE AND
           A~MTVFP IN R_MTVFP AND
           A~PRCTR IN R_PRCT AND
           E~ETENR EQ '1'.
    SORT INT_COLL_ORD BY VBELN POSNR ETTYP.
    DELETE ADJACENT DUPLICATES FROM INT_TAB_RES COMPARING VBELN POSNR.
    CHECK NOT INT_TAB_RES [] IS INITIAL.
    SELECT VBELN UVALL CMGST INTO TABLE INT_VBUK
    FROM VBUK FOR ALL ENTRIES IN INT_TAB_RES
    WHERE VBELN = INT_TAB_RES-VBELN AND UVALL NE 'A'.
    Now, the requirement is:
    I want to split this query. Like, first join VBAK and VBUK first. With this selection, go to the inner join of VBAP and VBEP (on key VBELN) to get the results. How can I re-write this Query?
    Please help.
    Thx n Rgds

    Hi Nagraj
    As of your suggestion, I have re-written the query as below:
    * Declarations
    TYPES: BEGIN OF TYP_COLL_ORD,
            VBELN  LIKE VBAK-VBELN,
            POSNR  LIKE VBUP-POSNR,
            MATNR  LIKE VBAP-MATNR,
            KWMENG LIKE VBAP-KWMENG,
            KBMENG LIKE VBAP-KBMENG,
            ERDAT  LIKE VBAK-ERDAT,
            ERZET  LIKE VBAK-ERZET,
            PSTYV  LIKE VBAP-PSTYV,
            AUART  LIKE VBAK-AUART, u201Calready exists in type
            ETTYP  LIKE VBEP-ETTYP,
            EDATU  LIKE VBEP-EDATU.
    TYPES: END OF TYP_COLL_ORD.
    DATA: INT_COLL_ORD TYPE TABLE OF TYP_COLL_ORD WITH HEADER LINE.
    TYPES: BEGIN OF TYP_VBUK,
            AUART  LIKE VBAK-AUART, u201Chave added this field
            VBELN  LIKE VBUK-VBELN,
            UVALL  LIKE VBUK-UVALL,
            CMGST  LIKE VBUK-CMGST.
    TYPES: END OF TYP_VBUK.
    DATA: INT_VBUK TYPE TABLE OF TYP_VBUK WITH HEADER LINE.
    *QUERY#1 u2013 for VBAK & VBUK Join
    SELECT A~AUART B~VBELN B~UVALL B~CMGST
    INTO TABLE INT_VBUK
    FROM VBAK AS A INNER JOIN VBUK AS B
    ON A~VBELN EQ B~VBELN
    WHERE A~VBELN IN s_VBELN AND
    A~auart in s_auart AND
    A~vkorg in s_vkorg AND
    A~vbtyp eq 'C' AND
    B~UVALL NE 'A'.
    IF NOT INT_VBUK[] IS INITIAL.
    SORT INT_VBUK BY VBELN.
    DELETE ADJACENT DUPLICATES FROM INT_VBUK COMPARING VBELN.
    *QUERY#2 u2013 for VBAP & VBEP Join
    SELECT A~VBELN A~POSNR A~MATNR A~KWMENG A~KBMENG A~ERDAT A~ERZET A~PSTYV B~ETTYP B~EDATU
    INTO TABLE INT_COLL_ORD
    FROM VBAP AS A INNER JOIN VBEP AS B
    ON B~VBELN EQ A~VBELN AND B~POSNR EQ A~POSNR AND B~MANDT EQ A~MANDT
    FOR ALL ENTRIES IN INT_VBUK
    WHERE A~VBELN = INT_VBUK-VBELN AND
    ( ( matnr LIKE c_prefix_sp AND zz_msposnr NE 0 AND kbmeng EQ 0 )
    OR ( matnr LIKE c_prefix_fp AND kwmeng NE A~kbmeng ) ) AND
    A~ABGRU EQ SPACE AND
    A~MTVFP IN R_MTVFP AND
    A~PRCTR IN R_PRCT AND
    B~ETENR EQ '1'.
    ENDIF.
      SORT INT_COLL_ORD BY  VBELN POSNR ETTYP.
      DELETE ADJACENT DUPLICATES FROM INT_COLL_ORD
        COMPARING VBELN POSNR.
      CHECK NOT INT_COLL_ORD[] IS INITIAL.
      LOOP AT INT_COLL_ORD.
        CLEAR: L_MTART,L_ATPPR,L_ETTYP.
        IF L_PREVIOUS_ETTYP NE INT_COLL_ORD-ETTYP OR
          L_PREVIOUS_AUART NE INT_COLL_ORD-AUART.
          READ TABLE INT_OVRCTL WITH KEY AUART = INT_COLL_ORD-AUART ETTYP = INT_COLL_ORD-ETTYP.
          CHECK SY-SUBRC NE 0.
    Now, the issue is:
    Please note that declaration for INT_COLL_ORD has a field AUART, which is used in further parts of program (see the statement just above)
    But, since neither VBAP nor VBEP contains AUART field, it cannot be fetched through the QUERY#2. So this value is not populated into INT_COLL_ORD through SELECT Query.
    Since this field is used in later part of program & that the internal table has no value for this field, it dumps!!
    How to include this value into the INT_COLL_ORD?
    Plz suggest....

  • I need to add a single field from with_item table . need to write select query with reference to company code , account doc no , fiscal year

    I need to add a single field from with_item table . need to write select query with reference to company code , account doc no , fiscal year

    Hi Arun ,
    Can you explain little bit more ??
    what is account doc no? 
    what are the transactions should be displayed in your output??
    -Rajesh N

  • How can I create a query with web service data control?

    I need to create a query with web service data control, in WSDL, it's query operation, there is a parameter message with the possible query criteria and a return message contains the results. I googled, but cannot find anything on the query with web service. I cannot find a "Named Criteria" in web service data control like normal data control. In Shay's blog, I saw the topics on update with web service data control. How can I create a query with web service data control? Thanks.

    Hi,
    This might help
    *054.     Search form using ADF WS Data Control and Complex input types*
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html

  • How to month in select query.....for vbap

    Hi Experts,
    I am using selection option Listbox ( January, February, March, etc...).
    How to use it in select query for table vbap (Shown below),
    I want to retrieve data of january from vbap and matches erdat in pa_mnr.
        parameters: pa_mnr type ztemp-zlist as listbox visible
                    length 13 default 'January'.
        select * from vbap into corresponding fields of table it_vbap
                 where matnr in matnr1 and
                       gsber = 'HIP'   and
                       vstel = 'BSP'   and
                       erdat in pa_mnr.

    hi,
    take the date from the select option.
    let say you have date, month and year seperate select option..
    then look at some FM whcih gives month number for your month name..
    concatenate all the three separated by dot and put it in a variable of type datum..
    now your variable contains the user selected date.
    you can write your select query.
    rewards if useful
    regards,
    nazeer

  • How to display the selection screen with icons as well as with text element

    How to display the selection screen with icons as well as with texts (written in text elements) for PlantDate, OrderType,WareHouse..

    Report zex33.
    type-pools: icon.
    selection-screen begin of line.
    selection-screen comment 1(20) text_001.
    parameters: p_werks type marc-werks.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text_002.
    parameters: p_whouse(10).
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text_003.
    parameters: p_auart like vbak-auart.
    selection-screen end of line.
    initialization.
      write ICON_PLANT  as icon to text_001.
    concatenate text_001 text-001 into text_001 separated by space.
      write ICON_WAREHOUSE  as icon to text_002.
    concatenate text_002 text-002 into text_002 separated by space.
      write ICON_ORDER  as icon to text_003.
    concatenate text_003 text-003 into text_003 separated by space.

  • How to write jsp select record from Oracle  divide per page , about 50 reco

    Dear Expert,
    How to write jsp select record from Oracle divide per page , about 50 record per page.
    Thank you very much.

    I wish I could, but there is no single sign on module available for Fusion, also, so called Fusion is yet another Word With Big Letters, behind it there is yet another OC4J ( now Oracle switched to Weblogic though) container with bunsh of Oracle apps residing in it.
    Generally speaking, neither Fusion nor Oracle Apps user database does not have any single authentication module available out of the box to integrate user database.
    It's a long sad story running straight from Oracle Apps 11.0.5.
    That's why I've created JAAS single sign on login module and used it ever since at OC4J 10.2 and onwards at OC4J 10.3
    Back to the topic: to develop Apps and test them externally using the session bean I've isted above, one need to copy certain libraries from Oracle Apps server, then add them as libraries for JDeveloper project.
    Here is the complete list:
    oracle.apps.fnd.cache
    oracle.apps.fnd.cache
    oracle.apps.fnd.common
    oracle.apps.fnd.functionSecurity
    oracle.apps.fnd.metadata
    oracle.apps.fnd.security
    oracle.apps.fnd.util
    oracle.apps.jtf.cache
    oracle.apps.jtf.security
    Edited by: Faceless on Nov 26, 2009 3:04 AM

  • How to write the given query using 'ANY ' operator

    Hi,
    How to write the given query using 'ANY ' operator , I dont need to fetch to grade_master table twice in database, just need to fetch within the result set.
    SELECT dsg_code,dsg_name,dsg_grade FROM designation_master WHERE dsg_orgn='&&Orgn' and dsg_ctry='&&ctry'
    And dsg_loc ='&&loc' And dsg_oru = '&&oru' and dsg_grade in decode('&&radio_group',
    1, SELECT grd_code FROM grade_master WHERE grd_osm_code in (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&Orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'),
    2, SELECT grd_code FROM grade_master WHERE grd_osm_code > (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' and grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code),
    3, SELECT grd_code FROM grade_master WHERE grd_osm_code < (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'))
    thanks
    rincy

    Hi,
    One thing I understood my your issue is you want to perform, execution of query once or fetch the results sets my minimizing the number of times executions of queries. It would be hard for us to check in this way, atleast provide some temporary data and some business rules. Only I can IN, >, < (queries logical conditons on inner query)
    - Pavan Kumar N
    - ORACLE OCP - 9i/10g
    https://www.oracleinternals.blogspot.com

  • How can I create a query with tables in INFOSET?

    Dear Gurus,
    How can I create a query with tables in INFOSET?
    Just tables and fields INFOSET?
    Kind Regards,

    Hello
    Check following SCN Article for your understanding/reference:
    - [Using Infoset Query ,SAP Query and Quick Viewer|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10eab7af-0e54-2c10-28a5-87b47adbe1a5]
    Regards
    JP

Maybe you are looking for

  • How to use multiple Spry Data Sets in one page

    I'm using two spry data sets in one page. When I add the first spry data set to my page everything runs OK, When I add the second spry data set to the page the first data set stops working. Does anyone know what the problem is? This is how I have my

  • Need suggestion for data encryption

    Hello Experts, I need your expert opinion on one of the data encryption method. We have some legal compliance to implement data encryption as listed below, lets say we have to apply encryption on 2 tables (1) TAB_A (2) TAB_B. (1) Need data encryption

  • IOS 8.2 and Video Podcast Bug

    Is there a problem with losing video when playing consecutive video podcasts in IOS 8.2? I subscribe to NASA HD video feeds, and recently discovered a problem where the first video podcast I select plays perfectly, but when it automatically goes to t

  • Effect of super() in JDialog constructor on focusability/modality

    Hello again, this is a JFrame which calls a JDialog which calls a JDialog. Using super(...) in the constructor of SecondDialog makes this dialog unfocusable as long as FirstDialog is shown. Without super(...) one can freely move between the dialogs.

  • Acrobat 5 with Wondows 8.1

    I have been using Acrobat 5 for years,  but my new PC is Windows 8.1 I tried to load it but got a message advising that there may be compatibility issues,   but I can't find any definitive advice about this. I only use Acrobat 5 for creating and addi