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

Home » Public Forums » archive » Re: IDL & Sybase
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 & Sybase [message #1095 is a reply to message #1086] Wed, 02 June 1993 12:07 Go to previous message
jimf is currently offline  jimf
Messages: 3
Registered: April 1993
Junior Member
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 not a problem I
would suggest method (2).

I am using method (2) to access a bunch of file names residing
in a Sybase table, from IDL. I then pass the file names to an IDL
widget application, where they get displayed in a menu for
selection by the user.

Give it a try..I would be curious to know if you can find any other
approachs that work.

Jim Firestone
[Message index]
 
Read Message
Read Message
Previous Topic: New IDL Update Policy
Next Topic: Re: IDL: from Sun to MsWindows

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

Current Time: Fri Oct 10 10:02:12 PDT 2025

Total time taken to generate the page: 0.16087 seconds