简体   繁体   English

在 delphi 网格中使用 rpad

[英]Use rpad in delphi grid

Use rpad in tdbgrid not working correctly.在 tdbgrid 中使用 rpad 无法正常工作。 In sql devleper work fine.在 sql 开发人员工作正常。 Any solution for this problem.这个问题的任何解决方案。

Select rpad('Lionel Messi',20,'.') as COL_1 from dual
union all
Select rpad('Cristiano Ronaldo',20,'.') as COL_1 from dual
union all
Select rpad('Pele',20,'.') as COL_1 from dual

Example:例子:

在此处输入图像描述

Looks like your Sql developer is using a fixed-pitch font, whereas your DBGrid isn't.看起来您的 Sql 开发人员使用的是固定间距字体,而您的 DBGrid 不是。 Set your DBGrid to use a fixed-pitch font like Courier New.将您的 DBGrid 设置为使用像 Courier New 这样的固定间距字体。

In any case, for future reference, it is not very sound practice to use SQL on your SQL Server to do output formatting by using eg RPad(), especially when it is applied to every single row of a result set - it pointlessly consumes server resources and network bandwidth for something that should be left to the client to do.在任何情况下,为了将来参考,在您的 SQL 服务器上使用 SQL 来执行 output 格式并不是非常合理的做法,特别是当它通过使用每个例如 RPad()资源和网络带宽应该留给客户端去做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM