Site menu:

Standard Job Search
Keywords: Country: Advance Search






Create a Run Control page where We can Input FileName and Query Name.
Populate those as a Bind Variables into State records.
Then use this code

&ProcessInstance = STATE_REC_AET.PROCESS_INSTANCE.Value;
&QryOprid = STATE_REC_AET.OPRID2.Value;
&QryName = STATE_REC_AET.QRYNAME.Value;
&Filename = STATE_REC_AET.FILE_NAME.Value;

If All(&QryOprid) Then
&Public = False;
&Private = True;
Else
&Public = True;
&Private = False;
End-If;

&Update = False;

&ErrorFile = 'FileName.log'

&Filename ='OutPut FileName'

&Query = %Session.GetQuery();
&QryResult = &Query.Open(&QryName, &Public, &Update);
&QryPromptRec = &Query.PromptRecord;

If &QryResult <> 0 And
&QryResult <> 4 Then
&ErrorFile.WriteLine("Error opening the query " | &QryName | " or query not found");
Else
&QryResult = &Query.RunToFile(&QryPromptRec, &Filename, %Query_TXT, - 1);
&QryResult = &Query.Close();
End-If;




Posted by:      Date: 2015-09-15


        Post more Comments :
Name:
EmailID:
Date:
Comments: