Find

Question
· Jun 20, 2017

How can I fix it: " 'VARBINARY' is not a supported type for CAST" ?

Hi all,

I trying build a project with .NET and Entity Framework in the Code First method, but Caché return the error " 'VARBINARY' is not a supported type for CAST" when run this sql code:

INSERT "dbo"."__MigrationHistory" 
       ( 
              "MigrationId", 
              "ContextKey", 
              "Model", 
              "ProductVersion" 
       ) 
       VALUES 
       ( 
              '201706131048154_InitialCreate', 
              'CACHE2.SchoolContext', 
              cast( 0x1F8B0800000000000400CD59CD6EE33610BE17E83B083A1 ... d89cc74ff4e1285e7df81769242ce52e1f0000 AS varbinary(1549)),
              '6.1.3-40302' 
       )

 

I did all process of this link: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GBMP_eframe#GBMP_eframe_codefirst.

 

This SQL was generated by Entity Framework.

 

I'm using Caché 2015.2.5 version

 

How I fix it?

3 Comments
Discussion (3)1
Log in or sign up to continue
Article
· May 22, 2017 3m read

Port: A VCS-agnostic and project based Studio source control tool - Basic Usage

EDIT: This article has been updated with up-to-date information about the Port project, which now includes a tutorial for basic usage.

The Port project is something that I've introduced more than two years ago but I hadn't enough room to elaborate a tutorial on how to use it till now.


First, the motivation:

 

I started this project several months  years ago when I noticed that most of the Studio's source control implementations weren't project based but instead namespace based. While developing it I noticed some potential keys factors that made me put a bit more of effort on it, even though there were options to handle the source codes already. These factores are:
 

  • Organization: A Project to be used as a finite scope, thus never mixing code that don't belong there.
  • Tests: Projects allow restricting test suites to their scope, thus allowing easier execution.


There are another few points that I left out because they aren't directly related as to why use projects.

A word of warning though...

If you want to use Port with a shared instance then I'd recommend you to try something else. Port is not made for usage with shared instances as it strongly favors distributed development. It's ideal for personal projects but might not be suited for big enterprise enviroments.

If you fail to understand this, you'll face code duplication, desynchronization and even overwrites due to your fellow team mates modifying the same source code.


Now back to what matters...

I've been using Port to handle every Caché Studio-based project and I want to share the why, but this time in a pratical sense, so I made this tutorial to help you understand a bit more. Follow the steps below and if you find any problems you're free to open an issue or report it back in this thread, you can even PM me if you want and I'll reply when it seems fit.


1. Download and install the file port-prod.xml

After installing it, Port will ask you to restart the Studio.



2. Create a new project, create a new project item, save the project and the item respectively.

Everytime you create a new item you must save the project before the item, to make sure that the Studio already updated the project reference.
Port will handle creating the directory structure for you, whichs defaults to: /CacheProjects/{NAMESPACE}/{PROJECT}.


3. Save the recently added item.

This will make the item to be exported. Port will always assume that every project item is a candidate for being exported, this is also why you don't need to worry about Check-In'ing/Check-Out'ing these items.

 

4. Export a project as whole using the menu Source Control->Export.

The first thing that you'll want to do is to export the project as whole. Specially the already existing ones, when doing so Port will check which exported files are outdated and overwrite them with the ones in your project.

NOTE: Port will remove files that aren't related to the project in order to keep clean the directory where the source code is exported. This happens over two circunstances: when removing from the project  or deleting the item. So make sure you know what you're doing and commit often!



5. Import files modified externally by using the menu Source Control->Import

Let's suppose that you have git pull'ed recent changes from your remote and now you need to put these changes in your project, you can do so by importing it back.

If you just cloned a repository that you want to add to Studio then create an empty project using it and import the files using the same menu option.
Just make sure that the repository path respects the same path used by import (which defaults to /CacheProjects/{NAMESPACE}/{PROJECT} as explained before).



6. Force an item to be exported or imported by using the context menu: Source Control->Export (forced) or Source Control->Import (forced).

You can also force an item or even a whole project to be exported/imported. Forcing it means bypassing the timestamp checks, you might need it eventually.

NOTE: You can also import a folder or a Package, all items that belong to it will be affected as well.

 

This concludes the tutorial about the basic usage. Next time I'll be covering how to execute unit tests integrated to the project using the Studio.

5 Comments
Discussion (5)1
Log in or sign up to continue
Question
· May 15, 2017

Licensing Fails with ERROR #8610 : License keys are not accepted on Single User (SU) platform

I am trying to apply a temporary time-limited key for our organization to a Cache Server that I built out a few weeks ago for testing purposes. When I navigate in the portal to activate a new license key, I get this "ERROR #8610: License keys are not accepted on a Single User (SU) platform."

2 Comments
Discussion (2)1
Log in or sign up to continue
Question
· May 10, 2017

Examples of using FHIR With InterSystems Caché

Is there any simple code in Cache using FHIR to understand the relationship between them? If so can anyone provide some example.

1 Comment
Discussion (1)0
Log in or sign up to continue
Article
· May 6, 2017 2m read

Let's write an Angular 1.x app with a Caché REST backend - Part 11

In our last lesson, we added a form to Edit our existing Widgets, and save them back to the server.  However, our Form was not well structured and our Save button had no intelligence, and was not fully visible.  So today, we will apply some Material components and Angular style to make the form more useful

Let's open EditWidget.csp, and make some changes.  First, we want to change the component from an md-card to an md-dialog.  We then want to wrap the content in a div so we can set the layout to "column" so the controls display in a vertical list, and also a Form which enables Angular to verify the state of the form.

Next we will mark the Name and Description as required, which can set the $valid and $invalid states of the form.  We can then use this to control the disabling of the Save button, which we will apply an md-raised style to.  Let's take a look at the code, with the changes highlighted

How does this look now?  We now have a well structured form, and if we remove one of our Required fields, our Save button disables and we can't save the Widget until we reinstate the mandatory data. We also get a visible marker of the fields which are marked as mandatory.

The form still looks a little bare though, so we can add a Toolbar to show the operation and basic information of the selected Widget

And now, we have a better looking form

Today we:

  1. Changed our form to an md-dialog
  2. Used the layout directive to control the flow of the page
  3. Added form validation and used to control the Save button
  4. Added a toolbar to the form

Next time we will:

  • experience some shake ups at Widgets Direct

This article is part of a multi-part series on using Angular on top of Caché REST services.  The listing of the full series can be found at the Start Here page

Discussion (0)2
Log in or sign up to continue