The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

Say, I want to access the value of the Windows %TEMP% setting in order to write output to a particular directory...

Just as "cross documentation" - as it has been dealt with as a side effect of this question dealing witb DBISQL.

asked 17 Aug '12, 04:50

Volker%20Barth's gravatar image

Volker Barth
29.3k287438644
accept rate: 32%

edited 17 Aug '12, 04:53


I have now formally added this as a product enhancement request as CR #717193 (e.g. something like xp_putenv() and xp_getenv()) to be potentially targeted for a future version of SQL Anywhere.

Thank you for the enhancement suggestion.

permanent link

answered 17 Aug '12, 12:18

Jeff%20Albion's gravatar image

Jeff Albion
10.7k171174
accept rate: 24%

edited 17 Aug '12, 12:19

1

Thanks for considering a "quest for solutions" as an "enhancement suggestion" - you sure listen to your customers:)

(17 Aug '12, 12:38) Volker Barth
1

@Jeff: There are a sackload of simple Windows API entry points that deserve the xp_treatment, or something like it. If only it wasn't so screamingly difficult to use the SQL-Anywhere-to-C interface... no, don't go on about the LANGUAGE WHATEVER interfaces, it's nice that the WHATEVER fans have their RFP checkpoints, but while C might be loathsome it's still the best way to get down and dirty with the OS :)

(17 Aug '12, 13:56) Breck Carter
Replies hidden

Hi Breck,

Are there any Windows API entry points that have equivalents across other POSIX OSes that you would be interested in us implementing?

There are indeed a lot of "Windows specific" functions (I have encountered Registry editing/searching requests from customers before) that could potentially go into xp_* functions, but the xp_* functions are really intended to be available cross-platform: http://www.sybase.com/detail?id=1091125#SA

Which 'sackload' of API points were you specifically thinking of? :)

(17 Aug '12, 17:16) Jeff Albion

If you have the Perl external environment setup, this function will return value of the environment variable passed in:

CREATE FUNCTION getenv( env LONG VARCHAR )
RETURNS LONG VARCHAR
EXTERNAL NAME '$sa_perl_return = $ENV{$sa_perl_arg0}'
LANGUAGE PERL

You can do something similar with any of the other external environments, but Perl is most convenient because you can embed the code right in the external name, without having to deal with distributing dlls or jars.

permanent link

answered 17 Aug '12, 11:38

Bill%20Somers's gravatar image

Bill Somers
1.1k818
accept rate: 36%

other, better, smarter, easier :)

(17 Aug '12, 11:52) Volker Barth

AFAIK, there doesn't seem to be a builtin function, but here are some suggestions for Windows:

If you know other, better, smarter, easier solutions - please add them...

permanent link

answered 17 Aug '12, 04:52

Volker%20Barth's gravatar image

Volker Barth
29.3k287438644
accept rate: 32%

edited 17 Aug '12, 04:54

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×90
×78
×5

question asked: 17 Aug '12, 04:50

question was seen: 7,880 times

last updated: 17 Aug '12, 17:17