comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: IDL & Sybase

Re: IDL & Sybase
type: item
description: In article <1993Jun1.201039.677@physc1.byu.edu>, goblec@physc1.byu.edu writes: > I am looking for some IDL code that can conduct Sybase queries and > return the results in IDL variables. We are running IDL on a > Sun. A front end for Sybase from IDL would be nice also. Does > anyone know of anyway to do this or programs that are available > from the net? > Thanks > > Clark Goble > goblec@theory.byu.edu > Clark -- I am doing very similar things here at NASA/Goddard Space Flight Center, Greenbelt, MD. There are two approaches I've gotten to work: 1. spawn a Sybase stored procedure which does the query and returns the results into an IDL variable. For example, IDL> spawn, 'isql -Usybaseid < test.sql', results where 'sybaseid' is the Sybase user ID (caution: including a password for the Sybase ID can be a security nightmare; see your Sybase documentation for suggestions on avoiding this) test.sql is a file containing your Sybase SQL commands 'results' is an IDL variable containing the results of the query. One problem with this method is that the output comes back as one huge string in the IDL variable 'results', which may be difficult to parse. 2. spawn a C program which uses Sybase DB-LIB routines to run a stored procedure. Bind the results of the query to variables in the program using DBBIND, then write the results to standard output (e.g. using printf). In this way, the individual lines output by the printf statements get passed into an IDL string variable. This string variable is easier to search through than the un-parsed version described in (1) above. Example: IDL> spawn, cprog arg0 arg1, results where cprog is your C code calling DB-LIB, arg0 and arg1 are optional arguments for passing information in (e.g. database table name, columns to query), and 'results' is the IDL string variable. A Sybase guru formerly in my group said that method (2) will run more efficiently than (1). The down side is that you need more experience with C coding and DB-LIB. If that's n…
creator: jimf
date: 1993-06-02T19:07:50-00:00

Re: IDL & Sybase
type: item
description: In article 677@physc1.byu.edu, goblec@physc1.byu.edu () writes: > I am looking for some IDL code that can conduct Sybase queries and > return the results in IDL variables. We are running IDL on a > Sun. A front end for Sybase from IDL would be nice also. Does > anyone know of anyway to do this or programs that are available > from the net? > Thanks > > Clark Goble > goblec@theory.byu.edu > Some times ago I wrote a simple function to access the Empress database. It is not for operational puroposes, only to get a data set from the database into an IDL Structure Array for further processing. For more sophisticated access try to write an RPC-Client which access the database and sends to data to an IDL started as RPC-Server. I've done something like this with the INGRES-Database. If you're interested in let me know. Thomas -- |Thomas Oettli Internet: Thomas.Oettli@sma.ch | |Swiss Meteorological Institute thomas.oettli@active.ch | |Kraehbuehlstr. 58 CServe: 100015.3543@compuserve.com | |8044 Zuerich | FUNCTION EMPCMD, database, sql_statement, DEBUG = DEBUG ; ;+ ; NAME: ; EMPCMD ; ; PURPOSE: ; Interface to the EMPRESS Database System. Loads output of dynamically ; submitted SQL-Statements into IDL-Structure-Array for further ; processing. ; ; CATEGORY: ; Database Access ; ; CALLING SEQUENCE: ; emp_table=empcmd(database,SQL_statement,[/DEBUG]) ; ; INPUTS: ; ; OPTIONAL INPUTS: ; ; KEYWORD PARAMETERS: ; DEBUG if set time steps will be printed for performance ; analysis ; ; COMMENTS: ; ; ; OUTPUTS: ; ; OPTIONAL OUTPUTS: ; ; COMMON BLOCKS: ; ; SIDE EFFECTS: ; ; RESTRICTIONS: ; ; PROCEDURE: ; ; EXAMPLE: ; ; SEE ALSO: ; imhelp ; ; MODIFICATION HISTORY: ; ; IDLMETEO-Library Swiss Meteorlogical Institute ; ; Written by: Thomas.Oettli@sma.ch, 21-Dec-1992 ; ;- if keyword_set(DEBUG) then t0=systime(1) wordarray,sql_statement, tmparr ; get first table definitions table_name = tmparr(where(tmparr EQ 'from')+1) msvalsep = getenv("MSVALSEP") descarr=strarr(1) ; if strpos(sql_statement, ' …
creator: oet
date: 1993-06-04T06:35:08-00:00