FireDAC SQLITE:没有这样的表列:PRAGMA_TABLE_INFO [英] FireDAC SQLITE : No such table column :PRAGMA_TABLE_INFO

查看:102
本文介绍了FireDAC SQLITE:没有这样的表列:PRAGMA_TABLE_INFO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有firedac sqlite3的delphi rio 10.3构建应用程序

i'm building app with delphi rio 10.3 with firedac sqlite3

pragma函数无法与"SELECT COMMAND"一起使用:

pragma function not working with 'SELECT COMMAND' AS I Try Below:

procedure Tamdf.Button31Click(Sender:TObject);
begin
   MyFDQuery.Open('SELECT name FROM PRAGMA_table_info("DOCM")');
   ShowMessage(MyFDQuery.Fields[0].AsString);
end;

我收到错误消息:错误:没有这样的表列:PRAGMA_table_info.name"我做错了什么?

i receive ERROR message :"ERROR: no such table column: PRAGMA_table_info.name" what i did wrong ?

推荐答案

使用FireDAC,您可以对创建临时表"table_info"使用解决方法:

With FireDAC you can use workaround with create temp table "table_info":

MyFDQuery.Open(
  'DROP TABLE IF EXISTS table_info;' +
  'CREATE TEMPORARY TABLE table_info AS SELECT * FROM pragma_table_info("DOCM");' + 
  'SELECT name FROM table_info');

修改

我的环境:Delphi 10.3.2 Rio ,Win32,默认SQLite 3.28.0静态链接.没有特殊设置.

My environment: Delphi 10.3.2 Rio, Win32, default SQLite 3.28.0 statically linked. No special settings.

连接- TFDConnection 仅包含:

FDConnection1.Params.DriverID := 'SQLite';
FDConnection1.Params.Database := 'D:\TMP\TEST.db';

这篇关于FireDAC SQLITE:没有这样的表列:PRAGMA_TABLE_INFO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆