Possible to get defaut database name in a program?

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

etienne
Posts: 19
Joined: Wed Jun 12, 2013 10:32 am

Possible to get defaut database name in a program?

Postby etienne » Mon Mar 21, 2016 12:30 pm

Hi,

Is it possible to get the name of the defaut database in a program? It would be useful to use the @wquery command with this database in an add-in.

Best regards,

Étienne

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Re: Possible to get defaut database name in a program?

Postby EViews Gareth » Mon Mar 21, 2016 1:53 pm

Don't think there is currently a way to do it. We'll think about adding a @dbname. It is slightly less useful than @wfname though since a database (unless it is a local .edb file) requires more information than just the name to do something with. And we can't return login info etc... with a function :D

etienne
Posts: 19
Joined: Wed Jun 12, 2013 10:32 am

Re: Possible to get defaut database name in a program?

Postby etienne » Wed Mar 23, 2016 12:18 pm

Yes, having a @dbname command would be fine. For online databases, it should probably return the short name (the alias); for databases in the registry, this would be enough to make queries with @wquery, for example.

To put some context, the current use is for an add-in that resembles 'fetch', but directly imports the series into a new worfile. This saves a few steps to get a quick glance at a few series without having to first open a database, then do one or more queries and export the series into a new workfile. The start/end/freq info required to create the workfile is obtained from the 1st series passed as argument through the use of an @wquery request. So currently, it is mandatory to pass the database to use as an option to the add-in, as opposed to 'fetch', since it is required to use @wquery. If @dbname was available, then @wquery(@dbname, ...) would be used when no database is specified as an option.

So, for the current use, an alternative would be that @wquery uses the default database if, for example, its 1st argument is an empty string. However, having a @dbname function is more versatile.

Étienne

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Re: Possible to get defaut database name in a program?

Postby EViews Gareth » Wed Mar 23, 2016 12:34 pm

Sounds like an interesting add-in - similar to the object preview window.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests