Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a question about the log file. Here are 3 lines I extracted from my log:
4/12/2016 5:30:01 AM: 0048 IF (NOT isNull(qvdCreateTime('..\DEV'))) THEN
4/12/2016 5:30:01 AM: 0051 ODBC CONNECT*XUserId*XPassword*
4/12/2016 5:30:01 AM: 0052 END IF
In my app, I have this code:
SET vDefaultEnv = '..\DEV';
IF (NOT isNull(qvdCreateTime('$(vDefaultEnv)'))) THEN
$(Include=..\oracle1.qvs);
ELSE
$(Include=..\oracle12.qvs);
END IF
Just by looking at the log, it almost seems like it executed the IF and not the ELSE. But based on the result I got, I think executed
the ELSE. Can someone explain to me what the log means as seen?
Thanks
No I think it executed the Else statement since the line number is 51 (3 below the if statement
I didn't even notice there was actually a line number. So I just scripted out the app. The 051 matches the ELSE.
I guess the way the log was presented by QV is a little misleading visually. At first glance, I thought it ran the IF.
Thanks
I would agree that this looks confusing.
At least I can't see a reason why the END IF line is logged, and the ELSE line isn't.
As a side note, if you want to debug these kind of issues, you could also add a TRACE statement to see which path is getting executed.
SET vDefaultEnv = '..\DEV';
IF (NOT isNull(qvdCreateTime('$(vDefaultEnv)'))) THEN
$(Include=..\oracle1.qvs);
TRACE THEN path is executed;
ELSE
$(Include=..\oracle12.qvs);
TRACE ELSE path is executed;
END IF
I just tried the TRACE command. This won't help. It actually wrote my IF message and the ELSE message inside the
IF END IF in the log.
Not sure if I understood your last post, could you post your log snippet?
I got the trace to work. It's good to know we can send debug messages out to the log. Thanks
If you got what you are looking for (or at least got you close to what you wanted), please close the thread by marking correct and helpful responses.
Thanks,
Sunny
Seems to be your variable vDefaultEnv don't have QVD Name
I am using qvdCreateTime() to check for a file not the QVD. I don't think QV has a function to check if a file
exists.