Robert Cemper · Mar 25, 2021 go to post

In a recent example I posted,  I had the need to extend the naming and proposed folder structure
It was obvious if you were reading the downloaded repository. 
The related article was an advertisement and a "heads up" that it just wasn't the default structure as usual.

Robert Cemper · Mar 24, 2021 go to post

So you have to examine this special record in detail in the underlying Global.
Seems to be a broken record that you hit by accident.

Robert Cemper · Mar 23, 2021 go to post

OK. this looks like the first record you find is already in trouble.
I'd expect your data type is something else then stored.
Next omit the conversion %ODBCOUT()  just to see what internal content is and where it starts

  select ID,%INTERNAL(VerzamelDatTijd),
        DateTijdSec from GLPPatTcActie
         where pnr = '27085070017'
         and LTestId->Makey='BLA'
         and glpactieid->makey in ('TAV','TMA')
 
The next question is of course which program writes these values? and how? what's the source?

I get more and more the impression that some 'aged' program writes directly into the global.
Probably directly some $HOROLOG which is a combined %DATE,%TIME construct.

 

Robert Cemper · Mar 23, 2021 go to post

OK!
Now I see the problem. Each datatype has its specific conversion from internal format to ODBC format
So if VerzamelDatTijd is %Date or %Time or %Timestamp and the stored content doesn't fit
you get most likely this error.
It could be by principle := it fits never, a design issue
It could be just a glitch in some data record.
I suggest you start the SQL shell from terminal prompt.  USER>do $system.SQL.Shell()
And then run your modified query:
select  ID,%INTERNAL(VerzamelDatTijd),%ODBCout(VerzamelDatTijd),DateTijdSec
from  GLPPatTcActie 
 where pnr = '27085070017' and LTestId->Makey='BLA'
-- and VerzamelDatTijd < '2021-03-04 09:04'
and glpactieid->makey in ('TAV','TMA')
--
order by DateTijdSec desc

ID shows the flaky record
%INTERNAL() shows the raw content
%ODBCOUT() should trigger the error

Once you know the content you should be able to fix it.

Robert Cemper · Mar 23, 2021 go to post

what date time format would you expect this to be ???? 

'2021-03-04-2021 09:04'  

YYYY-MM-DD-YYYY HH:mm

Not really standard! Rather a wrong DateTime in your Query !

Robert Cemper · Mar 19, 2021 go to post

for Caché ODBC/JDBC drivers are part of standard distribution since ever

%installdir%/bin/CacheODBC.dll
%installdir%/bin/CacheODBC64.dl

Or use your Caché distribution kit and run a custom install with ODBC only

Robert Cemper · Mar 19, 2021 go to post

Well,

You can either use default SQL function UPPER() or LOWER() to force a specific case. e.g:

SELECT * FROM erp.Teste2 WHERE 
$TRANSLATE(LOWER(firstname),'áéíóúçâêîôû','aeioucaeiou') like 'fabio'

or 

SELECT * FROM erp.Teste2 WHERE 
$TRANSLATE(UPPER(firstname),'ÁÉÍÓÚÇÂÊÎÔÛ','AEIOUCAEIOU') like UPPER('Fabio')
Robert Cemper · Mar 19, 2021 go to post

Hi @Fábio Campos 
I see your problem. I don't assume that "Portuguese1" does solve this
So I see 3 workarounds to achieve "shaving" of characters.

#1)  quick & dirty
SELECT * FROM erp.Teste2 WHERE 
$TRANSLATE(firstname,'áéíóúÁÉÍÓÚçÇâêîôûÂÊÎÔÛ','aeiouAEIOUcCaeiouAEIOU') like 'fabio'

#2) more  elegant and also for other columns - create a SqlProcedure

ClassMethod shave(par) as %String [SqlProc, SqlName = "shave" ] 
{  quit $TRANSLATE(par,"áéíóúÁÉÍÓÚçÇâêîôûÂÊÎÔÛ","'aeiouAEIOUcCaeiouAEIOU") }


applied as 
SELECT * FROM erp.Teste2 WHERE erp.shave(firstname) like 'fabio'
#3) calculated property in your table - to be available also in index
Property firstshaved as %String [Calculated,SqlComputed,
SqlComputeCode = {set {*}=$TRANSLATE(firstname,"áéíóúÁÉÍÓÚçÇâêîôûÂÊÎÔÛ","aeiouAEIOUcCaeiouAEIOU")} ];

applied as 
SELECT * FROM erp.Teste2 WHERE firstshave like 'fabio'

Robert Cemper · Mar 18, 2021 go to post

@Alexey Maslov 
This doesn't compile if the calling method doesn't have  [ ProcedureBlock = 0 ] 

ERROR #1038: Private variable not allowed : '..Flatten2($name(agg),.summary)'
calling from terminal has no problem as there are all variables in Global Scope
[ I fell also in this trap smiley]
 

Robert Cemper · Mar 17, 2021 go to post

using SQL you can compare the last change between definition and compilation of classes
a negative difference shows where recompilation is required.
I used Posix-Timeformat for an easier compare

SELECT 
def.ID, cmp.TimeChanged compiled,  def.TimeChanged defined, 
to_char($piece(cmp.TimeChanged,',',1),'J')-to_char($piece(def.TimeChanged,',',1),'J') diff
FROM %Dictionary.ClassDefinition def
left outer join %Dictionary.CompiledClass cmp
on def.ID=cmp.ID
where NOT def.name %startswith '%'
order by 4
Robert Cemper · Mar 17, 2021 go to post

In SMP / Explorer you can get
class by name and its last date 
under routines
      the object by related name  

- - - -- - - -

In addition in Studio, a class that is saved but not compiled
is marked with + after the name 

while a changed class that is neither saved nor compiled
is marked by * 

I have no idea if VSCode or Atelier have similar features.

Robert Cemper · Mar 17, 2021 go to post

This list can be grouped into 3.5 categories:

  • Almost  Runtime changes

Only the last 2 are critical for successful mirror failover and require dynamic handling
and the last requires also non-stop monitoring as it is not directly triggered by SysAdmin.

Robert Cemper · Mar 17, 2021 go to post

Just any Select.   e.g. 
          SELECT 17+4 as BlackJack, NOW() as TimeToWin
no table required
or
          SELECT Top 5 *  FROM %TSQL_sys.types

Robert Cemper · Mar 16, 2021 go to post

2 remarks:

  • mapping your class to pseudo_namespace %ALL makes it available
    to all other namespaces except %SYS
  • to keep your options for a bitmap valid you may take the approach shown
    in my article of the Adopted Bitmap   
    The default of a storage global is ^Pck.ClassnameD .. and so on.
    But it can also be  ^Pck.ClassnameD(%InterfaceName,$namespace) 
    and the integer ID follows as you need.
    You just have to take care that %InterfaceName has some useful content. 
    Which shouldn't be a problem.
    I used %name to bypass all issues with ProcedureBlock.
     
Robert Cemper · Mar 16, 2021 go to post

explicitly PUSHING "publish release" doesn't show any reaction.
and no change for zmp "search -d -r"
What's the delay to be expected?

Robert Cemper · Mar 15, 2021 go to post

There is a trick that may work for some pieces but requires very careful setup:
- create a new database that can be part of the MIRROR
- then you can map the components that are INDEPENDENT of the local instance to this DB

Be warned:
Identification and Isolation of these pieces can be quite tricky and sometimes also impossible
In addition, this can make troubleshooting and maintenance (release update?) rather complicated
and you should do an in-depth evaluation if the extra effort values the achieved result.  

Robert Cemper · Mar 12, 2021 go to post

It is not meant to replace one of the queries:
do #1 or #2 or do both by UNION  

Robert Cemper · Mar 12, 2021 go to post

maybe a misunderstanding:
I call both Class Queries as Tables and join them with UNION
without modifying the existing class queries

Robert Cemper · Mar 12, 2021 go to post

Using Class_Queries like a table the SQL Statement may look similar to this example:
 

select 'Q1' as Qry ,ID,name,SSN
  from sample.SP_sample_by_name() where name %startswith 'A' 
UNION
select 'Q2','--',SSN,name
  from sample.employee_byname() where name %startswith 'K' 

with this result:

Robert Cemper · Mar 11, 2021 go to post

DisplayToLogical converts external input to internal format.
if you have an object everything is internal already.
what would you expect to convert?

DisplayToLogical is just not involved in that process.
You may eventually look for LogicalToStorage  -  [a rare case]