Displaying Lookup results in Browse Grid

Questions related to using nuBuilder Forte.

Re: Displaying Lookup results in Browse Grid

Unread postby devjr » Fri Sep 24, 2021 12:49 am

Actually I did try that before and it also didn't work - because of another issue which I'm finding now - specifically that I can't seem to get column aliases to work.

So, this will work:
nuBuilder_1_3.jpg
nuBuilder_1_3.jpg (174.94 KiB) Viewed 146 times


and shows this:
nuBuilder_1_4.jpg
nuBuilder_1_4.jpg (62.3 KiB) Viewed 146 times


But this won't work:
nuBuilder_1_5.jpg
nuBuilder_1_5.jpg (189.15 KiB) Viewed 146 times


Can you spot what I'm doing wrong?

Thanks,
Jusitn
devjr
 
Posts: 7
Joined: Thu Sep 23, 2021 9:29 pm
nuBuilder Version: 4.5

Re: Displaying Lookup results in Browse Grid

Unread postby kev1n » Fri Sep 24, 2021 12:54 am

When you press CTRL+SHIFT+I you can inspect the generated SQL statements.
kev1n
nuBuilder Team
 
Posts: 2059
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Displaying Lookup results in Browse Grid

Unread postby devjr » Fri Sep 24, 2021 1:07 am

Thanks, using this method it shows me that the generated SQL is:

Code: Select all
SELECT lst_id,lst_subject,test,lst_notes
FROM lesson_set ls LEFT JOIN term t ON t.ter_id = ls.lst_term
WHERE 1


Therefore I can see that the generated SQL is not using column aliases as I would expect - it is just trying to get a new column called "test" from result set.

It /should/ be:

Code: Select all
SELECT lst_id,lst_subject,CONCAT(t.ter_year) AS 'test', lst_notes
FROM lesson_set ls LEFT JOIN term t ON t.ter_id = ls.lst_term
WHERE 1


Am I missing something?

Thanks again.
devjr
 
Posts: 7
Joined: Thu Sep 23, 2021 9:29 pm
nuBuilder Version: 4.5

Re: Displaying Lookup results in Browse Grid

Unread postby kev1n » Fri Sep 24, 2021 3:14 pm

It looks like the SQL parser cannot handle that. (You would need a SELECT * FROM (SELECT ...) construct again)

What's the purpose of this CONCAT anyway?
Code: Select all
CONCAT(t.ter_year) AS 'test'
kev1n
nuBuilder Team
 
Posts: 2059
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 11 guests