comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL/Dataminer/mySQL is working!!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL/Dataminer/mySQL is working!! [message #26385 is a reply to message #26384] Mon, 03 September 2001 00:34 Go to previous message
Olaf Stetzer is currently offline  Olaf Stetzer
Messages: 39
Registered: September 2001
Member
Olaf Stetzer schrieb:
>
> For those of you who want to give this combination a try
> some hints:
>
> You have to install the myODBC-driver on the machine where
> you run IDL. I had problems with the recent version 2.50.38
> however the older version 2.50.37 is working for me.
> The maintainers of myODBC are aware of the problem, maybe
> there will be a workaround or bugfix in one of the next versions.

Update: There now is a bugfix available!!! The bug was confirmed
by the developers after I sent them a log of myODBC. Now there
is a bugfix introduced in the binary-packages (still ending .38).

I _love_ open source software!!! :-)

Someone asked me to show a bit of code I used to connect to
the database, so here it is (very dirty, maybe I convert it to
a nice reusable function soon):

-----------------------------------------
pro database_test
oDB = obj_new('IDLDBDatabase')
oDB->Connect, DataSource = 'PSC6', user='aida', password=''

strSQL='SELECT Zeitpunkt, Pabs, Tgk FROM aida_me�daten WHERE Zeitpunkt
BETWEEN "2001-07-06 14:45:00" AND "2001-07-06 15:05:00";'

oRS = obj_new('IDLDBRecordset',oDB,SQL=strSQL)

status = oRS->MoveCursor(/FIRST)

zeitfirst=oRS->GetField(0)
Zeit=replicate(zeitfirst,900)
Pabs=DBlarr(900)
Tgk=dblarr(900)

for i=0,899 do begin
IF(status NE 1) THEN BEGIN
PRINT, 'Error moving database cursor'
RETURN
ENDIF

Zeit(i)=oRS->GetField(0)
Pabs(i)=oRS->GetField(1)
Tgk(i)=oRS->GetField(2)
status = oRS->MoveCursor(/NEXT)
endfor

plot, Tgk, Pabs

OBJ_DESTROY, oRS
OBJ_DESTROY, oDB

end
------------------------------------------------

So the Dataminer are mainly the two objects IDLDBDatabase and
IDLDBRecordset. The first is used to establish a connection
via ODBC, the second is used to access the data either of a complete
table within the DB or to a subset which is returned after submitting
a SQL-query (like I did in my example).

I still have to think of an elegant way to convert the struct
SQL-Timestamp
into a variable which ca be used to be plotted against....

Greetings,

Olaf

--
Dr. Olaf Stetzer
Forschungszentrum Karlsruhe
Institut f�r Meterologie und Klimaforschung
Atmosph�rische Aerosole (IMK III) - http://imk-aida.fzk.de
Tel.: +49(0)7247-82-3249 (FAX: -4332)
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Could i find some examples for IDL DataMiner ...?
Next Topic: Call_external

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 17:11:55 PDT 2025

Total time taken to generate the page: 1.68780 seconds