Jim
1. The following Stored procedure, cut and save to text file as spEnv....
(spEnv 092401 mbyerley Stored Proc for RBase Environment)
CLEAR VAR stp_return, MICRORIM_RETURN
SET VAR vxval TEXT = .p1
SET VAR vxkeyword TEXT = .p2
SWITCH(.vxval)
CASE 'ENVVAL'
SET VAR vcmdtxt='Set Var Vretval = (ENVVAL(''' + .vxkeyword + '''))'
&vcmdtxt
BREAK
CASE 'CVAL'
SET VAR vcmdtxt='Set Var Vretval = (CVAL(''' + .vxkeyword + '''))'
&vcmdtxt
BREAK
DEFAULT
SET VAR vretval = 'VOID'
ENDSW
RETURN .vretval
2. Put the procedure with this command: put spenv as spenv p1 text(6), p2
text(12) return text(50)
You can call the procedure by setting vars p1 and p2 to something like:
Set Var p1 = 'CVAL'
Set Var p2 = 'Database'
and From the Command line: Call SpEnv(.p1, .p2) and then Sho Var. The value
of STP_Return will be the return value from the Store Proc.
You can pass in Literal strings like: From the Command line: Call
SpEnv('CVAL','Database')
or in your program:
Set Var Vdbname = (Call SpEnv(.p1, .p2)) or Set Var Vdbname = (Call
SpEnv('CVAL','Database'))
3. I have to go for awhile. I will post the VBcode for the Command Object
to get the SP value in ADO in a few hours.
----- Original Message -----
From: Scott Salisbury
To: [EMAIL PROTECTED]
Sent: Monday, September 24, 2001 12:01 PM
Subject: Pulling Data from Thin Air
Jim Limburg wrote:
In looking at the sys_Tables I don't see this information
like this in the table, so how does this pull this kind of
info.. Out of thin air or ???
Jim, This is no different than doing:
SELECT 'Jim Limburg' FROM Sys_Tables WHERE LIMIT = 1
It will return your name even though you are not listed anywhere
in the Sys_Tables table. You can SELECT anything, not just
columns. Try my SELECT statement at the R> and see.
This is also similar to what I always used to do with CHOOSE
boxes to create menus on the fly.
CHOOSE vr FROM #VALUES FOR +
'1 First Choice ' FROM x WHERE LIM = 1 UNION SELECT +
'2 Second Choice ' FROM x WHERE LIM = 1 UNION SELECT +
'3 Third Choice ' FROM x WHERE LIM = 1 UNION SELECT +
'4 Exit / Quit ' FROM x WHERE LIM = 1 +
AT CENTER CENTER TITLE 'Title' +
CAPTION 'Caption' LINES 6 FORMATTED
Notice that we're selecting a literal text string in this case
as well. "x" is just a dummy table with one record in it.
CREATE TABLE x (x TEXT(1))
INSERT INTO x (x) VALUES ('x')
The other thing I wonder about this is when you executing
something like this are you going to the expense of
creating a record set when your using Oterro/RBase - ODBC.
I don't know. I don't use record sets. I use arrays.
Arrays are very fast, flexible and very easy to work
with.
I am thinking more in an Oterro environment through VB...
I know when you execute just a single Executable command
against through an ADO object your are doing this at the
expense of a creating a record set just for a quick
simple responce. I have used this method, but would like
to find better ways.
You don't need a record set to pull back a single
value (nor would you use an array) and it seems to
me that it would be rather inefficient to use one for
this purpose.
Scott
====
Scott J. Salisbury
Matrix Data Systems / The R:Street Journal
5114 Point Fosdick Drive NW, Suite E-272
Gig Harbor, WA 98335-1733
E-Mail Address: [EMAIL PROTECTED]
Temporary URL: www.seanet.com/~sjs (downloads available)
New Web Address: www.rStreetJournal.Com
Direct Line: 206-423-7679
Toll Free: 888-386-5040
Seattle: 206-448-7975
Fax: 305-425-0491