1. Nilotpal Bera
  2. PowerServer 2020 or older (Obsolete)
  3. Tuesday, 29 December 2020 15:54 PM UTC

Hi,

Greetings!

I have one PowerBuilder application that uses embedded SQL to change the context to a different database using the transaction object.

Execute Immediate "Use Database_Name";

where Database_Name is the database name 

But when this application is deployed on PowerServer Web and executed, the above statement shows error and can be verified using the error log. Below is the error:

"Stored Procedure 'Use' not found"

My question is whether we can point to a different database using this embedded SQL for a PowerServer deployed application.

 

Environment:

PowerBuilder 2019 R2 Build 2353

PowerServer (PB Edition) 2020 Build 2323 64 Bit

Windows Server 2012 R2

.Net Application server

Sybase ASE 16

 

Thanks,

Nilotpal

 

 

 

Accepted Answer
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 29 December 2020 16:44 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # Permalink

PowerServer is not client/server architecture so the DB transaction mechanism is completely different from PB.  You need to configure the data sources in PowerServer and then dynamically switch which data source your transaction object should use by specifying CacheName property of DBParm: https://docs.appeon.com/ps2020/server_configuration_guide_for_net/Dynamic_transaction_object_to_connection_cache_mapping.html

Comment
  1. Nilotpal Bera
  2. Wednesday, 30 December 2020 07:03 AM UTC
So it means, if the Datawindow that is created from stored procedure using statements like execute dbname..proc_name, will also generate error and similarly declaring the procedure in PowerScript using embedded SQL like declare local_proc procedure for dbname..proc_name syntax...
  1. Helpful
  1. mike S
  2. Wednesday, 30 December 2020 15:09 PM UTC
referencing objects in another database may work since you are not changing the context of the transaction object.
  1. Helpful
  1. Nilotpal Bera
  2. Thursday, 31 December 2020 03:58 AM UTC
Thanks Mike....
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Tuesday, 29 December 2020 16:42 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

NO. you can not use the 'USE database' command with powerserver

Comment
  1. mike S
  2. Tuesday, 29 December 2020 16:44 PM UTC
what you CAN do is create datasources at runtime (if you don't want to set it up beforehand ) and change the transaction to the datasource (or create another transaction object for that other datasource).
  1. Helpful
  1. Nilotpal Bera
  2. Wednesday, 30 December 2020 06:59 AM UTC
Hi Mike,

Thanks for looking into it...



  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.