Subject RE: [IBO] TIB_LookupCombo - Join Tables - too ambitious??
Author Dion Oliphant
What you asked for:-

qryPersonIDLK
-----------------------------------------
object qryPersonIDLK: TIB_Query
DatabaseName = 'FundManager'
FieldsDisplayLabel.Strings = (
'FIRSTNAME=First Name'
'SURNAME=Surname')
FieldsGridLabel.Strings = (
'SURNAME=Surname'
'FIRSTNAME=First Name')
SQL.Strings = (
'SELECT PERSONID'
' , FIRSTNAME'
' , SURNAME'
' , ID'
' , TitleId'
' , Initials'
' '
'FROM PERSON '
'')
ColorScheme = True
KeyLinks.Strings = (
'Person.PersonId=CoveredMem.PersonId')
KeyLinksAutoDefine = False
KeyDescLinks.Strings = (
'PersonID=LOOKUP_DESC')
MasterSearchFlags = [msfOpenMasterOnOpen, msfSearchAppliesToMasterOnly]
OrderingItemNo = 1
OrderingItems.Strings = (
'ID=ID')
OrderingLinks.Strings = (
'ID=1')
SearchingLinks.Strings = (
'ID=ID')
AfterScroll = qryPersonIDLKAfterScroll
BufferSynchroFlags = []
CommitAction = caRefreshKeys
FetchWholeRows = True
Left = 615
Top = 488
end
object dsPersonIDLK: TIB_DataSource
Dataset = qryPersonIDLK
Left = 518
Top = 487
end

Datasource(CoveredMem):-
----------------------------------------------------------------------------
---------------------
object qryCoveredFamMem: TIB_Query
ColumnAttributes.Strings = (
'TITLENAME=COMPUTED'
'RELNAME=COMPUTED'
'STATUSNAME=COMPUTED'
'UNIONNAME=COMPUTED'
'GROUP_NAME=COMPUTED'
'LOOKUP_DESC=COMPUTED')
DatabaseName = 'FundManager'
IB_Connection = cnFundMan
IB_Transaction = trnFundMan
SQL.Strings = (
'SELECT COVEREDMEM.RELATIVETYPEID'
' ,COVEREDMEM.PERSONID'
' ,COVEREDMEM.FUNDID '
' ,COVEREDMEM.OPTIONID'
' ,COVEREDMEM.MEMBERID'
' ,COVEREDMEM.STATUSID'
' ,COVEREDMEM.DOI'
' '
' ,PERSON.PERSONID'
' ,PERSON.FIRSTNAME'
' ,PERSON.SURNAME'
' ,PERSON.DOB'
' ,PERSON.TITLEID'
' ,PERSON.INITIALS '
' ,PERSON.HOMETEL'
' ,PERSON.WORKTEL'
' ,PERSON.EMAIL'
' ,PERSON.ID '
' ,PERSON.UNIONID'
' ,PERSON.GROUPID '
' '
' ,(SELECT TITLE '
' FROM TITLE'
' WHERE TITLE.TITLEID = PERSON.TITLEID)'
' AS TITLENAME'
''
' ,(SELECT NAME '
' FROM RELATIVETYPE '
' WHERE RELATIVETYPE.RELATIVETYPEID = '
' COVEREDMEM.RELATIVETYPEID)'
' AS RELNAME'
''
' ,(SELECT MEMSTATUSNAME '
' FROM MEMSTATUS '
' WHERE MEMSTATUS.MEMSTATUSID = '
' COVEREDMEM.STATUSID)'
' AS STATUSNAME '
''
' ,(SELECT NAME'
' FROM UNIONS'
' WHERE UNIONS.UNIONID = PERSON.UNIONID)'
' AS UNIONNAME'
''
' ,(SELECT GROUPNAME'
' FROM GROUPS'
' WHERE GROUPS.GROUPID = PERSON.GROUPID)'
' AS GROUP_NAME'
' '

' ,(SELECT PERSON2.ID ||'#39' '#39' ||PERSON2.SURNAME||'#39'
'#39'||PERSON2.FIRS' +
'TNAME'
' FROM PERSON PERSON2'
' WHERE COVEREDMEM.PERSONID = PERSON2.PERSONID)'
' AS LOOKUP_DESC'
''
' FROM COVEREDMEM '
''
' JOIN PERSON'
' ON (PERSON.PERSONID = COVEREDMEM.PERSONID)'
''
' WHERE (COVEREDMEM.MEMBERID = :MEMBERID)'
' AND (COVEREDMEM.FUNDID = :FUNDID)'
' AND (COVEREDMEM.OPTIONID = :OPTIONID)')
OnError = qryCoveredFamMemError
CheckRequired = False
ColorScheme = True
EditSQL.Strings = (
'Execute procedure UpdateCovMem( :Person.TITLEID'
' , :Person.Id'
' , :Person.INITIALS'
' , :Person.FIRSTNAME'
' , :Person.SURNAME'
' , :Person.DOB '
' , :CoveredMem.STATUSID'
' , :CoveredMem.ReLativeTYPEID'
' , :Person.UnionId'
' , :Person.Groupid'
' , :CoveredMem.PersonId'
' , :CoveredMem.OptionId'
' , :CoveredMem.FundId'
' , :CoveredMem.MemberId '
' , :CoveredMem.DOI ) ')
InsertSQL.Strings = (
'Execute Procedure Insert_CovMem( :Person.PersonId'
' , :Person.ID'
' , :Person.INITIALS'
' , :Person.FIRSTNAME'
' , :Person.SURNAME'
' , :Person.TITLEID'
' , :Person.HOMETEL'
' , :Person.WORKTEL'
' , :Person.EMAIL'
' , :Person.UNIONID'
' , :Person.DOB'
' , :Person.GROUPID'
' , :CoveredMem.MEMBERID'
' , :CoveredMem.PERSONID'
' , :CoveredMem.RELATIVETYPEID'
' , :CoveredMem.OPTIONID'
' , :CoveredMem.FUNDID'
' , :CoveredMem.STATUSID '
' , :CoveredMem.DOI ) '
'')
KeyLinks.Strings = (
'COVEREDMEM.MEMBERID'
'COVEREDMEM.PERSONID'
'COVEREDMEM.OPTIONID'
'COVEREDMEM.FUNDID')
KeyLinksAutoDefine = False
KeyRelation = 'COVEREDMEM'
MasterSource = dsMemberProfile
MasterSearchFlags = [msfOpenMasterOnOpen, msfSearchAppliesToMasterOnly]
MasterParamLinks.Strings = (
'MEMBERID = MEMBERINFUND.MEMBERID'
'OPTIONID = MEMBERINFUND.OPTIONID'
'FUNDID = MEMBERINFUND.FUNDID')
RequestLive = True
AfterInsert = qryCoveredFamMemAfterInsert
AfterPost = qryCoveredFamMemAfterPost
AfterPrepare = qryCoveredFamMemAfterPrepare
BeforePost = qryCoveredFamMemBeforePost
BufferSynchroFlags = [bsAfterEdit, bsAfterInsert]
CommitAction = caRefreshKeys
FetchWholeRows = True
Left = 464
Top = 64
ParamValues = (
'MEMBERID=')
end





-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Monday, September 16, 2002 2:29 PM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] TIB_LookupCombo - Join Tables - too ambitious??



Sheesh, Dion, I said EXTRACT the stuff for the Keysource and the Lookup
datasets, not the whole danged bundle!

Two queries and two datasources.

Helen



___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/