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 someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is 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:
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2008-12-10 - ChengappaCB
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.