Everything else that doesn't fall into one of the other PB categories.
swhite
Enthusiast
Posts: 798 Joined: Thu May 21, 2009 6:56 pm
Post
by swhite » Tue Sep 02, 2025 4:21 pm
Hi
When I use the CheckDatabaseNull() function I always see the following message in the console window:
row number -1 is out of range 0..-1
I am using Postgres as the database. Is this an error message of some kind or can it be safely ignored? The function is working correctly so I am wondering what is the meaning of the message.
Simon
Simon White
dCipher Computing
jacdelad
Addict
Posts: 2010 Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa
Post
by jacdelad » Wed Sep 03, 2025 5:18 am
Show us the code which shows the problem.
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
swhite
Enthusiast
Posts: 798 Joined: Thu May 21, 2009 6:56 pm
Post
by swhite » Wed Sep 03, 2025 8:40 pm
Code: Select all
Procedure.i dBRecord(Map tmRec.dBValue(),tnDb.i=#dCDatabaseNo)
Define ln.i
ClearMap(tmRec())
For ln=0 To DatabaseColumns(tnDb)-1
Select DatabaseColumnType(tnDb,ln)
Case #PB_Database_String
If CheckDatabaseNull(tnDb,ln)
tmRec(DatabaseColumnName(tnDb,ln))\ValueS = ""
Else
tmRec(DatabaseColumnName(tnDb,ln))\ValueS = GetDatabaseString(tnDb,ln)
EndIf
tmRec()\Type = "S"
Case #PB_Database_Long, #PB_Database_Quad
If CheckDatabaseNull(tnDb,ln)
tmRec(DatabaseColumnName(tnDb,ln))\ValueI = 0
Else
tmRec(DatabaseColumnName(tnDb,ln))\ValueI = GetDatabaseLong(tnDb,ln)
EndIf
tmRec()\Type = "I"
Default
If CheckDatabaseNull(tnDb,ln)
tmRec(DatabaseColumnName(tnDb,ln))\ValueD = 0.00
Else
tmRec(DatabaseColumnName(tnDb,ln))\ValueD = GetDatabaseDouble(tnDb,ln)
EndIf
tmRec()\Type = "D"
EndSelect
Next
FinishDatabaseQuery(tnDB)
ProcedureReturn ln
EndProcedure
Simon White
dCipher Computing