Writing millions of rows in a file is time consuming if we use PeopleSoft's Writeline function or File Layout. If you are on DB2 database, we can use EXPORT TO command to dump all your data in a flat file with no time :)
The command looks like below:
EXPORT TO <filename> OF DEL MODIFIED BY NOCHARDEL COLDEL| select * FROM TableName.
This will generate pipe delimiter file.
This can implemented in PeopleSoft using the below steps:
1) Generate export.sh file, the file will have the below content:
<DB2 Bin folder path>/db2 -v CONNECT TO <Database Name> user <UserID> using <Password>
<DB2 Bin folder path>/db2 -v EXPORT TO <filename> OF DEL MODIFIED BY NOCHARDEL COLDEL| select * FROM TableName
<DB2 Bin folder path>/db2 -v CONNECT RESET
2) Run export.sh via EXEC function
Exec(export.sh, %Exec_Synchronous + %FilePath_Absolute);
3) Don't forget to delete the shell script as it'll have the super user id/password :)
Exec("rm " | export.sh, %Exec_Synchronous + %FilePath_Absolute);
The command looks like below:
EXPORT TO <filename> OF DEL MODIFIED BY NOCHARDEL COLDEL| select * FROM TableName.
This will generate pipe delimiter file.
This can implemented in PeopleSoft using the below steps:
1) Generate export.sh file, the file will have the below content:
<DB2 Bin folder path>/db2 -v CONNECT TO <Database Name> user <UserID> using <Password>
<DB2 Bin folder path>/db2 -v EXPORT TO <filename> OF DEL MODIFIED BY NOCHARDEL COLDEL| select * FROM TableName
<DB2 Bin folder path>/db2 -v CONNECT RESET
2) Run export.sh via EXEC function
Exec(export.sh, %Exec_Synchronous + %FilePath_Absolute);
3) Don't forget to delete the shell script as it'll have the super user id/password :)
Exec("rm " | export.sh, %Exec_Synchronous + %FilePath_Absolute);
No comments:
Post a Comment