
I have tables and views a, b, c, d waiting for a query.
b needs using inner join with a,
c needs using exists join with a,
d needs using exists join with a.
So how should i put them in a query code? I am currently putting inner join first and exist join later but the query crashes when it reaches first exist join. Please help.
Like :
if(condition B stands )
{
qdbsB = qbdsA.addDataSource(B);
qdbsB .addLink(fieldNum(A,field A),fieldNum(B,field B));
qdbsB .joinMode(JoinMode::InnerJoin);
Range B
}
if(condition C stands )
{
qdbsC = qbdsA.addDataSource(C);
qdbsC .addLink(fieldNum(A, field A),fieldNum(C,field C));
qdbsC .joinMode(JoinMode::ExistsJoin);
Range C
}
if(condition D stands )
{
qdbsD = qbdsA.addDataSource(D);
qdbsD .addLink(fieldNum(A,field A),fieldNum(D,field D));
qdbsD .joinMode(JoinMode::ExistsJoin);
Range D
}
Your pseudo-code looks all right to me. What exactly do you mean by "the query crashes when it reaches first exist join"? What error are you getting?
By the way, please use Insert > Insert Code (in the rich formatting view) to paste source code. It preserves line indentation (amoung other things), which makes code easier to read.