Subject Exception with SQL
Author Ed Dressel
I am getting the following exception:

---------------------------
Debugger Exception Notification
---------------------------
Project AAEditor.exe raised exception class EIBO_ISCError with message
'ISC ERROR CODE:335544569

ISC ERROR MESSAGE:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 3, char 3
AND

STATEMENT:
TIBOInternalDataset:
"<TApplication>.frmAA.dmAssetAllocate.qryFamilies.IBOqrqryFamilies."

'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------

when opening a TIBOQuery with SQL. But the SQL is fairly simple and
works fine in IBExpert:

select * from FamilyFundInfo
where (PORTFOLIO_ID in (Select Portfolio_ID from PortfolioInfo where
Questionnaire_ID = :Questionnaire_ID))
Order by Portfolio_ID, SORT_ORDER

At the exception the SQL is (I added the line numbers for discussion):

1: select * from FamilyFundInfo
2: WHERE ( PORTFOLIO_ID )
3: AND ( (PORTFOLIO_ID in (Select Portfolio_ID from PortfolioInfo
4: where Questionnaire_ID = ? /* Questionnaire_ID */ ))
5: )
6: ORDER BY Portfolio_ID ASC
7: , SORT_ORDER ASC

I am not sure wher ehte "( PORTFOLOI_ID )" comes from (line 2)--I've
done plenty of these before, seems so simple. What's up with it?

Thanks
Ed Dressel