1. Arcady Abramov
  2. Beta Testing
  3. Wednesday, 22 January 2020 12:40 PM UTC

Hello, team

I understand that embedded SQL is not supported in the migration,.

What would be the best practice to rewrite multiple embedded sqls in PS, which look like this:

//---------------------------------

select field1, field2 into :ls_param1, :ls_param2 from table1 where field3 = :ls_param3;

 //------------------------------

Thank you

 

Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 22 January 2020 15:09 PM UTC
  2. Beta Testing
  3. # 1

Are you using the beta version?  If yes, it has a new feature called PowerScript Migrator.  The PowerScript Migrator is a plugin for the C# IDE (SnapDevelop) that will take care of migrating non-visual PowerScript and embedded SQL.  You do not need to do this by hand.

Comment
  1. Arcady Abramov
  2. Thursday, 23 January 2020 05:35 AM UTC
Ok, so I need to check this. THis is the code of Powerscript

//-------------------------------------

SELECT isnull("t000_hotel_parameters5"."c_short_date_format" , :ls_def)

INTO :this.short_date_format

FROM "t000_hotel_parameters5" ;

//---------------------------------



And this is the conversion result:

//---------------------------------------------

var sql1 = @"SELECT isnull('t000_hotel_parameters5'.'c_short_date_format', @ls_def)

FROM ""t000_hotel_parameters5"" ";

short_date_format = (i_trn.SqlExecutor.Scalar<object>(sql1, ls_def)).ToString();

//----------------------------------------------

Is this correct?
  1. Helpful
  1. Govinda Lopez @Appeon
  2. Thursday, 23 January 2020 15:32 PM UTC
Hi Arcady,



Yes, this is the resulting translation. If you test it out on SnapDevelop you can see that the result is basically the same as of PB embedded SQL.



PowerScript Migrator basically supports all 4 types of embedded SQL. So this example of yours shouldn't be a problem for the tool.



I hope this helps.



Regards,
  1. Helpful
There are no comments made yet.
Arcady Abramov Accepted Answer Pending Moderation
  1. Wednesday, 22 January 2020 14:26 PM UTC
  2. Beta Testing
  3. # 2

Thank you, will do some testing on it as well

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 22 January 2020 13:48 PM UTC
  2. Beta Testing
  3. # 3

If you mean "migration to snapobjects / snapDevelop" with "the migration", then there's the SqlExecutor object.

https://docs.appeon.com/appeon_online_help/snapobjects/api_reference/SnapObjects.Data/SqlExecutor/SqlExecutor/SqlExecutor.html

 

Comment
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.