Output of query gives unwanted whitespace

Hi
A client asked to create a small application in CF. I have no
experience with cf and now I have a problem.
I'm querying a database and I want to put the results of the
query on screen. Inititally I used the cfoutput tag to output the
entire query to the screen, but it gives me a white space between
the different records. I don't want that since it's html code that
I'm putting on the screen.
I also tried looping through the query myself with cfloop and
then use the output tag
How can I prevent the white space between the different
records ?
thx !

Let me check if I get you right. So, you are actually trying
to save your HTML by parts into different rows in your db. After
that, you extract all the rows and use the cfloop to display all
the rows, which will sum the parts of your HTML. You should
consider 2 things:
1.) Basing on your query pagina_inhoud, I don't see any ORDER
BY clause. I think when your query doesn't have an ORDER BY,
sometimes row 2 can come first before row 1. In this case, there is
a possibility that your HTML might be displayed incorrectly. I
think you should consider the ordering/sorting of your rows when
your data is returned from db. I mean, you should put another field
which will determine the order/sort of the returned rows so as not
to misplace some parts of your HTML when outputting the data.
2.) Another thing is the way you output your data. The
problem is when there are spaces before and after your
<cfoutput> tag as shown below:
[spaces here]
<cfoutput>#pagina_inhoud.inhHtml#</cfoutput> [spaces
here]
The format above can also cause your HTML code to have spaces
in between. In order to avoid this, make sure there are no spaces
on those part of your code. To do this, use cfsetting tag in your
output as shown below.
<cfsetting enableCFoutputOnly = "yes"> <!--- this
will block any HTML output(including spaces) after this tag and
those that are outside the cfoutput tags --->
<cfloop
query = "pagina_inhoud"
startRow = "1"
endRow = "#pagina_inhoud.RecordCount#">
<cfoutput>#pagina_inhoud.inhHtml#</cfoutput>
</cfloop>
<cfsetting enableCFoutputOnly = "no"> <!--- change
back to "no" to make sure that HTML outputs after this tag are
displayed --->

Similar Messages

  • Select query gives error in Code inspector and extended program check

    Hi,
    I have a query .
    SELECT pernr
      FROM pa9100
      INTO TABLE t_nca_tab
      WHERE endda EQ c_date AND
      z_nca_required EQ c_yes.
    This query gives me an error in Code inspector like :
    Large table pa0001: No first field of table index in WHERE  condition
    I have one more query that gives error in extended program check
    SELECT SINGLE stell ename
          INTO (g_stell, g_name)
          FROM pa0001
          WHERE pernr EQ wa_nca_tab-pernr AND
                endda EQ c_date.
    The warning says:
    *In "SELECT SINGLE ...", the WHERE condition for the key field "SEQNR" does not
    test for equality. Therefore, the single record in question may not be unique.*
    Its too urgent.
    Please reply.
    Regards,
    Binay.

    The first field is PERNR .. so if UR not giving pernr it will fetch
    all the data from the said table and between the given dates ..
    Check if this is your requirement ...
    write the select as ...
    where r_pernr is a range ...
    SELECT pernr
    FROM pa9100
    INTO TABLE t_nca_tab
    WHERE pernr in r_pernr  <----
                 endda EQ c_date AND
                 z_nca_required EQ c_yes.
    As UR using select single it's expecting to use all the key
    fields in the where condition ...
    U can ignore this warning message

  • How to output a query results into a text file

    How to output a query results into a text file instead of outputing it to the screen..
    is there a way for us to write a SQL query which specifies to output the query results to a text file.
    Pls let me know how to do it
    Thanking u in advance
    regards
    Muraly

    Muraly,
    If you are using SQL*Plus 8.1.6 or later, you can also spool output to a file in HTML format, eg
    SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON
    SPOOL c:\temp\report.html
    SELECT DEPARTMENT_NAME, CITY
    FROM EMP_DETAILS_VIEW
    WHERE SALARY>12000;
    SPOOL OFF
    SET MARKUP HTML ENTMAP OFF
    In iSQL*Plus 9.0.1 (the browser-based interface to SQL*Plus) onwards, you can also send the HTML output to a new web browser window, or an html file -- much easier than the command line method.
    Alison

  • Change display Date format from 06.2011 to june 2011 in output of Query

    Hi All,
                Change display Date format from 06.2011 to june 2011 in output of Query  Execution. i used time charcteristics 0calmonth in query, output display is coming 06.2011, i want to display output in june 2011 format, anyone tell me how to convert this Date format.

    Hi Nandish,
    as tibollo said you just need to mark 0CALMONTH with text in RSD1.
    Kindly note that you don't need to do data load for this object.
    It will automatically derive by system.
    Just change the Info object 0CALMONTH in RSD1, Go to Master Data/text column and check mark on with text.
    Then activate it.
    Regards,
    Ashish

  • Outputing a query

    I thought I used to be able to do this but since I have not done it for awhile I forgot how to do it.
    I have a query result that looks like this:
    Categories    Course_Name  Course_No  Course_level
    Language     English             E100001        Intro
    Language     English             E20001        Intermediate
    Language     English             E30001        Advance
    Language     Spanish           S10001        Intro
    Language     Spanish           S20001        Intermediate
    Language     Spanish           S30001        Advance
    Art                 Piano               P11001       Intorduction
    Art                 Piano               P21001       Intermediate
    Art                 Piano               P31001       Advance
    I need to output this query in a table so when user look at this table, category will only showed once:
    Categories    Course_Name  Course_No  Course_level
    Language     English             E100001        Intro
                         English             E20001        Intermediate
                         English             E30001        Advance
                         Spanish           S10001        Intro
                         Spanish           S20001        Intermediate
                         Spanish           S30001        Advance
    Art                 Piano               P11001       Intorduction
                         Piano               P21001       Intermediate
                         Piano               P31001       Advance
    I used table but I can' get it  right, can anyone help, thank you!!
    <table>
      <tr>
         <td>Category</td>
         <td>Course Name</td>
         <td>Course Number</td>
         <td>Course Level</td>
       </tr>
      <cfquery name="GetCourses datasource="#dsn#">
       select * from program 
       order by category
      </cfquery>
    <cfoutput query="GetCourses">
      <cfquery name="GetCategory datasource="#dsn#">
       select distinct categorry from program
      </cfquery>
      <tr>
         <td>#GetCategory.Category#</td>
         <td>#Course_Name#</td>
         <td>#Course Number#</td>
         <td>#Course Level#</td>
       </tr>
    </cfquery>    
    </table>

    <cfoutput query="GetCourses" group="Categories">
         #Categories#
         <cfoutput>
              #Course_Name# #Course_No# #Course_Level#
         </cfoutput>
    </cfoutput>

  • HT201365 doesn't keeping this on give unwanted people information about my whereabouts and thieves infor that I'm not at home

    Doesn't keeping on Find My I Phone give unwanted people access to my whereabouts and thieves information as to when I'm not home? Isn't this dangerous for personal security?

    they can only access it if they have your apple id log in details.

  • Same Cursor Output - Different Query

    I am writing 2 cursors.
    Cursor 1 which gives me A,B,C,D columns as output.
    Cursor 2 gives me same A,B,C,D columns as output.
    But the Logic to calculate inside the cursor Select Query is different.
    I need to insert both A,B,C,D from Cursor 1 and Cursor 2 in same table by looping. Just curious to know do we have any way to insert the data by using same loop. Know it is impossible. Giving a try for any other solution.
    Because I have 5 different cursors with same columns to be fetched and to insert in same table.
    Planning to write a common insert script.

    select a,b,c,d from ... query 1 where code in ('AB','CD')...
    UNION ALL
    select a,b,c,d from ... query 1 where code = 'EF'...
    UNION ALL
    select a,b,c,d from ... query 1 where code NOT IN ('GH')
    But if only Code 'AB' is present, will that be fine to execute 'EF' query and 'GH' query also? All queries will have a minimum of 10 tables joins within 2 schema. If we write the condition before it will skip executing the 'EF' query and 'GH' query.
    Which option is better?I do not see any problem with including the CODE conditions in the Select queries until the tables in the query contains the CODE column. If there is no table with CODE column, then you may have to include it somehow (Assuming different tables for each query).
    Fine or not, it is for you to decide. If you use UNION/UNION ALL, all the queries shall be executed and the data, if present, shall be inserted into the target tables.
    Moreover
    select a,b,c,d from ... query 1 where code in ('AB','CD')...AND
    select a,b,c,d from ... query 1 where code NOT IN ('GH')Do you not think it will return Duplicate records? Query where CODE NOT IN ('GH') would include CODES 'AB', 'CD', right? And using UNION ALL does not eliminate duplicates. So, if you have a Primary/Unique key, you are almost certain to encounter an error. Isn't it?
    As an alternative, I think, you can use the Multitable Inserts as below:
    INSERT ALL|FIRST         ----------> Use as suitable. ALL will process each condition irrespective of its TRUTH value; FIRST will stop evaluating the conditions after first match. If you do not specify, Default is ALL.
      INTO target_table (column_list)
    VALUES (column_list_from_select_stmt)
    select column_list, CODE
      from source_table(s);For more information on MultiTable inserts, Read Here.
    Examples here.

  • Output select query in OLEDB Command

    Hi I am trying to write a simple output query to get the Count of rows  in OLE Db Commnad Adavnced editor and getting error. Please help!
    Declare @Count INT;
    Select @Count(*) AS ? FROM <tablename>WHERE Column 1  =?  AND Column2 = ?
    Please help as this is my first project!
    Thanks in advance.

    Not sure what went wrong, but the typical pitfall is not mapping the parameters properly, so see this:
    http://blogs.msdn.com/b/msdnts/archive/2006/11/17/amazing-ssis-parameters-in-execute-sql-task.aspx
    Arthur My Blog

  • Bug: Letterbox effect gives unwanted high brightness and low contrast

    When I apply the Letterbox effect, it looks good in the preview, but the result is a barely visible clip, all whited-out, letterboxed but with extremely low contrast and high brightness (applied to the whole screen, including the black letterbox bars). Some other effects, like Fog and Aged Film, produce the same unwanted results.
    What's going on?
    I am using iMovie HD 6.0.2 on a MacBook. Any help is appreciated.

    Yes my particular issue is not like yours. However, there have been many other laptop users experiencing similar problem to yours after 3.10 kernel. Mostly it seems to be bumblebee users that experience your problem with the blank screen. We do know that nvidia have yet to make their official drivers work with kernel 3.10 and up. The drivers in the Arch repository have been patched to work with 3.10. From what I have seen, this also only seem to be affecting laptops with newer nvidia gpu's. I fear there is not much to do with this problem until nvidia give official 3.10 kernel support.
    My suggestion would be to stick with 3.9.9 kernel and the drivers that work with it, and don't upgrade those packages until nvidia has addressed these issues. If you have a look at the nvidia forums you will see quite a number of topics mentioning black screen when starting x on 3.10 kernel, and also a thread for the system dying. Reading some of the threads there may help you keep up to date on whether or not the issue seem to be solved.
    https://devtalk.nvidia.com/default/board/98/

  • D51wkdmp.exe output format query

    When i run d51wkdmp.exe to get the report details ,the syntax i see is
    d51wkdmp <Workbook_Name> <Output_File> <DB|FS> <Connect_String> <Eul_Schema> -f
    and the example given is "d51wkdmp "Video Tutorial Workbook" video.txt DB disco/[email protected] disco "
    where video.txt is the output file.can i create an xml output file i.e Can i give the cmd like
    "d51wkdmp "Video Tutorial Workbook" video.cml DB disco/[email protected] disco "?
    Will it give me output in an xml format or .txt is the only output format that can be used?

    Hi
    The utility will only give you output in text format I'm afraid. It's just a quick way of seeing what a workbook is up to.
    Best wishes
    Michael

  • Af:query 'Hiding Unwanted Operators in Advanced mode having blank selection

    Hi,
    This is regarding 'Hiding Unwanted Operators in Advanced mode of af:query Component', I have followed the post by Jobinesh (http://jobinesh.blogspot.com/2013/01/prart-2-hiding-unwanted-operators-in.html)
    The attribute is non-default attribute and when we add the attribute from 'Add Fields' section it will be having blank selection option even if I have added below two lines under 'ViewAttribute' tag.
    <CompOper Name="Name" ToDo="-1" Oper="ISBLANK" MinCardinality="0" MaxCardinality="0"/>
    <CompOper Name="Name" ToDo="-1" Oper="" MinCardinality="0" MaxCardinality="0"/>
    Kindly suggest:
    1. How to remove blank selection operator.
    2. How to set particular operator as default operator in XML.

  • Output CFC query to Flex app

    I have a CFC which simply calls the DB and returns the
    results to the Flex app.
    CFC:
    <cfcomponent>
    <cffunction name="runQuery" output="false"
    access="public" returntype="Query">
    <cfquery name="qry_login" datasource="EWPROJ">
    SELECT *
    FROM ROBERTTEST
    </cfquery>
    <cfreturn qry_login>
    </cffunction>
    </cfcomponent>
    Simple enough.......
    Here is my Flex file...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="initApp();">
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    [Bindable]
    private var qry_result:ArrayCollection;
    private function initApp():void //first thing to load
    callCFC.runQuery()
    private function resultHandler(event:ResultEvent):void
    var qry_result:ArrayCollection = new ArrayCollection();
    //New Array Object called p1
    qry_result.source=event.result as Array;
    trace(qry_result);
    ]]>
    </mx:Script>
    <mx:RemoteObject id="callCFC" destination="ColdFusion"
    source="CFIDE.samples.FlexToCFC.CFC.myCFC"
    result="resultHandler(event)"
    showBusyCursor="true" />
    </mx:Application>
    my problem is within the [resultHandler] I want to simply
    create a variable that will contain my results of the object I
    passed so I can trace it to the screen.... I know that the object
    is returning correctly, by tracing result.event. What am I doing
    wrong here, cause it shows nothing.
    I'm guessing that my problem is that I am not putting the
    object into some sort of array or string where I can access it...
    How do I do this correctly? Thanks everyone.

    Ahhh,,, yes, I appologize. I will make better headings next
    time.. Okay, I tried your solution and it printed out what I wanted
    and more. SWEET!! Now I think all I need to do is put it in an
    associated array so I can reference things better. Not sure yet,
    but I'll play with it. Thanks again... Genius! BTW, here is the
    output when I ran it:
    mx.collections::ArrayCollection)#0
    filterFunction = (null)
    length = 6
    list = (mx.collections::ArrayList)#1
    length = 6
    source = (Array)#2
    [0] (Object)#3
    NAME = "Rob Capilli"
    TYPE = "Male"
    [1] (Object)#4
    NAME = "Meatball"
    TYPE = "Cat"
    [2] (Object)#5
    NAME = "Sanket"
    TYPE = "male"
    [3] (Object)#6
    NAME = "Sarah"
    TYPE = "Female"
    [4] (Object)#7
    NAME = "1"
    TYPE = "1"
    [5] (Object)#8
    NAME = ""
    TYPE = ""
    uid = "21B5BECE-6A2E-6940-9543-E830E43DAAFA"
    sort = (null)
    source = (Array)#2

  • Named query gives a null argument exception in JPQL

    Hi all,
    I need your help with a named query which i have which returns a org.apache.openjpa.persistence.ArgumentException: null .
    Here is my named query:
    @NamedQuery(name="user_deactivateUser", query="update UserImpl u SET u.bisdeleted=1,u.dtupdatedate=SYSDATE, u.dtdeletedate=SYSDATE where u.nID=?1" Now when i call this query in my method it gives an null pointer exception at q.executeUpdate().
    public void doDeactivateAllUsers(int userID) throws ServiceException{
      EntityManager em = null;
      em = BaseDAO.getEntityManager();
      Query q = em.createNamedQuery("user_deactivateUser");
                   q.setParameter(1,userID);
                   int count = q.executeUpdate();here is the full stack trace of this exception.
    <openjpa-1.2.1-r752877:753278 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: null
         at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:814)
         at org.apache.openjpa.kernel.QueryImpl.updateAll(QueryImpl.java:884)
         at org.apache.openjpa.kernel.DelegatingQuery.updateAll(DelegatingQuery.java:573)
         at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:336)
         at com.forrester.companyadmin.service.DeactivateUserService.doDeactivateUser(DeactivateUserService.java:98)
         at com.forrester.companyadmin.service.DeactivateUserService.doDeactivateAllUsers(DeactivateUserService.java:225)
         at com.forrester.companyadmin.controller.DeactivateUsersController.action(DeactivateUsersController.java:376)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         at javax.faces.component.UICommand.broadcast(UICommand.java:325)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.forrester.companyadmin.filters.CompanyAdminFilter.doFilter(CompanyAdminFilter.java:102)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
         at java.lang.Thread.run(Unknown Source).
    Can someone let me know if there is anything wrong in the way iam passing these parameteres
    Edited by: user8769643 on Mar 19, 2010 7:37 AM

    i got this working. I am passing dtupdate=SYSDATE which is incorrect. i added one more parameter "q.setParameter(3,new java.util.Date())" to pass today's date and it worked.
    Thanks

  • EP6 and BW Query iView - unwanted logon screen - Help please

    Hello,
    I have a BW Query iView.
    I noticed that EP6 authentication works for query contents (logon method to BW is UIDPW plus user mapping) but I get an unwanted auth login window as soon as static content arrives from BW.
    I mean... the query is coming from http://mybwhost:8000/sap/bw/BEx (and no auth logins are shown) but when requests for static content like
    http://mybwhost:8000/sap/bw/Mime/BEx/Icons/checked.gif start then I get one.
    I think is a BW setting (shall /sap/bw/Mime/* be set without authentication?)
    Any further hints are welcome.
    Vitaliano

    READ SAP NOTE 593640 (Logon Screen when calling BW Web Application in portal)

  • ABAP Coding Help for Subtotal type output - SAP Query

    I've created a SAP Query to display a stock overview by storage type using the table LQUA.
    The output that I get is:
    Material
    Description
    Plant
    WHN
    SLOC
    Storage Type
    Batch
    GR Date
    Available stock
    2057 
    STRAWBERRIES
    BP01
    100
    0088
    200
    0001081766
    17.06.2014
    225
    2057
    STRAWBERRIES
    BP01
    100
    0088
    200
    0001081766
    17.06.2014
    720
    2061
    VOSTIZZA CURRANTS
    BP01
    100
    0088
    200
    0001081272
    17.06.2014
    1,000
    2061
    VOSTIZZA CURRANTS
    BP01
    100
    0088
    200
    0001081272
    17.06.2014
    1,000
    2061
    VOSTIZZA CURRANTS
    BP01
    100
    0088
    200
    0001081272
    17.06.2014
    1,000
    2061
    VOSTIZZA CURRANTS
    BP01
    100
    0088
    200
    0001081272
    17.06.2014
    1,000
    I can get a subtotal for each Material, batch and GR date combination by using the ALV grid functionality.
    This method adds too much clutter to my query and can't be easily manipulated in Excel afterwards for what I want. I want to condense the results down and just keep a cumulated available stock, e.g:
    Material
    Description
    Plant
    WHN
    SLOC
    Storage Type
    Batch
    GR Date
    Available stock
    2057 
    STRAWBERRIES     
    BP01
    100
    0088
    200
    0001081766
    17.06.2014
    945
    2061
    VOSTIZZA CURRANTS
    BP01
    100
    0088
    200
    0001081272
    17.06.2014
    4,000
    How can this be done?

    Hi,
    Please try to use STATISTICS in your SAP Query. you can sort and add your value based on condiiton then it will be show you collect value in SQ01.
    Please see the below documents for STATISTICS
    https://help.sap.com/saphelp_erp2004/helpdata/en/d2/cb4263455611d189710000e8322d00/content.htm
    Regards,
    Prasenjit Mishra

Maybe you are looking for

  • Error-lsmw -in the step specify file

    HI ALL, Iam struck up in lsmw . I doing for the transaction "mb11" , opening inventory balance . when i do the step " SPECIFY FILE " , iam getting error like "specify a logical path " . I have choosed a file on the local pc . what would be the proble

  • Why won't my Mac Mini detect my Panasonic Mini DV camera?

    Hi My windows7 laptop will pick it up and I can user Windows movie maker.  However my Mac is not even recognising I have it connected (yes I definetly did and tried 3 different cables). Any ideas? Its a Panasonic NV-GS27

  • "An Error has Occurred. The request timed out." - OS X 10.8.2

    I have Mountain Lion OS X 10.8.2 installed on my 15" Macbook Pro (Mid-2010). Upon initiating Software Update, the App Store window appears > 'Checking for Updates'  > results in: "An Error has Occurred.  The request timed out." (after approximately o

  • Erasing a config and vlan.dat file in Catalyst 4507R Switch

    Hi, I am unable to erase the configuration from Catalyst 4507R Switch.When i do "write erase" and reload the switch,the configuration still remains on the switch. Switch1#write erase Erasing the nvram filesystem will remove all configuration files! C

  • How to execute Sql command behind the submit button?

    Hello Dear, i design a Visual JFS page with 1 text box, 1 dropdown list, 1 date picker and 1 submit button. i have a database connected to my project with hibernate framework. now i want that whatever i change to textbox, dropdown list & date picker,