variable in selectdb

Author: ivanandradesantana@gmail.com (IvanSantana)

I wonder if this way works selectdb "selectdb max (" %% dsField") from '%% dsTable" to nr_seq " using a variable instead of the field in max

2 Comments

  1. If you're using Solid, MS-SQl, Oracle, MySQL or DB2 (and Uniface 9.6.04+) you could use sql/data "select max(%%......." with the result being available in $result.... Not sure if selectdb can handle the variable substitution.


    Author: Knut (knut.dybendahl@gmail.com)
  2. Hi Ivan, The generalization you're aiming for is not achievable with selectdb... To use selectdb the entity you are reading from MUST be available on the form (just as a marker) otherwise you get a warning at compiletime while at runtime an error with $status -1 and $procerror -1101. Following this rule you are going to define a component with many entities inside, all those you need to apply the business rule you're trying to generalize. The suggestion knutd has already given you is a good one to maintain that level of generalization. You should also consider Uniface is component based and evaluate the opportunity to structure the application services you need for each entity in one template to have a better maintenability of your code. Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)