As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I am writing a SQL report using SQL code. For some reason when I TEST SQL I see the HTML page with the message waiting for respons. I am not able to pass following SQL. When I use metadata from the same SQL connection, I have no problem writing the reports. When I run this code, my sql profiler doesnt show me the procecss with the code either. I have a feeling that IBI is not passiing the sql to the SQL. Is there any command or option I need to select to pass the following SQL
ENGINE SQLMSS SET DEFAULT_CONNECTION SUGARCRM
SQL SQLMSS PREPARE SQLOUT FOR
select
l.date_entered,
'"' + case when Len(l.id)=6 then '2- Web Tour Request'
when Len(l.created_by)=4 then '3- School Entered'
else '1- Inbound Calls' end + '"' channel,
'"' +lc.brand_dd_c+ '"' brand,
rtrim(year(l.date_entered-.2083)) + right('0' + rtrim(month(l.date_entered-.2083)),2) + right('0' + rtrim(day(l.date_entered-.2083)),2) date_entered,
'"'+u2.user_name+'"' modified_by,
'"' + u2.last_name + '"' modified_by_lastname,
'"' + u2.first_name+ '"' modified_by_firstname,
rtrim(year(l.date_modified-.2083)) + right('0' + rtrim(month(l.date_modified-.2083)),2) + right('0' + rtrim(day(l.date_modified-.2083)),2)
date_modified,
l.id lead_id,
l.last_name lead_lastname,
l.first_name lead_firstname,
'"' + l.primary_address_street+ '"' street,
'"' + l.primary_address_city+ '"' city,
'"' + upper(l.primary_address_state)+ '"' statecode,
'"' + l.primary_address_postalcode+ '"' postalcode,
l.phone_home,l.phone_mobile,l.phone_work,l.phone_other,
'"' + l.status+ '"' lead_status,
'"' +e.email_address+ '"' email_address,
rtrim(year(lc.statuschange_date_c)) + right('0' + rtrim(month(lc.statuschange_date_c)),2) + right('0' + rtrim(day(lc.statuschange_date_c)),2)
statuschange_date_c,
c.children,
a.schools,
'"' + CONVERT ( nvarchar(30) ,a2.school,4)+'"' school,
p.id prospect_id,
'"'+lead_source+'"' lead_source,
m.meetings
from leads l
join leads_cstm as lc on l.id = lc.id_c
left outer join users as u2 on u2.id = l.modified_user_id
left outer join (select leads_lcg_87ccenleads_ida clead_id, count(1) children
from leads_lcg_children_c
group by leads_lcg_87ccenleads_ida) as c on c.clead_id = l.id
left outer join (select leads_accofd41tsleads_ida alead_id, count(1) schools, min(id) minid
from leads_accounts_c
group by leads_accofd41tsleads_ida) as a on a.alead_id = l.id
left outer join (select id, leads_accoa89cccounts_idb school
from leads_accounts_c) as a2 on a2.id = a.minid
left outer join (select bean_id,email_address
from email_addr_bean_rel,email_addresses
where email_addresses.id = email_addr_bean_rel.email_address_id
and email_addr_bean_rel.primary_address=1
and email_addr_bean_rel.deleted='0') as e on e.bean_id = l.id
left outer join (select lead_id, id
from prospects
where prospects.lead_id is not null) as p on p.lead_id = l.id
left outer join (select lead_id, count(meeting) meetings
from (select meeting_id, lead_id, 1 meeting
from meetings_leads
group by meeting_id, lead_id) as m2
group by lead_id) as m on m.lead_id = l.id
where l.deleted = '0'
and (
l.date_entered-.2083 between cast(getdate() as numeric)- 3 and cast(getdate() as numeric)- 2
or
lc.statuschange_date_c = cast(getdate() as numeric)- 2
)
order by l.date_entered-.2083
select
l.date_entered,
'"' + case when Len(l.id)=6 then '2- Web Tour Request'
when Len(l.created_by)=4 then '3- School Entered'
else '1- Inbound Calls' end + '"' channel,
'"' +lc.brand_dd_c+ '"' brand,
rtrim(year(l.date_entered-.2083)) + right('0' + rtrim(month(l.date_entered-.2083)),2) + right('0' + rtrim(day(l.date_entered-.2083)),2) date_entered,
'"'+u2.user_name+'"' modified_by,
'"' + u2.last_name + '"' modified_by_lastname,
'"' + u2.first_name+ '"' modified_by_firstname,
rtrim(year(l.date_modified-.2083)) + right('0' + rtrim(month(l.date_modified-.2083)),2) + right('0' + rtrim(day(l.date_modified-.2083)),2)
date_modified,
l.id lead_id,
l.last_name lead_lastname,
l.first_name lead_firstname,
'"' + l.primary_address_street+ '"' street,
'"' + l.primary_address_city+ '"' city,
'"' + upper(l.primary_address_state)+ '"' statecode,
'"' + l.primary_address_postalcode+ '"' postalcode,
l.phone_home,l.phone_mobile,l.phone_work,l.phone_other,
'"' + l.status+ '"' lead_status,
'"' +e.email_address+ '"' email_address,
rtrim(year(lc.statuschange_date_c)) + right('0' + rtrim(month(lc.statuschange_date_c)),2) + right('0' + rtrim(day(lc.statuschange_date_c)),2)
statuschange_date_c,
c.children,
a.schools,
'"' + CONVERT ( nvarchar(30) ,a2.school,4)+'"' school,
p.id prospect_id,
'"'+lead_source+'"' lead_source,
m.meetings
from leads l
join leads_cstm as lc on l.id = lc.id_c
left outer join users as u2 on u2.id = l.modified_user_id
left outer join (select leads_lcg_87ccenleads_ida clead_id, count(1) children
from leads_lcg_children_c
group by leads_lcg_87ccenleads_ida) as c on c.clead_id = l.id
left outer join (select leads_accofd41tsleads_ida alead_id, count(1) schools, min(id) minid
from leads_accounts_c
group by leads_accofd41tsleads_ida) as a on a.alead_id = l.id
left outer join (select id, leads_accoa89cccounts_idb school
from leads_accounts_c) as a2 on a2.id = a.minid
left outer join (select bean_id,email_address
from email_addr_bean_rel,email_addresses
where email_addresses.id = email_addr_bean_rel.email_address_id
and email_addr_bean_rel.primary_address=1
and email_addr_bean_rel.deleted='0') as e on e.bean_id = l.id
left outer join (select lead_id, id
from prospects
where prospects.lead_id is not null) as p on p.lead_id = l.id
left outer join (select lead_id, count(meeting) meetings
from (select meeting_id, lead_id, 1 meeting
from meetings_leads
group by meeting_id, lead_id) as m2
group by lead_id) as m on m.lead_id = l.id
where l.deleted = '0'
and (
l.date_entered-.2083 between cast(getdate() as numeric)- 3 and cast(getdate() as numeric)- 2
or
lc.statuschange_date_c = cast(getdate() as numeric)- 2
)
order by l.date_entered-.2083
END
TABLE FILE SQLOUT
PRINT
This message has been edited. Last edited by: Kerry,
Try running with only one SQL statement, I think there was a recent thread dealing with multiple result sets in pass-through SQL but I am not sure what that issue was or the resolution.
Also, look at your first 2 lines. I am not familiar with that syntax and there may be something at fault with it. Compare with one of my (known good) .fex files with pass-through SQL:
Okay I tried this but this doesnt work. Does anyone know if there is any limitation in SQL script or passthrough about Joins? Because I have no problem writing a smiple sql and getting out put. If I use my SQL and create SQL view on my SQL server it works just fine.
Is there a way to make complex SQL joins work in IBI so I dont have to maintain code at two different places.
When I write following code: ENGINE SQLMSS SET DEFAULT_CONNECTION SUGARCRM SQL SQLMSS PREPARE SQLOUT FOR
select 10000 * TABLENAME END -RUN TABLE FILE SQLOUT PRINT * END
left outer join (select leads_accofd41tsleads_ida alead_id, count(1) schools, min(id) minid
from leads_accounts_c
group by leads_accofd41tsleads_ida) as a on a.alead_id = l.id
Most likely joins like these do not get passed - you shouldn't expect WebFOCUS to be able to pass complex stuff like this.
You should create a DB View that contains all these joins.
from leads_accounts_c group by leads_accofd41tsleads_ida) as a on a.alead_id = l.id
Most likely joins like these do not get passed - you shouldn't expect WebFOCUS to be able to pass complex stuff like this.
You should create a DB View that contains all these joins.
Yes sir I just realized that this join was causing the problem. i ended up creating and view and using view as metadata to produce this report. Thank you for pointint this out.