Get total records of DB in Uplan...Uproduce

60 views
Skip to first unread message

DD.DevSolution

unread,
Mar 3, 2025, 11:36:41 AM3/3/25
to XMPie Interest Group
Hi everyone
i'm trying to get the total number of record display in Indesign

I've created a simple "user view"
MySelect
SELECT [ID]
FROM [XMPDBHDS].[XMPieHDSSchema23272].[Sheet1]
and a Function that count row of that View
RowCount([MySelect])

It appear clearly the right number in indesign ( preview )

But when i sent a BD trough Uproduce, i've got this Warning
User View " MySelect  ": Some fields that are fetched by the query SELECT [ID] FROM [XMPDBHDS].[XMPieHDSSchema12345].[Sheet1] are not defined in the Plan and hence cannot be used.
The fields are: ID. 

I don't understand because ID is theres in the plan schema and is full of data
AND the result appear in the Indesign Preview  

What i'm missing ?

Thanks

west-digital.fr

unread,
Mar 3, 2025, 11:49:33 AM3/3/25
to XMPie Interest Group
Hello,

I think that uProduce is only surprised that your User View has a Field (does it?), but you don't use it later in any Content Object, etc. After all, it's only a Warning, that should not prevent you from running.

On another note: if the purpose of your User View is only to be "counted" by your "RowCount" QLingo function, maybe you would want to make that a little simpler (for the sake of better performance and less resource consumption), by simply coding a "counting" SQL query, such as

SELECT COUNT([ID]) AS myNumberOfRows FROM [XMPDBHDS].[XMPieHDSSchema23272].[Sheet1]

directly in your Content Object code - no User View, no RowCount any more.

DD.DevSolution

unread,
Mar 3, 2025, 12:12:01 PM3/3/25
to XMPie Interest Group
Thanks... i didn't know that i can make Queries  directly in your Content Object code
The result is the same... It appear in Indesign Preview
But not on final PDF

BTW is there a shortcut to refer to actual BD
Instead on catching JobID than retrieve  XMPieHDSSchema number ?

Thanks

DD.DevSolution

unread,
Mar 3, 2025, 1:16:30 PM3/3/25
to XMPie Interest Group
OK now it appear on PDF ( My fault  )
But i wondering if there a shortcut to refer to actual BD

Instead on catching JobID than retrieve  XMPieHDSSchema number ?
Actualy hardcoded to test my POC

Amit Cohen

unread,
Mar 16, 2025, 8:12:07 AM3/16/25
to XMPie Interest Group
No need to figure out the schema name, just use generic query syntax:
SELECT COUNT([ID]) AS myNumberOfRows FROM @[Sheet1]

Reply all
Reply to author
Forward
0 new messages