Skip to Content
author's profile photo Former Member
Former Member

Retrieve number of SQL Anywhere licenses into PB

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 17, 2015 at 12:55 PM

    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.

    8) 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


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 17, 2015 at 11:19 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.