Please help

chefsride

Member
I am trying to take from a database with over 100 tables and I want to find all the records in all the tables that are from the dates of 10/1/01 to 12/31/99 and then export that information out to a .d file. Can anyone give me a heads up on how to go about solving this problem.
 
Hi there,


Strange dates you use, you already forgot the millenium problem :-).
If all the tables have date fields in them, then it's no problem just find them and export them to a .d file and add a trailer like this:

Code:
ASSIGN stamp = STRING(YEAR( TODAY),"9999") + "/"
			 + STRING(MONTH(TODAY),"99" ) + "/"
			 + STRING(DAY( TODAY),"99" ) + "-"
			 + STRING(TIME,"HH:MM:SS")
	 i_recs = 0
	 no-error.
OUTPUT STREAM sdump TO VALUE(c_dmpdir + '/{1}.d' ).
find _file where _file._file-name = '{1}'.
for each {1} no-lock.
export stream sdump {1}.
assign i_recs = i_recs + 1.
end.
{ prodict/dump/dmptrail.i
	&entries	 = "PUT STREAM sdump UNFORMATTED
					 ""filename="" _File._File-name SKIP
					 ""records=""	STRING(i_recs,""999999999"") SKIP
					 ""ldbname=[i]dbname[/i]""	SKIP
					 ""timestamp="" stamp SKIP
					 ""numformat="" SUBSTRING(STRING (1,""9.""),2,1,""character"") SKIP
					 ""dateformat="" mdy STRING(- yy) SKIP.
					 PUT STREAM sdump UNFORMATTED ""map=NO-MAP"" SKIP.
					" 
	&seek-stream = "sdump"
	&stream	 = "STREAM sdump"
} /* adds trailer with code-page-entrie to end of file */
output stream sdump close.

You probably wanna change stuff. But it's just an idea how to dump records.

If those tables haven't got dates in them then you have a problem.

HTH,

Casper.
 
Back
Top