Problem in Accession inner join with [Microsoft][SQLServer 2000 Driver

Hi
Can you tell me what can be cause my sql statement is correct gives result but
if i used below statement in my JSP ,cause error
1)
ps1=connection.prepareStatement("select RQM_IN_RQSTN_ID_PK,RQD_IN_ITM_ID_FKPK,RQD_VC_ITM_DSCRPTN,RQD_IN_STTS_ID_FK,C.SMT_VC_STTS_NM,a.RQM_DT_PRPSD_DLVRY_DT"+
"from PAS_RQM_RQSTN_MSTR a "+
"inner join PAS_RQD_RQSTN_DTLS b on a.RQM_IN_RQSTN_ID_PK = b.RQD_IN_RQSTN_ID_FKPK and RQD_IN_STTS_ID_FK = 4"+
"INNER JOIN PAS_SMT_STTS_MSTR C ON C.SMT_IN_STTS_ID_PK=B.RQD_IN_STTS_ID_FK" +
"where a.RQM_VC_DTRTMNT_INVLV='Technology' ");
2) Error Generate
java.sql.SQLException
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Line 1: Incorrect syntax near 'a'.
What can be the cause
Thanks

ps1=connection.prepareStatement("select
RQM_IN_RQSTN_ID_PK,RQD_IN_ITM_ID_FKPK,RQD_VC_ITM_DSCRP
TN,RQD_IN_STTS_ID_FK,C.SMT_VC_STTS_NM,a.RQM_DT_PRPSD_D
LVRY_DT"+
"from PAS_RQM_RQSTN_MSTR a "+
"inner join PAS_RQD_RQSTN_DTLS b on
a.RQM_IN_RQSTN_ID_PK = b.RQD_IN_RQSTN_ID_FKPK and
RQD_IN_STTS_ID_FK = 4"+
"INNER JOIN PAS_SMT_STTS_MSTR C ON
C.SMT_IN_STTS_ID_PK=B.RQD_IN_STTS_ID_FK" +
"where a.RQM_VC_DTRTMNT_INVLV='Technology' ");This is a problem due to not providing spaces where they are needed. See the places where I have highlighted.
A better way is to generate the String first [use StringBuffer as a good practice for appending instead of String "+"] and print it out to check if it is correct.
***Annie***

Similar Messages

  • [Microsoft][SQLServer 2000 Driver for JDBC] Broken pipe

    Using 10.1.2.0.2
    I have Web App in which I am connecting to MS SQLServer 2005. I have created a datasource on the server and used Microsoft's free JDBC drivers i.e. msutil.jar,mssqlserver.jar,msbase.jar. Now every now and then I am getting the following error when trying to connect to the SQLServer
    [Microsoft][SQLServer 2000 Driver for JDBC]Broken pipe;nested exception is: java.sql.SQLException:[Microsoft][SQLServer 2000 Driver for JDBC]Broken pipeAny ideas what might be wrong and how to take care of this issue.
    Thanks

    DataDirect driver is certified with Oracle Application Server accessing SQLServer, here is an example of a data source entry for SQLServer in OralceAS 10.1.2.x.
    <data-source
    class="com.evermind.sql.DriverManagerDataSource"
    name="MerantDS"
    location="jdbc/MerantCoreSSDS"
    xa-location="jdbc/xa/MerantSSXADS"
    ejb-location="jdbc/MerantSSDS"
    connection-driver="com.oracle.ias.jdbc.sqlserver.SQLServerDriver"
    username="test"
    password="secret"
    url="jdbc:oracle:sqlserver://hostname:port;User=test;Password=secret"
    inactivity-timeout="30"
    />
    Here shows a SQLServer managed data source example and a SQLServer native source example in OracleAS 10.1.3.x:
    SQLServer Managed Data Source
    <connection-pool name="ConnectionSqlserver"
    max-connections="20"
    min-connections="1">
    <connection-factory
    factory-class="com.oracle.ias.jdbcx.sqlserver.SQLServerDataSource"
    user="msuser"
    password="mspass"
    url="jdbc:oracle:sqlserver://myserver\\myinstance;User=msuser;Password=mspass" >
    <property name="serverName" value="myserver\\myinstance"/>
    <xa-recovery-config>
    <password-credential>
    <username>msuser</username>
    <password>mspass</password>
    </password-credential>
    </xa-recovery-config>
    </connection-factory>
    </connection-pool>
    <managed-data-source connection-pool-name="ConnectionSqlserver"
    jndi-name="jdbc/mysqlserver"
    name="mysqlserver" />

  • Java.sql.SQLWarning: [Microsoft][SQLServer 2000 Driver for JDBC]Database

    HI!
    I am updating a table in sql server 2000 using PreparedStatement but as im trying to updateit. SQL is giving error or rather we can say warning.
    java.sql.SQLWarning: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to BRSHere BRS is my database name.
    no error is generated .all the PreparedStatement is executes normally.
    Can any one tell me anything about this

    All the PreparedStatement is executes normally.But data is not updated in the database.

  • Replacing a inner join with for all entries

    Hi Team,
       In a already developed program I am replacing a inner join with select query follow up with for-all-entris and passing the data to final internal table but in both the case the result should be same then only my replacement will be correct. But my no records in both cases differs. This happening because when i am selecting data from first data base table is 32 lines. then I am doing fo-all-entries moving all the duplicate entries then the no records are four. but in final internal table i am looping the first internal table. So in final internal table the no of records are 32. But in inner join query the records are 16.So please let me know how resolve this issue?
    Thanks and REgards
    Deepa

    Hi Thomas,
      Thanks for ur suggestion.
    The solved that in below.
    In select query I did not change anything The way I had written the code was correct.
    I think many of us know how to write that how to make the performance better in that way.
    I made the change when I transfered the to final internal table.
    The original Inner join code:
    select a~field1 a~field2 a~field3 b~field2 b~field3 b~field4
               from dbtab1 as a  inner join dbtab2 as b
              on a~field1 = b~field1 into it_final where
              a~field1 in s_field1. [Field1  in both the table are key field]
    Before code:
    Sort itab1 by key-fields.
    sort itab2 by keyfields.
    loop at itab1 into wa1.
    move: wa1-field1 to wa_final-field1,
               wa1-field2 to wa_final-field2,
               wa1-field3 to wa_final-field3.
    read table itab2 into wa2 witk key field1 = wa1-field1 binary search.
      if sy-subrc = 0.
      move : wa2-field2 to wa_final-field4,
                 wa2-field3 to wa_final-field5,
                 wa2-field4 to wa_final-field6.
    append wa_final to it_final.
    endif.
    Clear : wa1, wa2, wa_final.
    endloop.
    In this case if the one key fieild value is not present there in second internal table but its there in first internal table still it will read that row with 2nd internal values having zeroes. Normally what does not happen in inner join case if the key field value will same in both the case ,then that will fetch only those rows.
    Changed Code
    loop at itab1 into wa1.
    read table itab2 into wa2 witk key field1 = wa1-field1 binary search.
      if sy-subrc = 0.
    move: wa1-field1 to wa_final-field1,
               wa1-field2 to wa_final-field2,
               wa1-field3 to wa_final-field3.
      move : wa2-field2 to wa_final-field4,
                 wa2-field3 to wa_final-field5,
                 wa2-field4 to wa_final-field6.
    append wa_final to it_final.
    endif.
    Clear : wa1, wa2, wa_final.
    endloop.
    In this case the values will read to final internal table if both key field matches.
    With Regards
    Deepa

  • INNER JOIN with FOR ALL ENTRIES IN Performance ?

    I am using following the following <b>Select using Inner join with For All Entries in.</b>
          SELECT kebeln kebelp kvbeln kvbelp
            FROM ekkn AS k INNER JOIN ekbe AS b ON kebeln = bebeln
                                               AND kebelp = bebelp
            INTO TABLE gi_purchase
             FOR ALL ENTRIES
             IN gi_sales
          WHERE k~mandt EQ sy-mandt
            AND k~vbeln EQ gi_sales-vbeln
            AND k~vbelp EQ gi_sales-posnr
            AND b~budat EQ p_date.
    If i am not doing inner join then I will have to do 2 select with for all entries in on ekkn and ekbe tables and then compare them.
    <b>I want to know which one has better performance
    Inner join with for all entries in
                    or
    2 Selects with for all entries in</b>

    the join is almost aways faster:
    <a href="/people/rob.burbank/blog/2007/03/19/joins-vs-for-all-entries--which-performs-better">JOINS vs. FOR ALL ENTRIES - Which Performs Better?</a>
    <a href="http://blogs.ittoolbox.com/sap/db2/archives/for-all-entries-vs-db2-join-8912">FOR ALL ENTRIES vs DB2 JOIN</a>
    Rob

  • Inner Join with For All Entries - Performance ?

    I am using following the following <b>Select using Inner join with For All Entries in.</b>
          SELECT kebeln kebelp kvbeln kvbelp
            FROM ekkn AS k INNER JOIN ekbe AS b ON kebeln = bebeln
                                               AND kebelp = bebelp
            INTO TABLE gi_purchase
             FOR ALL ENTRIES
             IN gi_sales
          WHERE k~mandt EQ sy-mandt
            AND k~vbeln EQ gi_sales-vbeln
            AND k~vbelp EQ gi_sales-posnr
            AND b~budat EQ p_date.
    If i am not doing inner join then I will have to do 2 select with for all entries in on ekkn and ekbe tables and then compare them.
    <b>I want to know which one has better performance
    Inner join with for all entries in
                    or
    2 Selects with for all entries in</b><b></b>

    An Inner Join with for all entries should be done if you add this....
    IF NOT gi_sales[] IS INITIAL.
    SELECT k~ebeln k~ebelp k~vbeln k~vbelp
    FROM ekkn AS k INNER JOIN ekbe AS b ON k~ebeln = b~ebeln
    AND k~ebelp = b~ebelp
    INTO TABLE gi_purchase
    FOR ALL ENTRIES
    IN gi_sales
    WHERE k~mandt EQ sy-mandt
    AND k~vbeln EQ gi_sales-vbeln
    AND k~vbelp EQ gi_sales-posnr
    AND b~budat EQ p_date.
    ENDIF.
    Also, while you use an index or the complete key for the SELECT, your not going to suffer from lack of performance -;)
    Greetings,
    Blag.

  • OBIEE - Problem to access a DashBoard with &Action=Navigate&Format=pdf

    Oracle Business Intelligence Product Version 10.1.3.4
    Hi,
    I have a problem to access a dashboard with &Action=Navigate&Format=pdf
    This works:
    http://company.com:9999/analytics/saw.dll?Dashboard&PortalPath=/shared/XXXXXXX/_portal/Dashboard1&Page=Page1&Action=Navigate
    This works
    http://company.com:9999/analytics/saw.dll?Dashboard&PortalPath=/shared/XXXXXXX/_portal/Dashboard1&Page=Page1&*Action=print*&Format=pdf
    BUT this doesnt work_
    http://company.com:9999/analytics/saw.dll?Dashboard&PortalPath=/shared/XXXXXXX/_portal/Dashboard1&Page=Page1&Action=Navigate&Format=pdf
    When I try &Action=Navigate&Format=pdf I have a error:
    Assertion failure: rElement.countChildElements() <= vColumns.size() at line 453 of Sun/995545/RH_Linux/vobs/8554.45.3325/analytics_web/main/project/websubsystems/xslfopostprocessor.cpp
    Error Details
    Error Codes: OQ78YWIW
    I really need use &Action=Navigate because I'll pass some parameters on the PROMPT.
    Oracle Business Intelligence Product Version 10.1.3.4
    Can somebody help me ??
    Thanks.

    Looks like a bug related to bug 7298035 - dashboard print to pdf causes assertion error!.
    If possible check this doc ID 1054523.1
    Btw: Whats the BI version?
    If helps pls mark

  • Coupling  INNER  JOIN   with   FOR  ALL  ENTRIES  statement

    Hi  All,
         I   am  coupling   INNER  JOIN  with  FOR  ALL  ENTRIES  statement  .....
         Would   you  please  highlight  its  implications ??   Is  it  a  best  practise ? 
         Is  it  advicable  to  use  MULTIPLE   INNER  JOINs  with  a  FOR  ALL  ENTRIES ???
        SORT itab BY matnr.
        IF NOT itab[] IS INITIAL.
          SELECT       epmatnr epebeln ep~ebelp
                       epwerks epmenge ep~netpr
                       ekps_psp_pnr ebbelnr eb~menge
                       INTO TABLE iekpo
                       FROM ekpo AS ep
                       INNER JOIN ekkn AS ek
                       ON  ekebeln = epebeln
                       AND ekebelp = epebelp
                       INNER JOIN ekbe AS eb
                       ON     ebebeln = epebeln
                       AND    ebebelp = epebelp
                       AND    eb~bwart = '101'
                       FOR ALL  ENTRIES IN itab
                       WHERE   ep~matnr = itab-matnr.
          IF sy-subrc EQ 0.
            SORT iekpo BY matnr werks.
            LOOP  AT  itab ASSIGNING  <itab>.
              READ TABLE iekpo WITH KEY matnr = <itab>-matnr
                                        werks = <itab>-werks
                                        BINARY SEARCH.
              IF sy-subrc EQ 0.
                MOVE iekpo-matnr      TO   itab1-matnr.
                MOVE iekpo-ebeln      TO   itab1-ebeln.
                MOVE iekpo-ebelp      TO   itab1-ebelp.
                MOVE iekpo-netpr      TO   itab1-poprice.
                MOVE iekpo-werks      TO   itab1-werks.
                MOVE iekpo-menge      TO   itab1-menge1.
                MOVE iekpo-menge1     TO   itab1-menge2.
                MOVE iekpo-belnr      TO   itab1-belnr.
                MOVE iekpo-ps_psp_pnr TO   itab1-pspel.
                MOVE <itab>-pspel     TO   itab1-tpspel.
                MOVE <itab>-sobkz     TO   itab1-sobkz.
                MOVE <itab>-fo_qty    TO   itab1-fo_qty.
                MOVE <itab>-schgt     TO   itab1-schgt.
                MOVE <itab>-postp     TO   itab1-postp.
                MOVE <itab>-beskz     TO   itab1-beskz.
                pend_qty = iekpo-menge1 - iekpo-menge2.
                MOVE pend_qty         TO   itab1-pending.
                APPEND itab1.
                pend_qty = 0.
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.
    Regards
    Jaman
    Edited by: ABAP Techie on Sep 15, 2008 12:39 PM
    Edited by: ABAP Techie on Sep 15, 2008 12:41 PM

    best practise ... don't know ... it is allowed and o.k.
    If possible you should of coourse to have no FOR ALL ENTRIES at all !
    Joins, there is no general rule, check indexes etc.
    The first SORT, I don't that it help for anything, use it together with the delete adjacent duplicates if you expect duplicates in the driver table.
    o.k., it can help, if there is a loop afterwards and an append inside, because the new table itab1 is then sorted.
    Siegfried

  • Inner join with for-all entries

    Why is the below inner join-for all entries does not result in expected output ?
    REPORT  ZTST3                                   .
    tables : ztst1,ztst2 .
    * table ztst1 has 4 fields : mandt,ebeln,ebelp,etenr,char4. ; ztst2 has
    * 3 fields : mandt,ebeln,ebelp,matnr
    *Entries in ztst1
    * EBELN       EBELP   ETERN  CHAR4
    * 5000000000  00010    0001    abc
    * 5000000000  00010    0002    cbd
    * 5000000000  00010    0003    efg
    *Entries in ztst2
    * EBELN       EBELP   matnr
    * 5000000000  00010    matabc
    *expected itab after inner join
    * EBELN       EBELP   CHAR4  MAtnr
    * 5000000000  00010   abc    matabc
    * 5000000000  00010   cbd    matabc
    * 5000000000  00010   efg    matabc
    data : begin of itab1 occurs 0,
           ebeln type ebeln,
           ebelp type ebelp,
           end of itab1.
    data : begin of itab occurs 0,
           ebeln type ebeln,
           ebelp type ebelp,
           char4 type char4,
           matnr type matnr,
           end of itab.
    start-of-selection.
    itab1-ebeln = '5000000000'.
    itab1-ebelp = '00010'.
    append itab1.
    select ztst1~ebeln
           ztst1~ebelp
           ztst1~char4
           ztst2~matnr into corresponding fields of table itab
    from ztst1 inner join ztst2
    on ztst1~ebeln = ztst2~ebeln and
       ztst1~ebeln = ztst2~ebelp
    for all entries in itab1
    where
    ztst1~ebeln eq itab1-ebeln and
    ztst1~ebelp eq itab1-ebelp .
    * why does it return no entries;
    break-point.

    For example in the bellow case
    *Entries in ztst1
    EBELN       EBELP   ETERN  CHAR4
    5000000000  00010    0001    abc
    5000000000  00010    0002    cbd
    5000000000  00010    0003    efg
    5000000002  00020    0003    efg
    5000000002  00020    0003    efg
    *Entries in ztst2
    EBELN       EBELP   matnr
    5000000000  00010    matabc
    5000000002  00020    abc
    may it will return you 2 records yes, than I think you have under stand the working of u201Cfor all entriesu201D ?
    And the following case I think it will work fine.
    *Entries in ztst1
    key  EBELN       EBELP   ETERN  CHAR4
    1       5000000000  00010    0001    abc
    2       5000000000  00010    0002    cbd
    3       5000000000  00010    0003    efg
    4       5000000002  00020    0003    efg
    5       5000000002  00020    0003    efg
    *Entries in ztst2
    EBELN       EBELP   matnr
    5000000000  00010    matabc
    5000000002  00020    abc
    select  ztst1~key
    ztst1~ebeln
           ztst1~ebelp
           ztst1~char4
           ztst2~matnr into corresponding fields of table itab
    from ztst1 inner join ztst2
    on ztst1~ebeln = ztst2~ebeln and
       ztst1~ebelp = ztst2~ebelp
    for all entries in itab1
    where
    ztst1~ebeln eq itab1-ebeln and
    ztst1~ebelp eq itab1-ebelp .
    Sorry, I donu2019t have system with me right now and I am sending you with out testing but I am sure that it is working the same way.
    Please Reply if any problem
    Kind Regards,
    Faisal

  • INNER join with dynamic table name ?

    Hi,
    I have a problem with this statement.
    DATA: g_dso_bic_dofr TYPE tabname.
    SELECT t1~/bic/ziparomr
           t2~/bic/zifremom
    INTO (wa_rater_paromr-/bic/ziparomr,
           wa_rater_paromr-/bic/zifremom)
    *   FROM /bic/azd0bfr5100 AS t1     "equivalent to the dynamic statement below
    " this is the  problem
        FROM (g_dso_bic_dofr )AS t1
        INNER JOIN /bic/pzifremom AS t2
          ON t1~/bic/ziparomr = t2~/bic/ziparomr
    " --- to here
        WHERE t1~/bic/zikom     =  v_kommune
    The compile check doesnt work when i use the variable table name.
    I get
    "Wrong expression "INNER" in FROM clause. WHERE condition."
    Can anyone help me.
    Br Rasmus.

    " this is the  problem
    *    FROM (g_dso_bic_dofr )AS t1   "<<--- check spaces in here
        FROM (g_dso_bic_dofr) AS t1    "<<--- and here
        INNER JOIN /bic/pzifremom AS t2
          ON t1~/bic/ziparomr = t2~/bic/ziparomr
    " --- to here
    I think there's the problem, the space behind the parenthesis.
    Regards

  • Inner join with if statement , how to combine these code ?

    Hello everyone, I have 2 group of code here. This 2 group of code is working without error. But I face a problem , I need to group up this 2 group of code. Please take a look, thank you This is the first code i create.
    SELECT r.Name , r.Restaurant_ID, f.feature, r.Price_Range, r.Cuisine_ID, c.Cuisine,
        s.State_ID, s.State, l.Location_ID, l.Area, l.State_ID, r.Name, r.Location_ID
    FROM Restaurants r, Bridge1_Restaurant_Features b, Features f, Cuisine c, State s, Location l
            where 0=0
            AND b.Feature_ID = f.Feature_ID
            AND b.Restaurant_ID = r.Restaurant_ID
            AND r.Cuisine_ID = c.Cuisine_ID
            AND r.Location_ID = l.Location_ID
            AND l.State_ID = s.State_ID
            <cfif ARGUMENTS.Feature_ID IS NOT "">
            AND b.Feature_ID IN (#ARGUMENTS.Feature_ID#)
            </cfif>
            <cfif ARGUMENTS.Price_Range IS NOT "">
            AND r.Price_Range IN (#ARGUMENTS.Price_Range#)
            </cfif>
            <cfif ARGUMENTS.Cuisine IS NOT "">
            AND r.Cuisine_ID = (#ARGUMENTS.Cuisine#)
            </cfif>
            <cfif val(ARGUMENTS.LocationID2) IS #val(ARGUMENTS.StateID)#>
            AND l.State_ID = #val(ARGUMENTS.LocationID2)#
            <cfelse>
                AND l.Location_ID = #val(ARGUMENTS.LocationID2)#
            </cfif>
    Then, I notice the feature_ID i need to use another logic to show the result. The code is like this
    SELECT r.Restaurant_ID, r.Name, f.Feature
    FROM   Restaurants r
    INNER JOIN Bridge1_Restaurant_Features b ON b.Restaurant_ID = r.Restaurant_ID
    INNER JOIN Features f ON b.Feature_ID = f.Feature_ID
    INNER JOIN
         SELECT Restaurant_ID, COUNT(Feature_ID) AS FeatureCount
         FROM   Bridge1_Restaurant_Features
         <!--- find matching features --->
         WHERE  Feature_ID IN ( <cfqueryparam value="#ARGUMENTS.Feature_ID#" cfsqltype="cf_sql_integer" list="true"> )
        GROUP BY Restaurant_ID
        <!--- having ALL of the requested features --->
         HAVING COUNT(Feature_ID) = <cfqueryparam value="#listLen(ARGUMENTS.Feature_ID)#" cfsqltype="cf_sql_integer">
    ) ck ON ck.Restaurant_ID = r.Restaurant_Id
    I want combine this 2 group together. The second group have to replace
    <cfif ARGUMENTS.Feature_ID IS NOT "">
        AND f.Feature_ID IN (#ARGUMENTS.Feature_ID#)
    </cfif>
    I try few way to group this 2 code, but fail to make it. The code i try is on below, it get error.
    SELECT r.Name , r.Restaurant_ID, f.feature, r.Price_Range, r.Cuisine_ID, c.Cuisine,
            s.State_ID, s.State, l.Location_ID, l.Area, l.State_ID,  r.Location_ID
            FROM Restaurants r, Features f, Cuisine c, State s, Location l
            INNER JOIN Bridge1_Restaurant_Features b ON b.Restaurant_ID = r.Restaurant_ID
            INNER JOIN Features f ON b.Feature_ID = f.Feature_ID
            AND r.Cuisine_ID = c.Cuisine_ID
            AND r.Location_ID = l.Location_ID
            AND l.State_ID = s.State_ID
            <cfif ARGUMENTS.Feature_ID IS NOT "">
            INNER JOIN
                 SELECT Restaurant_ID, COUNT(Feature_ID) AS FeatureCount
                 FROM   Bridge1_Restaurant_Features
                 <!--- find matching features --->
                 WHERE  Feature_ID IN ( <cfqueryparam value="#ARGUMENTS.Feature_ID#" cfsqltype="cf_sql_integer" list="true"> )
                GROUP BY Restaurant_ID
                <!--- having ALL of the requested features --->
                 HAVING COUNT(Feature_ID) = <cfqueryparam value="#listLen(ARGUMENTS.Feature_ID)#" cfsqltype="cf_sql_integer">
            ) ck ON ck.Restaurant_ID = r.Restaurant_Id
            </cfif>
            <cfif ARGUMENTS.Price_Range IS NOT "">
            AND r.Price_Range IN (#ARGUMENTS.Price_Range#)
            </cfif>
            <cfif ARGUMENTS.Cuisine IS NOT "">
            AND r.Cuisine_ID = (#ARGUMENTS.Cuisine#)
            </cfif>
            <cfif val(ARGUMENTS.LocationID2) IS #val(ARGUMENTS.StateID)#>
            AND l.State_ID = #val(ARGUMENTS.LocationID2)#
            <cfelse>
                AND l.Location_ID = #val(ARGUMENTS.LocationID2)#
            </cfif>

    Yeah Adam I am listen to you ! But Finally i solve it.
    This is the code i solve .
    SELECT r.Restaurant_ID, r.Name, f.Feature, r.Price_Range, r.Cuisine_ID, c.Cuisine,
                        l.Location_ID, l.Area, s.State
              FROM   Restaurants r
              <cfif ARGUMENTS.Feature_ID IS NOT "">
              INNER JOIN
                   SELECT Restaurant_ID, COUNT(Feature_ID) AS FeatureCount
                   FROM   Bridge1_Restaurant_Features
                   <!--- find matching features --->
                   WHERE  Feature_ID IN ( <cfqueryparam value="#ARGUMENTS.Feature_ID#" cfsqltype="cf_sql_integer" list="true"> )
                  GROUP BY Restaurant_ID
                  <!--- having ALL of the requested features --->
                   HAVING COUNT(Feature_ID) = <cfqueryparam value="#listLen(ARGUMENTS.Feature_ID)#" cfsqltype="cf_sql_integer">
              ) ck ON ck.Restaurant_ID = r.Restaurant_Id
              </cfif>
              INNER JOIN Location l ON r.Location_ID = l.Location_ID
              INNER JOIN State s ON l.State_ID = s.State_ID
              INNER JOIN Cuisine c ON r.Cuisine_ID = c.Cuisine_ID
              INNER JOIN Bridge1_Restaurant_Features b ON b.Restaurant_ID = r.Restaurant_ID
              INNER JOIN Features f ON b.Feature_ID = f.Feature_ID
              <cfif ARGUMENTS.Cuisine IS NOT "">
              AND r.Cuisine_ID = (#ARGUMENTS.Cuisine#)
              </cfif>
              <cfif ARGUMENTS.Price_Range IS NOT "">
              AND r.Price_Range IN (#ARGUMENTS.Price_Range#)
              </cfif>
              <cfif val(ARGUMENTS.LocationID2) IS #val(ARGUMENTS.StateID)#>
              AND l.State_ID = #val(ARGUMENTS.LocationID2)#
              <cfelse>
                   AND l.Location_ID = #val(ARGUMENTS.LocationID2)#
              </cfif>
    Is it the code can be improve more ?

  • Can we use inner joins with for all entries?

    Hi,
        Can we use innerjoin on two tables MARA and MAKT against the materials in
        the  internal table.
        If so ,please let me know whether there is performance issue.Because if there is
        bad performance issue or something else like thise means,my project manager
        wont allow to include.
        So can one let me know about this.
    Thanks,
    Balaji

    Hi Arunkumar,
                               I think you are not clear.My question is can I use innerjoin with
    for all entries.For example below is my code.
    SELECT A~MATNR
             B~MAKTX
             A~MTART
             A~MATKL
             FROM MARA AS A INNER JOIN MAKT AS B
             ON AMATNR = BMATNR
             INTO TABLE IT_MARA_MAKT
             FOR ALL ENTRIES IN IT_MATNR
             WHERE A~MATNR = IT_MATNR-MATNR
             AND   A~EXTWG = P_EXTWG
             AND   A~SPART = P_SPART.
    Can we use like this for all entries along with innerjoins.
    Thanks,
    Balaji

  • Inner join with data also from non having join column

    I have an Dim table which has to be joined with Fact Table using inner join, but also display the Dimension value " MasterGroup " inspite of data present or not in the fact table.
    My Query:  .. This is an part of my stored procedure with more tables
    SELECT a.SalesAmount, b.HeaderGroup ,c.CityName
    FROM dbo.FactItem a
    inner join dbo.[DimHeader] b
    on a.sid = b.sid
    left join dbo.DimCity c
    on a.cityid = c.id
    My DimHeader Table will have data like
    MasterGroup
    ChildGroup
    etc...
    which is an attribute.
    There might not be any relevent fact data, but still i want the dimension data to display the "MasterGroup"
    ShanmugaRaj

    hello ,
    usually this is not possible when the column you want to display when the matches not found from a table having a distinct values which are hard to declared static..
    you can incorporate something like this if you cant change the join type ..
    select distinct HeaderGroup from dbo.[DimHeader] tbl_outerleft join (SELECT a.sid,a.SalesAmount, b.HeaderGroup ,c.CityName
    FROM dbo.FactItem a
    inner join dbo.[DimHeader] b
    on a.sid = b.sid
    left join dbo.DimCity c
    on a.cityid = c.id) tbl_Main on tbl_Main.sid =tbl_outer.sid
    Dilip Patil..

  • Problem when doing inner join for three tables....

    DATA: V3 TYPE VBAP-MAKTL.
    SELECT single vbap~matkl into V3
           from VBAP
           inner join VBFA
           inner join LIPS
              on LIPSPOSNR = VBFAPOSNN
              and vbapvbeln = vbfavbelv
               and vbapposnr = vbfaposnv
                 where LIPSVBELN = VBFAVBELN = '0080000834'
                 and vbfa~vbtyp_n = 'J'
                 and LIPS~J_3ASIZE = '0884'.
    Error: Wrong expression "INNER" in from clause...

    Hello Tushar,
      Why you are using the 3 table inner join. If the volume of data is big then this statement will give to time out. Use "for all entries" statement to select the data from the table.
    Like
    select field1 field2 from LIPS into i_lips
        where LIPS~J_3ASIZE = '0884'.
    select f3 f4 from vbfa into i_vbfa for all entries in i_lips where field1 = i_lips-field1 and so on
    and 
    use same to select data from VBAP.
    Hope this will help

  • SWING GUI blockes when doing a DB action with microsoft nativ JDBC driver

    hi,
    in a bigger project i have the problem that if i perform a DB action the GUI is blocked. It does not matter if i do the DB Action in invokeLater or
    in a SwingWorker or in a new Thread if i call the DB Action and i move another window over my window it is not refreshed.
    normally the GUI shouln�t be blocked if i use invokeLater. maybe it
    has something to do that i use the native DB driver? I am using JDK
    1.4. has anyone ever encounterd the same problem?
    alex
    package swingtest;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class GUIProblem extends JDialog {   
    // this method does a simple DB call to generate some load
    public void doMyDBCall()
    try {
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    Connection con = DriverManager.getConnection ("jdbc:microsoft:sqlserver://abgvdr71:1433;databasename=v52li;","sa","");
    Statement question0 = con.createStatement();
    ResultSet rs0=null;
    rs0 = question0.executeQuery("select * from intercept_24");
    boolean more=rs0.next();
    while (more) {    more=rs0.next();}
    catch (Exception sql)
    { sql.printStackTrace(); }
    public void doItinvokeLater()
    SwingUtilities.invokeLater(new Runnable(){    public void run(){       
    doMyDBCall();     
    public void doItSwingWorker()
    SwingWorker worker = new SwingWorker() {
    public Object construct() {
    System.out.println("worker start");
    doMyDBCall();
    return null;
    worker.start();
    System.out.println("finished .....");
    Object view = (Object) worker.get();
    public GUIProblem (){
    super((JFrame)null,"",true);
    JButton button = new JButton("do it");
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent event)
    // calls it direct -> GUI blocked
    //doMyDBCall();
    // with invoke later -> GUI blocked
    //doItinvokeLater();
    // with the swingWorker -> GUI also blocks
    doItSwingWorker();     
    getContentPane().add(button);
    setSize(200,200);
    setVisible(true);
    public static void main(String [] args)
    {  new GUIProblem(); }
    }

    The invokeLater runs the Runnable in the event thread, so yes, that will block your GUI. You ALMOST got the SwingWorker right. DB call in the construct() method -- the construct() method executes outside the event thread, the finished() method executes in the event thread. The only problem is, you did a worker.get() method in your event thread (right after worker.start(0, and get() blocks until result is ready from construct() -- so, bingo, you're jammed up waiting in you event thread.

Maybe you are looking for

  • How to find out names of all stored procedures?

    Hi All, I need to find out the names of all stored procedures with parameters and return types. I can use DBA_SOURCE, but in this case I must parse TEXT to find out what I need. Is there any dictionary where the names, parameters and return types of

  • How to use indexes correctly in oracle

    Hi guys on one table i have indexes on 3 columns in the following order a b c When i m writing a select statement in my where clause what should be the order? like where a='some value' and b='some value' and c='some value'; or in reverse order like t

  • A step by Step Oracle Warehousing

    hello Gurus, Please, I learnt how to create dashboards and creating and loading repositories in ODIEE. I would like to have a good link for my practice of Oracle Data Warehousing. Please , could anyone get a good link to help in this? I know the use

  • With the new download previous purchases on ITunes, you can download all of your music, TV Shows, etc. Why cant you download movies that you have downloaded?

    With the new download previous purchases on ITunes, you can download all of your music, TV Shows, etc. Why cant you download movies that you have downloaded? I had a external hard drive that crashed and it had approx 20 movies that I paid for and dow

  • YTD Cumulative Balance Calculation

    Hi All, I need to calculate YTD Cumulative Balance. User will provide fiscal year/period in run time. Cumulative balance should be calculated from fiscal year/period 0000 to user provided fiscal year / period. ex. if user entered value is march, 2010