Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

When using an external procedure that uses one of the external environments that have an one-per-connection scope (i.e. C, Perl, PHP), is there a connection_property or option to get the process ID of the external process?

When running several of those connections simultaneously, that would make it easier to identify which connection uses which process (and to find out how quick an external environment is closed and the like).

If there's no such property, I would suggest to add one.

I'm using SA (GA).

asked 15 Jul '10, 07:17

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

edited 15 Jul '10, 12:48

Mark%20Culp's gravatar image

Mark Culp

Volker: I have added the product-suggestion tag to your question.

(15 Jul '10, 12:49) Mark Culp

@Mark: That's what I had planned to do based on the answer to come, too:)

(15 Jul '10, 14:31) Volker Barth

There is currently no connection property that will give you the process ID of the external environment.

Note that a single database connection could be associated with multiple external environments. For example, if the a connection was using a combination of C and PHP or PHP and PERL or C and PERL or ... (you get the idea). If this were the case then there could be multiple external process IDs. This complicates the issue - If we were to create a property then we would need to be able to list multiple PIDs.

If you wanted to know the pid of the external process, you could determine this yourself by implementing a external procedure which used getpid() and include this in your external library. If you included such a routine in each external library that you used and uniquely named the routines - e.g. getpid_c(), getpid_php(), getpid_perl(), etc - then you could determine the pid of each external process that the connection was associated with. Perhaps this would be a good example to include in the packaged samples?

permanent link

answered 15 Jul '10, 12:46

Mark%20Culp's gravatar image

Mark Culp
accept rate: 41%

edited 15 Jul '10, 12:53

I would suggest a connection_extended_property('ExternEnvPID', <externenvname>), so I could specify which external environment I'm interested in (as long as I can only get one of a kind per connection, which is a correct assumption AFAIK). So I might call connection_extended_property('ExternEnvPID', 'C_ESQL32');. But your suggestion to implement that by an external function will suffice for my needs and is really simple to implement. Thanks!

(15 Jul '10, 14:39) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 15 Jul '10, 07:17

question was seen: 2,628 times

last updated: 15 Jul '10, 12:53