cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve number of SQL Anywhere licenses into PB

Former Member
0 Kudos

Hi all,

Using SQL Anywhere 11.0.1.2713

Powerbuilder 11.5.1. build 5097

In ISQL Anywhere we can do the following  select property('licensecount') from dummy;  (which gives us the number of sql licenses)

How do we get the result of this in PB so that we can show the number of licenses in our HELP / ABOUT window ?

TIA

John

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi John;

  The easy way is to use a DataWindow! 

1) Create a new DW object.

2) Choose SQL Select as the Data Source.

3) In the SQL Painter from the DW Wizard, select CANCEL from the Select Tables dialogue.

4) From the SQL Painter's menu, select Design => Convert to Syntax

5) Paste your "select property('licensecount') from dummy; " statement into the pane "as is".

6) Exit the SQL Pane back to the DW Painter.

7) Now select Retrieve in the Preview Pane.

😎 Change the default column name from Compute_0001 to something more humane (ie: cc_license_count).

9) Save the new DWO

10) At run time, use the Retrieve ( ) + GetItemString ( ) methods to get the data value and convert (cast) this to whatever data type you need from there.

HTH

Regards ... Chris

Former Member
0 Kudos

Have you hugged your DataWindow today!  

Answers (1)

Answers (1)

Former Member
0 Kudos

Been a while since I did iSQL, but try: SELECT DB_Property('ConnCount', DB_ID(DB_Name()))   FROM dummy; If I remember dummy is the system table that when joined to returns 1 row, correct?  Like Dual in Oracle.  Like I said, been a while.

Former Member
0 Kudos

Told you it was a long time.  My example counts the number of connections to the DB.  Sorry.