Dataset access via ODBC for STATA

Created by Mat Ishac, Modified on Fri, 1 Apr, 2022 at 2:46 PM by Mat Ishac


STATA

1) Using the command line

The list of available odbc data sources can be displayed using the command: 

odbc list



The list of tables can be queried using the command: 

odbc query “SeRP-PostgreSQL”,  user(<your_username>) password(<your_password>)


To load your required table, you will need to know the TABSCHEMA and TABNAME. This can be retrieved from the Data Quality Report via the Monash SeRP Projects and Datasets portal.

You will need to have access to the following information: 

For more information on uploading datasets and creating the data quality report, click here

Do not directly select the table from the displayed table list to describe the table you would like to review.

To load the required table, the command line would be: 

odbc load, table(<TABSCHEMA>"."<TABNAME>)


Using the information in the image provided above, the full required commands would be: 

odbc list
odbc query “SeRP-PostgreSQL”, user(<your_username>) password(<your_password>)
odbc load, table(monashtest_project2"."test_data_seed3)


PLEASE NOTE: A user's username and password will be shown in the STATA output window, the command history and in any log file. This information should be redacted if the data is to be shared with others or published. Please contact serp-support@monash.edu if you require assistance in best practices for redaction. 


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article