if ever this should be of practical use
then I'd suggest to move such a "everybody's darling" routine to %SYS and name it %zYJM
- Log in to post comments
if ever this should be of practical use
then I'd suggest to move such a "everybody's darling" routine to %SYS and name it %zYJM
I agree and have suffered over years.
I think for Caché and its derivates it's somewhat late in the life cycle.
Eventually with iris ? Should be worth an enhancement request
Great!
SAMPLES>w !! do $system.OBJ.ExportUDL("Sample.Company.cls")
/// This sample persistent class represents a company.<br>
Class Sample.Company Extends (%Persistent, %Populate, %XML.Adaptor)
{
/// Define an index for <property>Name</property>.
Index NameIdx On Name [ Type = index ];
/// Define a unique index for <property>TaxID</property>.
Index TaxIDIdx On TaxID [ Type = index, Unique ];
/// The company's name.
Property Name As %String(MAXLEN = 80, POPSPEC = "Company()") [ Required ];
/// The company's mission statement.
Property Mission As %String(MAXLEN = 200, POPSPEC = "Mission()");
/// The unique Tax ID number for the company.
Property TaxID As %String [ Required ];
/// The last reported revenue for the company.
Property Revenue As %Integer;
/// The <class>Employee</class> objects associated with this <class>Company</class>.
Relationship Employees As Employee [ Cardinality = many, Inverse = Company ];
------<skip rest> -------
Thank you Tim!
You finally gave me a hint why to use [ ProcedureBlock = 0] or [PublicList = (x1, x2) ]
as a Method_Parameter. I never saw serious reasons for it.
and BTW, what's dynamic about it?
do you mean an array x(Counter) ????
underscore (_) is not allowed in variable names
eventually, you mean set @("x"_Counter) = DIAGS
XECUTE ("set x"_Counter_"="""_DIAGS_"""") should work too
no need to excuse.
the wording (and help text) sometimes not really guiding.
but you motivated me to use more screenshot for explanations.
to access remote tables you should use LInk Table to work in both directions

I wrote this already in line 2 of my answer to this question 2 weeks ago
https://community.intersystems.com/post/cache-sql-insert-external-database##node-446881

you remind me the joke about hieroglyphs:
- What's wrong with them?
- Nothing! Priests in old Egypt were reading the "book of death" like you would read a newspaper.
- You just have to learn the 'encryption'.
Thanks for the clarification.
It's sometimes hard to guess the picture if you miss some pixels.
I'd still recommend moving the CLOSE after each inner loop to have OPEN / CLOSE strictly paired
The implicit CLOSE happens only if you exit the partition. There's no class to act undercover.
Curly braces just structure the code with no operational side effect.
Happy I could help. ![]()
It seems you have manually changed the class definition.
A normal RegisterdObject has no storage definition.
from <Type>%Library.CacheStorage</Type> i see it was a %Rersitent before.
remove Storage and recompile.
I finally succeeded in reproducing your error
ERROR #5803: Failed to acquire exclusive lock on instance of '%Studio.ProjectItem'
The conditions are somewhat strange and you should take an exact check what applies in your case.
The story:
So try to find out in Terminal
Look if you see oddPROJECT
Next try to estimate the number of items your production will export.
If you get close to the dimension of xxxxxx then you run most likely into your error.
Be aware that some components can create more than 1 entry. So your limit might be lower (70% ??)
You can increase the threshold in
MgmtPortal > System Admin > Configuration > SQL and Object Settings > General SQL Settings

ATTENTION: If you set this value to high you risk an overrun of the LOCKTABLE.
This blocks the whole instance. Increasing the size of LOCKTABLE + Restart is then required. Or you set the limit t back.
I miss 3 things in this example:
So to get all output you may append arrayIndex to filename to have unique file names
where do you hoover ? SMP, Studio, Atelier ?
as you noted SEEMS not to work.
method OnInit() as %Status
This user callback method is called via initConfig() from %OnNew() or in the case of SOAP Services from OnPreSOAP()
$$$LOGINFO("INIT") translates to
Do ##class(Ens.Util.Log).LogInfo($$$CurrentClass,$$$CurrentMethod,"INIT")
I'd suggest to replace it by set ^Antonio($i(^Antonio))=$lb($ZDT($h,3),"INIT")
so so find out if your Init gets called or not or multiple times, ..
Especially during init phase high independence from the rest could be useful
My final idea:
- restart the whole ENSEMBLE instance to get rid of anything that might be hidden/hanging around in memory.
It's not my preferred solution, but with the actual information, nothing else seems to work.
If someone starts screaming you may have identified you opponent that blocks you.
- if the problem persists further then contact WRC
I did more research on %Studio.ProjectItem:
In the actual version there is no chance to such a lock situation.
Export is using a lot of %Studio classes. So either a Studio instance or some other editing blocks something.
BTW: what version of ENSEMBLE do you use ?
From your screenshot, I see that you have a running production.

#1) ENSEMBLE has an internal locking not seen in LOCKTABLE.
#2) If you try to export the actual running production this might be you might get in conflict with this internal protection.
I found no note that you can't export a running production.
Though I've never heard of such attempt as a production consists many dynamic moving parts.
Suggestion: STOP the production you want to export and then try the export again.
Documento Nacional de Identidad (Spain)
https://en.wikipedia.org/wiki/Documento_Nacional_de_Identidad_(Spain)
Salva, that's Great!
without having to change the class definition
I like this. ![]()
![]()
Robert
The the description is somewhat vague:
Exclusive LOCK happens on process basis not by user !
It's not clear where you run "export from the production". Portal,Terminal, Studio, ...
if you are in Studio and run "export from the production" in MgmtPortal or Terminal then you have 2 processes.
1 has the lock the other can't get it.
take a look in MgmtPortal > System Operation > Locks > View Locks

Now you should see who is owning your lock

Congratulations ! ![]()
let me have your accepted ![]()
Cheers, Robert
BTW. Class %ZEN.Component.querySource still does it as iit did in past.
For more tricky manipulation you have
/// (optional) Name of Server-side callback method to call to create
/// a <class>%ResultSet</class> object.<br>
/// This must be the name of a server-only method in the page
/// class that contains this component.
Property OnCreateResultSet As %ZEN.Datatype.delegator(FORMALSPEC = "*tSC:%Status,pInfo:%ZEN.Auxiliary.QueryInfo", RETURNTYPE = "%ResultSet");
/// (optional) Name of Server-side callback method to call to execute the
/// <class>%ResultSet</class> object.<br>
/// This must be the name of a server-only method in the page
/// class that contains this table pane.
Property OnExecuteResultSet As %ZEN.Datatype.delegator(FORMALSPEC = "pRS:%Library.ResultSet,*tSC:%Status,pInfo:%ZEN.Auxiliary.QueryInfo", RETURNTYPE = "%Boolean");
yeah, table navigators chop the original resultset.
but with the absolute rowID (%vid) and the pageSize (pS) you should get pageNum= %vid\pS+1
and relative rowID= %vid#pS
Or directly in SQL with pageSize = 12

you will keep the * away as you don't need the content
It's all based on the fact that the 'base'query always generates the same sequence of rows
Just dynamic filters may break this.
For paging also tablePane has to use the same mechanics.
Hi Chip,
If I understand it correct you have a value and look for the related rowID in your tablePane.
tablePanes get typically feeded by a well know SQL SELECT and it numbers its rows sequentially.
For ease of explanation, I use SELECT name,home_city TOWN FROM Sample.Person to fill your tablePane
Let's look for TOWN = 'Denver'

Of course, there is still arithmetic required if you have several sections to calculate.
This just gives you the 'absolute' rowID, not the relative.
HTH, Robert
the DSN is used when you set up your SQLgateway connection.
MgmtPortal > System > Configuration > SQL Gateway Connections

There all information on the DSN is stored.
Next if you Link the external table this gateway entry is used and stored for access.
MgmtPortal > System Explorer > SQL > Wizards > LinkTable
Now you bind a Class in a Namespace to a Gateway to a DSN

So you are fixed for THIS namespace. This is static.
If you change the Gateway entry or the DSN in some essential way
it could happen that you have to do this again.
Similar for a different target table you have to do the Link again.
A different issue could be that you might just have read access to the foreign table.
Then I'd expect some kind of error message.
At least it is something the partner side has to manage.
so either you or someone else just has it opened in a different Studio / Session.
WOW! good luck.![]()
and let me have your Accepted
doc for ORA-01861
describes the TO_Date issue very detailed
https://www.techonthenet.com/oracle/errors/ora01861.php
Your problem seems to be strictly related that the value you use and its description in TO_DATE don't match.
So TO_DATE(?,'YYYYMMDD') in Prepare
should work with
s result=obj.%Execute(20180425,par2,par3,par4)
It's a little bit less transformations