Please help me to solve the issue in my query.

Hi All,
Please help me to understand the mistake what i did in below query and help to resolve that.
Actually i am trying to create a query to filter the records from db based on my input parameter.
   If my input parameter is 1(@showallrecords) then i need to show all the records which has the IsLatest as 1
   If my input parameter is 0(@showallrecords) then i need to show all the records which has the IsLatest as 0
select * from tabel1 INNER JOIN tabel2    
ON tabel1.KeyId = tabel2.KeyId 
and (@showallrecords = 1 and tabel1.IsLatest = 1 )
and (@showallrecords = 0 and tabel1.IsLatest = 0 )
when i am executing the above query with the parameter @showallrecords = 1 ,db is returning 0 rows.If i am executing the above query after removed the last line and (@showallrecords = 0 and tabel1.IsLatest = 0 ) then records are coming.
i understand that 1=0(last line) and the condition is not true.So its affecting the result.
Please help me to solve this.

select * from tabel1 INNER JOIN tabel2
ON tabel1.KeyId = tabel2.KeyId
WHERE (tabel1.IsLatest = @showallrecords Or @showallrecords=0)

Similar Messages

  • TS1363 My iPod Nano 7th Generation couldn't be detected by iTunes when I plugged in. I tried resolving the issue by uninstalling the iTunes and then install it back again but yet still the same problem exist. Can you please help me to solve this issue?

    My iPod Nano 7th Generation couldn't be detected by iTunes when I plugged in. I tried resolving the issue by uninstalling the iTunes and then install it back again but yet still the same problem exist. Can you please help me to solve this issue? I have already updated to the latest version of iTunes on my Windows 8 and I cannot synchronize my iPod for the time being. Please do help me to solve this problem. Thank You.

    uninstall all iTunes,5 programes,this worked for me after reinstall them

  • HT1918 I would like to change my Visa card from the account but its not changing and the billing information is not changing and I can't purchase any thing from my account its now not usable please help me to solve the problem

    I would like to change my Visa card from the account but its not changing and the billing information is not changing and I can't purchase any thing from my account its now not usable please help me to solve the problem

    You made a purchase and exhausted the credit on your card before it processed. All purchases are final. Contact iTunes Store support. You need to settle up before you can purchase or download anything else.

  • Hi, i installed ios 5 for my iphone 4 and the camera function on lock screen was on the first few days , now it doesn't show the lock screen . is there any change i can do . Pls help me to solve the issue.

    hi, i installed ios 5 for my iphone 4 and the camera function on lock screen was on the first few days , now it doesn't show the lock screen . is there any change i can do . Pls help me to solve the issue.

    nishaadp wrote:
    ... it stucks with the apple logo ,  nothing works. Is anything i can do?
    See Here for
    Frozen or unresponsive iPhone

  • Please help me to solve the problem ---it's urgent

    hi everybody
    my application is deployed on the weblogic 9.0. I am using the VB DLL through which i am sending the request to the servlet.
    When i am pressing the "Color" button in VBDLL to retrieve the color information, server takes the long time nearly 10-12 minutes to return back the color information but it throws the following error
    <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "621" seconds working on the request "Http Request: /sales/appFindSize.jsp", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
    java.lang.Object.wait(Native Method)
    java.lang.Object.wait(Object.java:474)
    javelin.client.JobWaiter.blockUntilFinished(JobWaiter.java:45)
    javelin.client.ClientUtilsImpl.build(ClientUtilsImpl.java:838)
    weblogic.servlet.jsp.JavelinxJSPStub.compilePage(JavelinxJSPStub.java:244)
    weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:200)
    weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164)
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:224)
    weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:383)
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:298)
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3022)
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1925)
    weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1848)
    weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1288)
    weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    please help me to solve this error it is urgent.
    Thanks in advance
    Pandurang S. Pokharkar

    Exchange rates can be entered as a direct or indirect quotation. You can maintain two prefixes that
    can be used to differentiate between direct and indirect quotations exchange rates during input and
    display. If you don´t set up a prefix, the standard setting is valid:
    &#159; “” (blank, without a prefix) for direct quotation exchange rates
    &#159; “/” for indirect quotation exchange rates
    n Scenario 1: If you use mainly direct quotation exchange rates and indirect quotation occurs seldom,
    use the default configuration. In this way you can enter direct quotation exchange rates without a
    prefix.
    n Scenario 2: If, in addition to direct quotation exchange rates, the handling of indirect quotation is
    required, you should define a prefix that is not “blank” for both quotation types, e.g.:
    &#159; “*” for direct quotation exchange rates, “/” for indirect quotation exchange rates
    &#159; If you follow this suggestion, the configuration does not allow exchange rates to be entered
    without a prefix, an error message occurs. Thus users are forced to consider which the correct
    quotation is and enter the rate with a valid prefix.
    n Scenario 3: If indirect quotation is the major notation at your company, you can configure the
    settings this way:
    &#159; “*” for direct quotation exchange rates, “ ” (blank) for indirect quotation exchange rates
    &#159; This configuration allows indirect quotation exchange rates to be entered without a prefix whereas
    the less used direct quotation exchange rates have to be entered with a prefix.

  • Please Help me in solving this issue. i am a newbie to coldfusion

    i want to use a single home page where i will show a form (which is in another file) to user to upload a file,after uploading (action file result) i want to show result of upload also on the same page.
    these are my three files:
    1. index.cfm
    <!-- start -->
    <html>
    <head>
    <title>HomePage</title>
    <cfajaximport tags="CFFORM">
    </head>
    <body>
    <cfdiv id="Main" style="width:1000px; height:600px" >
            <cfdiv id="Options" style=" width:100%;height:20%" >
                Welcome Admin, <a href="javascript:ColdFusion.navigate('FileUpload.cfm','Content')" class="settings">Update  </a><a href="#" class="logout">Logout</a>
            </cfdiv>
            <cfdiv id="Content" style=" width:100%;height:80%">
    <h2>Here Goes Form and FileUploading</h2>
            </cfdiv>
    </cfdiv>
    </body>
    </html>
    <!--  -->
    2.FileUpload.cfm
    <!-- start -->
    <html>
        <head>
            <title>
                Upload A File
            </title>
        </head>
        <body >       
    <cflayout type="vbox" name="layout1">
    <cflayoutarea>
        <cfform  enctype="multipart/form-data"  action="FileReceiver.cfm" >
                            File To Upload:
                            <cfinput type="file" name="Filename" size="50" >
                 <br/>       
                            <cfinput type="submit" name="UploadFile" value="UPLOAD THIS FILE">
                    <br/>
            </cfform>
    </cflayoutarea>
    <cflayoutarea>       
        <table border="1" >
                <tr>
                <th >
                    Directory Information
                </th>
                </tr>
                <tr>
                    <td>
                    <cfoutput >
                        CurrectDirectory Path: #getdirectoryFromPath(expandPath("index.cfm"))#
                    </cfoutput>
                    </td>
                </tr>
            </table>
    </cflayoutarea>
    </cflayout>
        </body>
    </html>
    <!-- -->
    3.FileReceiver.cfm
    <!---start-->
    <cfif isdefined('UploadFile')  >
    <cfoutput >
    <cffile nameconflict="makeunique"
    action="upload"
    filefield="Form.Filename"
    destination="#getdirectoryFromPath(expandPath("index.cfm"))#" > <!--- or destination="c:\Upload\"--->
            File upload was successful!
    </cfoutput>
    </cfif>
    <!-- -->
    when i click on "update link" index page shows the FileUpload.cfm page in one of its container but while uploading file
    i always get ERROR MESSAGE:
    Error retrieving markup for element cf_layoutarea736558924094373 : Invalid content type: application/x-www-form-urlencoded; charset=UTF-8. [Enable debugging by adding 'cfdebug' to your URL parameters to see more information]
    Kindly Help me doing it right...i am unable to figure out problem ...

    Ah, I found the cause of the issue: Coldfusion stores the properties of user-interface tags like cfdiv and cflayoutarea in the form scope. That is what is destroying your upload form. To see it, run the following test code:
    <cfdump var="#form#">
    <cflayout type="vbox" name="layout1">
    <cflayoutarea name="myLayoutArea123">
    <cfform >
    <cfinput type="submit" name="submit" value="Test by posting form to same page.">
    </cfform>
    </cflayoutarea>
    </cflayout>
    Now, the search for a possible solution.

  • Urgent: Please help. how to solve the time delay during buffer read and write using vc++

    I need to continuously acquire data from daqmx card, write into a file and at the same time corelate (in terms of time) the data with signals from other instruments. The current problem is that there is time delay during read and write data into buffer,thus causing misalignment of the data from multiple instruments. Is there a way to solve  the delay? or Is there a way to mark the time of the data acquisition in the buffer?  If I know the starting time (e.g. 0) of data acquisition and sampling rate (e.g. 1kHz), can I simply add 1ms to each data sample in the buffer? The current code is shown below.
    void DataCollectionWin::ConnectDAQ()
    DAQmxErrChk(DAQmxCreateTask ("", &taskHandle));
        DAQmxErrChk(DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0,Dev1/ai1,Dev1/ai2,Dev1/ai3,Dev1/ai4,Dev1/ai5,Dev1/ai16,Dev1/ai17,Dev1/ai18,Dev1/ai19,Dev1/ai20,Dev1/ai21,Dev1/ai6,Dev1/ai7,Dev1/ai22","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
      DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,60000));
      DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,50,0,EveryNCallback,NULL));// Every 50 samples the EveryNSamplesEvent will be trigured, to reduce time delay.
      DAQmxErrChk (DAQmxRegisterDoneEvent(taskHandle,0,DoneCallback,NULL));
      DAQmxErrChk (DAQmxStartTask(taskHandle));
    int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
     DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,50,10.0,DAQmx_Val_GroupByScanNumber,data,50*15,&read,NULL));
       //memcpy(l_data,data,6000);
      SetEvent(hEvent);
    l_usstatus_e[0]=g_usstatus[0];// signals from other instruments that need to be corelated with the data from daq cards.
     l_optstatus_e[0]=g_optstatus[0];
     if( read>0 ) // write data into file
       //indicator=1;
     for (i=0;i<read;i++)
     {  //fprintf(datafile,"%d\t",i);
      fprintf(datafile,"%c\t",l_usstatus_s[0]);
      fprintf(datafile,"%c\t",l_usstatus_e[0]);
            fprintf(datafile,"%c\t",l_optstatus_s[0]);
      fprintf(datafile,"%c\t",l_optstatus_e[0]);
              fprintf(datafile,"%.2f\t",data[15*i]);
     //   sprintf( pszTemp, "%f", data[6*i]);
     // pListCtrl->SetItemText(0, 2, pszTemp);
        //pWnd->m_trackinglist.SetItemText(0, 2, pszTemp);
         fprintf(datafile,"%.2f\t",data[15*i+1]);
         fprintf(datafile,"%.2f\t",data[15*i+2]);

    Hello kgy,
    It is a bit of a judgment call. You should just choose the board that you think has the most to do with your issue. For example, this issue was much more focused on setting up your data acquisition task than the Measurement Studio environment/tools, so the MultifunctionDAQ board would have been the best place for it. As for moving your post to another board, I do not believe that is possible.
    Regards,
    Dan King

  • Where's "isturk", please help me to solve my issue.

    Dear isturk ,
    I have problem about jsp with crystal reports as same as you saw before.
    I search and know about you can solve it, I see at this link:
    http://forums.java.sun.com/thread.jspa?threadID=623199&messageID=3542599
    I know you can fixed it, please please please help me.
    If any person can solve my problem please let me know.
    Thank you so much.
    Wechy.

    no one help me.
    Oh goddddd...
    help me please please please.

  • Please help me by solving the following query

    hi download the image from the above link and here i want latest dosi line count.....
    Please help me

    I think you don't need a plsql for this purpose ... you can find the sub total & final total in the query itself like
    select
         DOSI,
         ELEMENT_TYPE,
         SUM(USED)  USED
    from
         DOEMS_LICENSE_SUMMARY
    where
         DOSI in (DOSILIST)
    GROUP BY
         rollup(ELEMENT_TYPE, DOSI)      ** duplicate**

  • Please help me in finding the solution for this query

    Hi Experts,
    How could i print column name's second word in next line
    suppose am taking ename alias as "employee name"
    i want to print the second word "name" in next line
    like
    "Employee
    Name"
    Whats the way of writing this query
    Please help me out
    Thanks in Advance

    Hi,
    914618 wrote:
    WITH mydata AS
    SELECT 1 emp_id, 'John Smith' emp_name FROM DUAL UNION ALL
    SELECT 2 emp_id, 'Steve Jobs' emp_name FROM DUAL UNION ALL
    SELECT 3 emp_id, 'Larry Allison' emp_name FROM DUAL
    SELECT emp_id, emp_name
    FROM mydata;
    after executing the above query the o/p I am getting is in the normal format like EMP_ID and EMP_NAME
    not according to my requirement like
    Emp Emp
    Id NameWhat are the results you reaally want? Do you want this?
    `   EMP_ID SPLIT_NAME
             1 John
               Smith
             2 Steve
               Jobs
             3 Larry
               AllisonIf so:
    SELECT  emp_id
    ,      REPLACE (emp_name, ' ', CHR (10))     AS split_name
    FROM      mydata
    ;The results above are 3 rows, not 6.
    What results would you want if emp_name contained 3 or more words? For example, if you add this to the sample data:
    SELECT 9 emp_id, 'Aung San Suu Kyi' emp_name FROM DUAL UNION ALL

  • Can you please help me to improve the performence of this query

    Select All Invoices cleared between date range
      SELECT bsak~prctr AS prfcntco
        cepct~ktext AS prfcnttx
        bsak~lifnr AS vendcode
        lfa1~name1 AS vendname
        bsak~bukrs AS compcode
        t001~butxt AS compname
        bsak~zterm AS paytrmco
        tvzbt~vtext AS paytrmna
        bsak~waers AS invcurre
        bsak~zbd1t AS paydays1
        bsak~belnr AS invnumbe
        bsak~buzei AS invlinnu
        bsak~wrbtr AS invamoun
        bsak~budat AS invpstda
        bsak~zfbdt AS invdueda
        bsak~augdt AS invpayda
        bsak~gjahr AS invfiscy
        bsak~zlspr AS zlspr
        t001~land1 AS land1
        bsak~projk AS contract
        rbkp~xblnr AS invsupnu
        rbkp~bldat AS creadate
        rbkp~cpudt AS cpudt
      INTO CORRESPONDING FIELDS OF TABLE list_aux
      FROM ( ( ( ( ( bsak INNER JOIN rbkp ON bsakbelnr = rbkpbelnr )
                     LEFT OUTER JOIN t001 ON bsakbukrs = t001bukrs )
                     LEFT OUTER JOIN lfa1 ON bsaklifnr = lfa1lifnr )
                     LEFT OUTER JOIN cepct ON bsakprctr = cepctprctr
                                          AND cepct~spras = sy-langu )
                     LEFT OUTER JOIN tvzbt ON bsakzterm = tvzbtzterm
                                          AND tvzbt~spras = sy-langu )
      WHERE bsak~bukrs IN company AND
            bsak~lifnr IN vendor AND
            bsak~zterm IN payterm AND
            bsak~augdt IN daterang AND
            bsak~projk IN contract.
      SELECT * FROM   rseg
               INTO   TABLE it_rseg
               FOR ALL ENTRIES IN list_aux
               WHERE  belnr = list_aux-invnumbe
               AND    buzei = list_aux-invlinnu
               AND    gjahr = list_aux-invfiscy.
      SORT it_rseg BY belnr buzei gjahr ASCENDING.

    Moderator message - Welcome to SCN
    Please see Please Read before Posting in the Performance and Tuning Forum before posting in this forum. there are some things you need to take care of first. - post locked
    Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
    Rob

  • Please Help me to solve this issue

    Hi,
    i am using JSF and Hibernate . and i want to pass some data from Jsf to data base... i hardcoded that and tried .. data is sending and retriving database side(model ) fine. my problem is the data from JSF is not passing to the bean.. i am new to JSF and i will summarize my procedure here
    1. i have two text boxes and a button inside my <h:form> once a button clicked the values of the text fields must send to java bean(it is not happening it seems). i added my code section below
    <h:form>
    <some static values here >
    <table cellpadding=1 cellspacing=0 border=0 rules=none bordercolor=e0e0e0 width=99%>
    <tr bgcolor="ffffff">
    <td width="150" valign=top bgcolor="ffffff" nowrap><font style="COLOR: 000000; FONT: 8pt/11pt verdana"><h:outputText value="#{labels.newVatRate}"/>:</td>
    <td valign=top bgcolor="ffffff" nowrap><font style="COLOR: 000000; FONT: 8pt/11pt verdana">
    <h:inputText styleClass="TextField" id="vatRateName" size="25" value="#{vatRates.vatRateName}"/><h:outputText value="Rate"/><h:inputText styleClass="TextField" id="rate" size="25" value="#{vatRates.rate}"/> <h:commandButton id="vatRatesSave" value="Add" action="#{vatRates.save}"></h:commandButton>
    </td>
    </tr></table>
    here save is a method in bean and rate abd vatRateName are strings inside bean
    my faces config is as like this
    <managed-bean>
    <description>
    Agency Information
    </description>
    <managed-bean-name>vatRates</managed-bean-name>
    <managed-bean-class>com.easymodelling.entity.VatRates</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    please resopnd this and help me

    Hi,
    thank u for your quick reply...
    i tried the way u said .. then it is not calling bean .. so do u know what may be the problem? for getting faces i did the following steps
    1. create a jsp page with jsf functionality
    2. create a bean
    3. edited faces config by adding the managed bean
    is there any thing more required ?
    then is there any good ide (light weight) for jsf ?

  • IPad2 update to iOS6 will no longer play UTube: All my favourites that were previously viewed and saved with my iPad2 will no longer play. They can't be played via Safari either SOLUTION PLEASE (buy iPad3 which solves the issue isn't an option)

    IPad2 has been updated to iOS6 and will no longer play UTube favourites. These are favourites that have been previously viewed on iPad2 therefore I know the device is capable of playing them. This upgrade is no longer allowing me to use the device for the reason I bought it.
    Apple, I'm feeling as though I've been conned.
    My mates iPad3 on iOS6 plays all the stuff my 2 will no longer play.
    UTube via safari won't play them, all Apps I've tried have the same problem, a red band stating this video can't be played on your device OR flash player required. Has anyone got a solution???? Please don't write stating you have the same problem, I just want solutions. Thanks

    https://itunes.apple.com/us/app/jasmine-youtube-client/id554937050?mt=8
    This app should solve your headache

  • NO Document for Goods Issue -Kindly help me in solving the issue

    Hi,
    I am getting the below error while doing post goods issue.and not generated acccounting document.kindly advice me.
    Material document 4900001022 does not include an accounting document
    Message no. M7082
    Diagnosis
    The system cannot find an accounting document for the material document 4900001022.
    Possible reasons for this are:
    The goods movement has no relevance to accounting. Therefore, the system did not generate an accounting document for the material document.
    The material document is a document that was posted before Release 2.1. Such documents must be converted so that the system can find the relevant accounting document.
    The procedure for the subsequent calculation of value is not active in your system. For further information, refer to the documentation on the program for valuating goods movements: RM07MWBU.
    Procedure
    Choose Continue and then choose another function.
    Find out when the material document was created. If the document was created prior to the Release changeover, ask your system administrator to carry out the conversion of the documents. The individual steps required for document conversion are described in the Release Notes for Release 2.1B.
    Thanks
    Sunitha

    Dear Sunita,
    Please check
    T. Code: OMS2
    Select your material type (from right hand side), and click: Quantity/ Value updating (frpm left hand side).
    Check whether the Box: value updated is checked or not. If this is not checked the material is not valuated.
    Also, check whether a relevant accounting document( In general, WL) is assigned the material document or not.
    Best Regards,
    Amit.
    Note: The best way is to cosult your MM-Consultant.

  • Hi all, please help me out with the issue...

    Im getting this error ...what should i do to clear this ??
    ORA-12012: error on auto execute of job 5103
    > ORA-02149: Specified partition does not exist
    > ORA-06512: at "SYS.DBMS_SYS_SQL", line 826
    > ORA-06512: at "SYS.DBMS_SQL", line 39
    > ORA-06512: at "SYSTEM.PR_MODIFY_BUFFER_PARTITION", line 16
    > ORA-06512: at line 1

    Rookie#007 wrote:
    Im getting this error ...what should i do to clear this ??
    ORA-12012: error on auto execute of job 5103
    > ORA-02149: Specified partition does not exist
    > ORA-06512: at "SYS.DBMS_SYS_SQL", line 826
    > ORA-06512: at "SYS.DBMS_SQL", line 39
    > ORA-06512: at "SYSTEM.PR_MODIFY_BUFFER_PARTITION", line 16
    > ORA-06512: at line 1
    Did you bother to find any info about the bold text (emphasis is mine) ?
    Aman....

Maybe you are looking for

  • Re: Syncing with new application - more info

    David, Let's eliminate the easy stuff first! ;-) 1. Double check your are modifying the correct file/directory. Do you see other changes to application files, or is this just specific to portal? 2. Check you are sync'ing to the correct server and app

  • How to copy only part of the music media folder and library to another Mac

    Dear friends, I run iTunes in Mac OS. The iTunes music media folder is now located in an external HD because it´s quite large (2T). The problem is that I´got a second Mac and I´d like to copy -in this second Mac, only part of my music using only its

  • LIV-Planned Del.Cost for Multiple Purchase order.

    Hi Gurus, I have following issue while doing LIV -T-code MIRO . Passing Planned del. cost (Imports -Custom Duty) for Multiple POs (Same Vendor) Checked following basics. 1.In Po Planned Del cost are maintained .(Custom Duty) 2.in MIRO -Selected Layou

  • Size of serialized Objects

    Hello everybody, When I serialize a object to a Byte Array the size of the Byte Array is not exactly the size of the object because of some meta data information. Is there any way there I can predict excatly the size that the Object will have when I

  • How to update a table containing BLOB?

    Hi, I'm trying to update two columns in a table. one is NUMBER and the other is BLOB Is there a way to do so in OCCI in a single operation ? the table looks like this: CREATE TABLE ACCUMULATORS (TARGET_SUBS NUMBER(9), ITERATOR NUMBER(9), NUMERATOR NU