Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

 

Description

Variables and attributes of type blob representing valid CSV files can be parsed to collections of object instances. Please see the overview section of this page for clarity on what defines a "valid" CSV file.

 

 

Example

The code snippets below demonstrates how the fromCsv built-in function can be used populate a collection of Nurse object instances:

 

Related model objects
persistent object Clinic {
    string name;
}
 
persistent object Nurse {
	string first_name;
	date birth_date;
 
	@ManyToOne
	Clinic clinic;
}
 
object UploadedFile {
    blob data;
}
Unit function using fromCsv
 
 Nurse[] extractNurses(UploadedFile f) {
    return Nurse:fromCsv(f.data);
}
Example CSV file
 

 

 

 

Additional Mentions and References

 

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.