Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
john_duffy
Partner - Creator III
Partner - Creator III

Issue with the peek command

Hello All.

I am trying to create a simple loop to read an Oracle table several times with different schemas.  I am creating a resident table containing all the schemas and using the peek command with a Do While loop to step through and load each one.

My issue is with the second peek command.  It always returns a null value and the Load statement abends.  I'm sure it is something very simple that I am overlooking.

I have attached a sample application using inline load statements to illustrate the issue.  In this application, I simply want to read data from TAB1, TAB2 and TAB3 to build resident table TEST_TABLE.  You will find that the applicaiton abends the second time the load statement is executed because vTableName is null.

Also, you will notice that the editor is flagging the load statement as if there is an error.   I'm assuming that is because it does not know what value will be in vConcat.

I am using QV10 SR2.

Any help would be greatly appreciated.

Thanks,

John.

1 Solution

Accepted Solutions
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi John,

your peek() function needs a little adjustment:

peek('TABLE_NAME',$(vPeekCntr),'TABLES_TO_LOAD');

the 3rd parameter must be passed as string, with single quotes. Though it is kinda strange that it works for the first record without the quotes...

View solution in original post

4 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi John,

your peek() function needs a little adjustment:

peek('TABLE_NAME',$(vPeekCntr),'TABLES_TO_LOAD');

the 3rd parameter must be passed as string, with single quotes. Though it is kinda strange that it works for the first record without the quotes...

john_duffy
Partner - Creator III
Partner - Creator III
Author

Thanks a lot Fernando.

I agree with you, it is stange how the first peek command works without quotes around the 3rd parameter.  We use the peek command in numerous applications and have never included the quotes.  Those peek commands are not used in a loop and are only executed once.

Do you agree with my statement regarding the editor flagging the load statement as if there was an error.

Thanks again,

John.

fosuzuki
Partner - Specialist III
Partner - Specialist III

John,

I've always used the peek() with quotes for the 1st and 3rd parameters and never had a problem. Just checked the Help and in fact I was wrong, it doesn't mention the need to use quotes in the 3rd parameter...

The editor thinks it is an error when you use a dollar-sign expansion before the load statement... You statement is ok.

Glad I could help you.

Regards,

Fernando

john_duffy
Partner - Creator III
Partner - Creator III
Author

Thanks again Fernando.