Tags:
create new tag
, view all tags

Question

Hi, I am using DatabasePlugin. I am able to query the MS SQL table and get the data out but when displayed, it seems to be appended with a space. For example, when I run the command

%DATABASE_SQL{description="staff" sql="select StaffName from staffdetails where staffid='2'" format="$StaffName"}%

from the database:

StaffId Staffname
1 Abc
2 Xyz

The output is Xyz .(with a space after Xyz) and not just Xyz. This will create problems when I want to do some operations on the retrieved data (like compare etc). What could be the problem and how do I get around it ?

Environment

TWiki version: unspecified
TWiki plugins: DefaultPlugin, EmptyPlugin, DatabasePlugin
Server OS: WindowsXP
Web server: Apache 1.3.39
Perl version: 5.008008 (cygwin)
Client OS: Windows XP
Web Browser: IE 6
Categories: Plugins

-- ChengappaCB - 10 Dec 2008

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Looks like I jumped the gun. It was not the space but the newline. I used the separator parameter and changed the command to:

%DATABASE_SQL{description="staff" sql="select StaffName from staffdetails where staffid='2'" format="$StaffName" separator="$nop"}%

Now it seems to be working fine. But I have another problem mentioned in UseDatabasePluginSpreadsheetPlugin

-- ChengappaCB - 10 Dec 2008

 
Change status to:
Topic revision: r2 - 2008-12-10 - ChengappaCB
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.