Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Databases
»
[Sqlite3]How to get tabe info?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Lazarus Bugfix Release 4....
by
Bart
[
Today
at 02:15:36 pm]
Interesting video
by
440bx
[
Today
at 10:54:16 am]
If FileExists(
by
lgrfbs
[
Today
at 10:45:03 am]
IndySecOpenSSL is now ava...
by
LeP
[
Today
at 10:22:50 am]
TDWEdit
by
Ed78z
[
Today
at 10:20:58 am]
Strange Behaviour at Runt...
by
andrew Bubble
[
Today
at 09:54:40 am]
FPC Debug mode releases [...
by
Martin_fr
[
Today
at 09:22:25 am]
Implementing an Elo ratin...
by
paule32
[
Today
at 08:43:20 am]
Death of the Power User
by
wp
[
Today
at 01:29:18 am]
how to add a ForEach call...
by
mas steindorff
[June 11, 2026, 11:42:24 pm]
How to define a type of ...
by
PascalDragon
[June 11, 2026, 09:24:45 pm]
Gitlab site history date.
by
Martin_fr
[June 11, 2026, 08:46:17 pm]
Arkanoid
by
lazarusprogrammer
[June 11, 2026, 08:14:21 pm]
[New Component] ExtTabCtr...
by
d7_2_laz
[June 11, 2026, 05:01:49 pm]
Conscious Artificial Inte...
by
schuler
[June 11, 2026, 04:39:11 pm]
Pdf Viewer in Pascal
by
Tomxe
[June 11, 2026, 03:52:37 pm]
Eye Candy TESCheme
by
Dzandaa
[June 11, 2026, 11:51:52 am]
P.I.S.S. a PlugIn-framewo...
by
cdbc
[June 11, 2026, 11:35:42 am]
I found an actual use for...
by
marcov
[June 11, 2026, 11:35:23 am]
Who can explain this ?
by
J-G
[June 11, 2026, 11:30:42 am]
XLibre, finally and fortu...
by
Fred vS
[June 11, 2026, 06:20:26 am]
WEBP, no DLLs
by
Tomxe
[June 11, 2026, 04:04:37 am]
Discipline your AI coding...
by
440bx
[June 11, 2026, 02:44:06 am]
Version 4.8 was recently ...
by
Ten_Mile_Hike
[June 11, 2026, 01:43:17 am]
FPC Unleashed (inline var...
by
Fibonacci
[June 11, 2026, 12:03:13 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [Sqlite3]How to get tabe info? (Read 1607 times)
Borneq
Full Member
Posts: 248
[Sqlite3]How to get tabe info?
«
on:
January 03, 2020, 01:10:52 pm »
Get all tables (but without system tables):
SELECT * FROM sqlite_master where type='table'
but how to get column names and types of columns?
Logged
Borneq
Full Member
Posts: 248
Re: [Sqlite3]How to get tabe info?
«
Reply #1 on:
January 03, 2020, 01:58:07 pm »
Code: Pascal
[Select]
[+]
[-]
rc
:
=
sqlite3_prepare_v2
(
pDb
,
'pragma table_info (sqlite_master)'
,
-
1
,
@
stmt
,
nil
)
;
if
rc
=
SQLITE_OK
then
begin
//will continue to go down the rows (columns in your table) till there are no more
while
sqlite3_step
(
stmt
)
=
SQLITE_ROW
do
begin
writeln
(
sqlite3_column_text
(
stmt
,
1
)
)
;
writeln
(
sqlite3_column_text
(
stmt
,
2
)
)
;
//do something with colName because it contains the column's name
end
;
end
;
after
https://stackoverflow.com/questions/947215/how-to-get-a-list-of-column-names-on-sqlite3-database
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Databases
»
[Sqlite3]How to get tabe info?
TinyPortal
© 2005-2018