问题标签 [firedac]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
2736 浏览

delphi - TFDTable 中的降序排序导致重复行

在 LDW 模式下使用 TFDTable 时,对字段进行降序排序会导致重复行。例如:

显示正确的结果集,没有任何重复。如果我将IndexFieldnames 更改为 'PERS_NAME:D',则视图返回的每条记录都会显示两次或树次。

如何避免这些重复?它仅在按降序对表格进行排序时发生,无论我使用哪个字段进行排序。

更新: 您可以在 github 上找到重现问题的示例项目:https ://github.com/cytrinox/firedac-sort-issue 或通过https://github.com/cytrinox/firedac-sort-issue下载项目/archive/master.zip

0 投票
0 回答
753 浏览

delphi - datasnap REST 客户端中的记录丢失

我有一个 DataSnap/REST 服务器和客户端应用程序。

服务器有一种方法可以返回一个或多个包含一定数量记录的数据集,但是当此记录数量大于 50 时,客户端应用程序不会接收前 50 条记录。

我已经调试了服务器应用程序并且 SQL 语句是正确的(我已经从 IBExpert 执行了它并返回了正确的记录数)。

我用过 XE7、FireDAC 和 Firebird。

进入服务器应用程序我有这个方法来返回一个数据集

进入客户端应用程序,用于接收记录,我有这个代码

我认为这是一些配置,但我找不到什么。

任何想法?谢谢

0 投票
2 回答
152 浏览

oracle - Getting an cursor as result when using begin and end block

I'm trying to use the results of multiple slq statements for one result(cursor) in the firedac query editor:

Sql Command in editor

The above code wil not work as an select and begin and end block can not be combined. Has Anyone sugestions for a working code?

0 投票
1 回答
1942 浏览

mysql - 在 FireDac TTable 中过滤日期

我在使用 FireDac 中的 TTable 过滤日期字段时遇到问题。

MySQL/InnoDB 中的数据库。该字段的类型为日期。

我用来设置过滤器的代码是

每次我在设置过滤器时遇到错误:“EConvertError with message 'Could not parse SQL TimeStamp string'”或过滤器无法找到任何记录。

以上格式适用于我当前的区域设置。我也试过'yyyy-mm-dd'。我已经尝试过带引号和不带引号。

0 投票
1 回答
209 浏览

delphi - Firedac fetches oudated values within a few seconds after update

I'm currently maintaining a Client / Server (over TCP) system. The server can be accessed by multiple clients (few dozens at most) so i set up a connection pooling like FireDAC allow us to do. It works just fine in most cases. I'm still having one issue :

When one of my client applications call a "writing" function ( nb : a function that implies writing to the database ) and then immediately after call for a reading function on the same ressource, it gets outdated value ( the value before the previous update ). This result goes on for a few seconds/hundreds of milliseconds, then the results come back good, as if the process wasn't completely over on the driver layer. The same behaviour is observed with an INSERT query.

The weird thing is that the TFDQuery i'm using to update the DB (through it's .Post function) return quite quickly as if the process was over. I am not using amNonBlocking parameter but the default value (amBlocking). I think the natural behaviour would be that the .Post function only return when the data has been fully updated but apparently not. Is that a FireDac issue? is that a Jet engine issue? Is using RecordLocking the way to go? I believe it's risky as I need to keep the same behaviour on 4 DBMS including MS-ACCESS. I'm currently using Delphi XE6 with a MS-ACCESS database but my app needs to be able to run on Oracle, MS SQL and PostgreSQL too.

Thank you very much

0 投票
1 回答
1962 浏览

delphi - Params.Size 设置不正确

情况如下:随着从 XE3 (anyDAC) 升级到 XE7 (Firedac),我们突然在 Informix 上更新超过 255 个字符的字符字段时遇到问题。

我们现在得到错误:

'[FireDAC][物理][ODBC]-345。对于变量 [#1],数据太大。Max len = [256], actual len = [1000] 提示:将 TFDParam.Size 设置为更大的值'

问题是我们将缓存更新模式与'applyupdates'结合使用,所以我们没有任何参数要设置(PK除外)......

仅供参考:我们要更新记录的表定义:

FDQuery 组件由以下查询组成:

我们不使用持久字段或任何东西。

0 投票
1 回答
1278 浏览

delphi - 使用 FireDac TFDCommand 对 autoinc 字段执行插入操作并检索生成的值

我正在尝试在带有 autoinc 字段的表中执行插入操作,为此我正在使用 FireDac TFDCommand。因此,记录已成功插入到 db 中,但是如何获取 autoinc 字段的生成值?

Obs:TFDConnection 让我得到了最后一个自动生成器。值,但该表会生成两个 autoinc 字段。我可以获取主键并选择 db 中的记录,但这将是对 db 的另一个调用,我需要阻止它。

任何想法?

0 投票
0 回答
734 浏览

delphi - TFDUpdateSQL 不在 Datasnap 服务器上发布更新

我正在尝试设置一个通过 TFDQuery 对象提供数据的 DataSnap 服务器。该查询从多个表中提取数据,因此我需要一个 TFDUpdateSQL 对象将数据发布到数据库。

我已经设法将数据提供给 DataSnap 客户端,但是当我通过 ClientDataSet 应用更新时 - 它似乎不会影响数据库。

我尝试了以下测试:

  1. TFDQuery,一个表查询,没有TFDUpdateSQL 对象,更新工作
  2. TFDQuery,带有一个表查询和一个TFDUpdateSQL 对象,更新不起作用
  3. TFDConnection + TFDQuery + TFDUpdateSQL 到一个独立的 VLC 应用程序,具有多个表查询,更新工作。

是否有可能 TFDUpdateSQL 对象不能用于通过 DataSnap 更新具有多个表的查询...?

德尔福XE7

Windows 7的

0 投票
0 回答
254 浏览

delphi - Custom Delphi action class

I wrote some basic TAction classes (like TDataSetAdd or TDataSetReOpen) and it works like a charm. Now I tried to write an action to handle commit of a transaction but for some reason it behaves somewhat unexpectedly. "HandlesTarget" function never shows my transaction component as an object at all although it is on the form? What am I missing? Thanks in advance.

0 投票
1 回答
1714 浏览

mysql - 为什么插入记录时出现“重复条目”异常?

我收到此错误消息:

[FireDAC][Phys][MySQL] 键 'PRIMARY' 的重复条目 '1111'

尝试将数据插入数据库时​​。数据库中唯一的数据是一个主键为“0000”的元组,所以我知道主键不是另一个键的副本。数据已正确插入数据库,那么当主键不重复时,有什么方法可以阻止错误弹出?

我正在使用 Delphi XE7、MySQL 6.2FDConnectionFDQuery. 我的代码是: