Site menu:

Standard Job Search
Keywords: Country: Advance Search






I created a Run control page to enter the Bind Variables seperated by Commas, Delimiter and Query name.

&logpath = &logpath | &Slash | STATE_RECORD.FILE_NAME.Value;
&log = GetFile(&logpath, "W", %FilePath_Absolute);
&FileOutput = GetFile(&PSHome | &Slash | STATE_RECORD.FILE_PATH.Value
REM Initialize the output file &Slash needs to be changed depending on the environment(PSNT, PSUNIX)

&MySession = %Session;

If &MySession <> Null Then
&MyQuery = &MySession.getquery();
&MyQuery.open(STATE_RECORD.QRYNAME.Value, True, True);
&SQL = &MyQuery.metasql;

&Sql1 = CreateSQL(&SQL, STATE_RECORD.DESCR200.Value);/* DESCR200 feild for any BIND Values
I added Edit Bod on the page amd asked the end users to enter Bind variable values seperated by Comma on the Page*/
&AAny = CreateArrayAny();
SQLExec("select COUNT(*) from PSQRYFIELD where QRYNAME = :1 and COLUMNNUM > 0?, STATE_RECORD.QRYNAME.Value, &Cnt);
While &Sql1.Fetch(&AAny)
&Output = "";
For &i = 1 To &Cnt
REM &LOGFILE.WriteLine(&AAny [&i]);
If &i = &Cnt Then
&Output = &Output | STATE_RECORD.FLDQUALIFIER.Value | &AAny [&i] | STATE_RECORD.FLDQUALIFIER.Value;/*FLDQUALIFIER is the Feild seperator*/
Else
&Output = &Output | STATE_RECORD.FLDQUALIFIER.Value | &AAny [&i] | STATE_RECORD.FLDQUALIFIER.Value | STATE_RECORD.FSU_DATA_DELIMITER.Value;
End-If;

End-For;
&FileOutput.WriteLine(&Output);
&log.WriteLine(&Output);
End-While;

End-If;




Posted by:      Date: 2015-09-01


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