Kyle Baxter · Nov 18, 2016 go to post

Well, that's a new one.  

Do you have Long Strings enabled on this installation?  If not, you should.  It will fix this problem, but also increases the max size a string can be from 32KB to something like 3.1MB, which allows a lot more flexibility in your development decisions.  But that's another thing.

To delete your query history you can run the following code in Caché terminal:

NSP>k ^%sqlcq("NSP","SMPQueryHistory")

Where NSP is the name of your namespace that's having this problem.  You can also clear history from the Management Portal, though I expect you cannot get there with this error. Let me know if this works - if not I would advise you to open a new WRC issue by going to wrc.intersystems.com, emailing support@intersystems.com, or calling 617-621-0700.  If you're lucky, you might even get to talk to me! :-)

Kyle Baxter · Nov 16, 2016 go to post

When I want to run a bunch of statements I find it easier to open the SQL Shell and parameterize the queries.  Like so:

SAMPLES>d $SYSTEM.SQL.Shell()

SQL Command Line Shell

----------------------------------------------------

The command prefix is currently set to: <<nothing>>.

Enter q to quit, ? for help.

SAMPLES>>update sample.person set name=? where name=?

1. update sample.person set name=? where name=?

Enter the value for parameter '1': Kyle

Enter the value for parameter '2': Tester

executing statement with parameter values: set %tResult=%tStatement.%Execute("'Kyle'","'Test'")

1Rows Affected

statement prepare time(s)/globals/lines/disk: 0.1260s/4915/70580/0ms

          execute time(s)/globals/lines/disk: 0.0033s/10/110/0ms

                          cached query class: %sqlcq.SAMPLES.cls14

---------------------------------------------------------------------------

SAMPLES>># 

     1. update sample.person set name=? where name=?

SAMPLES>>#1

update sample.person set name=? where name=?

1. update sample.person set name=? where name=?

Enter the value for parameter '1': Sexy Ginger God

Enter the value for parameter '2': Kyle

executing statement with parameter values: set %tResult=%tStatement.%Execute("'Sexy Ginger God'","Kyle")

1 Rows Affected

statement prepare time(s)/globals/lines/disk: 0.0002s/5/98/0ms

          execute time(s)/globals/lines/disk: 0.0002s/5/113/0ms

                          cached query class: %sqlcq.SAMPLES.cls14

---------------------------------------------------------------------------

SAMPLES>>

Some notes:

           1) Note that entering the hash/pound/tic-tac-toe sign (#) gives you a list of statements that have been run

           2) You can run these statements by following that sign with the number.  So #1 runs the first statement from this session (it's actually saved by process)

           3) Parameterized queries do not need quotes, and can be easily rerun

           4) Not allowing multiple statements per line is a way to help us be more resilient against SQL Injection attacks (that said, parametrization is still key).

Kyle Baxter · Nov 14, 2016 go to post

The second option will be faster because we don't need to take in the whole object and put it into memory.  The first option does have to do that.  Here's a quick test that shows the second way is faster:

SAMPLES>s ts = $P($ZTS,",",2) f i=1:1:100000 { s name= ##class(Sample.Person).NameGetStored(1) } w "Time: "_(($P($ZTS,",",2))-ts)

Time: .139673

SAMPLES>s ts = $P($ZTS,",",2) f i=1:1:100000 { s p= ##class(Sample.Person).%OpenId(1) s name=p.Name } w "Time: "_(($P($ZTS,",",2))-ts)

Time: .504776

Now, if you want to go SUPER-fast, you can skip all this objects mumbo-jumbo and get that info right from the global:

SAMPLES>s ts = $P($ZTS,",",2) f i=1:1:100000 { s name = $LG(^Sample.PersonD(1),2)} w "Time: "_(($P($ZTS,",",2))-ts)

Time: .029287

However, this has no safeguards built in, and should only be used for your most dire of performance needs.  

Kyle Baxter · Nov 2, 2016 go to post

You could dump it out to a file on the filesystem and just view it in your browser/favorite editor.

Kyle Baxter · Oct 6, 2016 go to post

Hi Scott,

Nope!  The issue here is probably caching.  While things are in memory they are fast, and it is slow when they have to get off of disk. So when you get the next 100,000 rows you need to read data off of the disk and that takes some time.  If everything is in memory or on disk then you might get a proportional increase.

Kyle Baxter · Oct 5, 2016 go to post

Hi David,

Well you're in luck, because you're almost done!  First you have to link the table.  To do this go to the Management Portal: System Explorer->SQL.  Then go to Actions->Linked Table Wizard.   Choose the SQL Gateway connection from the drop down and choose your table.  Go through the couple of screens where you can normally accept the defaults.  

Once you link a table, then you can interact with it as if it were local!  That is, you can pretend the table is not linked, and use the SQL and/or Object access you're used to in Caché, and access the data in the remote tables.   If you are having ANY trouble with this, contact the WRC and one of us will be happy to walk you through the procedure.

Kyle Baxter · Sep 21, 2016 go to post

I want to take a moment here and advise you to be very careful with iKnow.  iKnow is NOT a solution, it is a way for you to develop your own solutions (much like Caché and Ensemble, actually).  While iKnow can give structure to your free text fields, it cannot tell you what to do with that information once you gather it.  So before implementing iKnow and developing a solution, you need to know what it is you want to look for, the purpose of putting the iKnow structure on your data, and what you are going to display or show off once you get it.  

Kyle Baxter · Sep 21, 2016 go to post

Jason - if you haven't sen Dave's response below, please do so.  If you want this investigated further I recommend opening an issue with InterSystems Worldwide Response Center (WRC... a.k.a. Support Department) by going to wrc.intersystems.com.  We would be happy to help you figure out what happened, why it happened, and how to prevent it in the future.  

Kyle Baxter · Sep 10, 2016 go to post

Ah licensing - I should have covered that.  This does require an iKnow enabled license, but one of those should be easy to obtain, at least for development purposes.  Just contact InterSystems or your already assigned sales representative.  

Kyle Baxter · Sep 10, 2016 go to post

This deserves a full answer that I will give on Monday - just want to put this here as a placeholder.  But, spoiler, iFind is better.

Kyle Baxter · Sep 9, 2016 go to post

You should use the newer stream implementations: %Stream.FileCharacter, %Stream.FileBinary, %Stream.GlobalCharacter, %Stream.GlobalBinary.  Which one you use depends on what you want to do.

Kyle Baxter · Sep 9, 2016 go to post

Excellent question.

Of course, when you are going to be using iFind it does mean a heavier burden for your INSERT/UPDATE/DELETE functions.  It also does take up more space on disk than a traditional index.   The cost is going to depend on what kind of iFind index you are using and the size of the data being indexed.  For my example an insert went from about 5 global references to about 200.  But that is, of course, still fast due to the way Caché manages writes to disk.  On INSERT went from 0.0002 seconds to 0.0032 seconds.  So significantly slower, but still plenty fast.  If you test a use case and come up with something different, post it here!!!

Kyle Baxter · Sep 8, 2016 go to post

Caché fully supports INNER and OUTER JOINs, so I'm not sure what the question or problem is here.  Do you have a query that's not working?

Kyle Baxter · Sep 7, 2016 go to post

You can starting in 2016.2!  Check out the field test and try it out!  We want people who have Eclipse experience to help us make our new IDE as smooth and easy to use as possible.

Kyle Baxter · Aug 30, 2016 go to post

Great question!  The reason is that count(*) will read the smallest index, so having an index on ANY field made the count go quickly.  So the customer had an indexed field that helped here, but not in general. 

Kyle Baxter · Aug 30, 2016 go to post

Well you could check if the first character is "<" or not.  I am not sure you can write a valid Caché construct that begins with a less-than, while XML must, necessarily begin with one.  So something like:

s strm=##class(%Stream.FileCharacter).%New() 

d strm.LinkToFile(<file location>)

if strm.Read(1)="<" return "XML"

return "UDL"

Kyle Baxter · Aug 29, 2016 go to post

You should contact the WRC at wrc.intersystems.com to help you debug this issue - we'd be happy to help!

As a first guess, are you using Cache 5.0.2?  If so those DLLs might be 32-bit and not match your 64-bit web server, causing some problems.  I would suggest using the most recent CSP Gateway client, which you can also download from wrc.intersystems.com, and make sure you use 64-bit.  From there, following those instructions has always led me to success in configuring webservers.

Kyle Baxter · Aug 10, 2016 go to post

Shouldn't be too bad.  I think all you need to do is to set up Caché as an ODBC Data source on the system.  Steps are as follows:

    1) Download Caché ODBC Driver from wrc.intersystems.com or .intersystems.com/pub/cache/odbc/2016

    2) Go to Control Panel->Administrative Tools->Data Sources ODBC -> System DSN and create a new DSN with the InterSystems ODBC Driver.  You will need to know the IP, Port, Namespace, and credentials for your Caché server.

    3) Configure Crystal Reports to use that DSN.

    4) ????

    5) Profit!

Kyle Baxter · Aug 1, 2016 go to post

If you are going to do all the $C's, then you should definitely test $C(0) as well.  Was that "" (empty) or " " (space)?  I think you should test both.  And also probably test with a longer string - something like 600+ characters (limit for subscripts), 33K characters (normal string limit), and perhaps even try to blow out the string stack and make sure things are handled "properly" (whatever that means for you). 

Kyle Baxter · Jul 14, 2016 go to post

I don't know the tutorial you're talking about, but it's got to be either onclick or onsubmit.   onsubmit if you are submitting form data, onclick otherwise.

Kyle Baxter · Jun 30, 2016 go to post

 Looking at the log I see:

DSN: TH_T2016_PRE-LIVE
    USERNAME: 

So you are logging in as unknownuser?  If so, does that user have permissions?  

Kyle Baxter · Jun 30, 2016 go to post

You can enable the ODBC log by going to the 32-bit Driver Manager (C:\Windows\sysWOW64\odbcad32.exe) and opening your DSN.  Click 'ODBC Log' which is a checkbox in the bottom-left of the screen.  Then open WinSQL, and refresh the catalog, and close WinSQL again (this last piece forces the log to flush out of buffers onto disk).  The log file will be in C:\Users\Public\Logs\CacheOBDC.log.