How do I replace a decimal dot to decimal comma. Ex 12.23 should be 12,34 - sql-server

I use Azure Data Factory(ADF)
I read a REST API by using a token and store the content in a json file. This json file should be stored in a sql sever databas. This worked fine when I tested with a test REST API.
But now when I read production REST API some fields in the json file is defined like this "totalVat":1234.5 or "totalBalance": -12345.1233456. There could be any decimal values in these fields. The field that correspond to these field are defined as float in the database. But I live in Sweden and here we use decimal comma like this 1234,123. I have tried to use azure data Flow to use replace like this replace(totalVat, '.', ',') but this doesn't work because totalVat is not a string but defined as numeric. I just wonder what is the best solution to my problem. I can't change the REST API to send decimal comma instead of decimal dot.

Related

Sending Data in JSON schema using AT Commands

I am working on MQTT connection establishment to the server.
I need to send the data to the server in JSON schema format using AT Commands.
The module used in N58 Neoway module. Using AT Commands connection got established and for publishing data or subscribing data to/from the server, it should happen in JSON format.
The AT Command used is:
AT+MQTTPUB=1,1,<"topic_name">,<"data">
I need to send the JSON schema in the place of data.
Looking for any suggestions/help.
The source code is based on C.
The problem in sending JSON through AT commands is that it contains double quotes ", that are unfortunately interpreted according to AT commands ETSI specification as the beginning of a string parameter. So, what happens in many modules is that it is impossible so send a JSON string as a parameter.
Some modems vendors solve this issue by starting an online mode in which data can be sent rawly.
N58 uses a different strategy instead, that consists in escaping the special characters. In the AT command guide it is called data link escape.
Though the guide could be better (there's not explicit explanation of data link escape), we can infer it from the examples (see for example the one in AT+UDPSEND): in order to escape " character, just write \" as you would do in a C string. Example:
AT+MQTTPUB=1,1,"topic_name","{\"menu\":{\"id\":\"1\",\"value\":\"2\"}}"

How to filter a list using "like" operator with a parameter in a REST aplication?

I'm building a web application using REST; more specifically, Node.js. So far, I've had no problems formatting the URL (using ? and & operators; limit and skip to filter fields, for example).
Now, I need to filter a list of Sensor Readings to show only the data that was inserted in a specific day.
The date is being stored as a String in MongoDB in the format "dd/mm/yyyy hh:mm:ss", or "25/04/2017 10:20:56". The reason I'm storing it as a String rather than as datetime is because it takes less space, as there's limitations of storage in the project.
Using the "like" operator in the URL (%, that is), I've successfully managed to filter some other String fields, such as /sensorReading/?deviceNum=MBA%. However, when I try to filter the date String, it fails.
I've tried in many different ways, but nothing is working, even when I don't use the like operator and put the full string (space is being replaced as %20):
/sensorReading/?dateString=13%
/sensorReading/?dateString=1%
/sensorReading/?dateString=%1%
/sensorReading?dateString=1%
/sensorReading/?dateString=13/04/2017%2012:57:16
My guess is that it has something to do with the '/' character present in the String, to separate day, month and year.
Is there a way to do this via URL, or will I have to do it in the front end of my aplication? For the front, I'm using JavaScript and AngularJS.

Passing a pound sign as a value in the query string of a URL, using Angular

I have an input tag and on input it will filter a list of data in a table according to the input value. That value is passed via the query string in the request URL. Typically I get data returned and the table is updated appropriately. However, when searching for the pound sign (#), I am receiving a 500 internal server error. My question is there a known issue with Angular when passing a pound sign in the query string?
To pass reserved characters in URLs, you need to use percent encoding. For #, it's %23.
The wikipedia page for Percent Encoding has a nice lookup table.

Treat Comma and Period as Decimal Separator in Navision Decimal Fields

I want to eliminate an error source, often happening in our company. In our country, we use the comma as decimal separator and a valid decimal number looks something like this: 85,32
The problem is, that the users sometimes press the period instead of the comma, because the keys are next to each other on the keyboard and they do not recognize their mistakes. Navision now formats the number entered 85.32 to 8.532,00 what leads to wrong data in our database.
I tried to set the AutoFormatType to 10 and the AutoFormatExpr to something like this <Integer><Point or Comma><Decimals> and I played around with some other values for AutoFormatExpr, but it still does not recognize the period as a valid comma separator. I even tried to format it afterwards at the OnValidate-trigger, but the AutoFormat logics of navision seems to come first and the value is already altered before the OnValidate field triggers gets executed.
I want to setup my page (or a specific decimal field in particular) that, no matter if the user types 85,33 or 85.33, the result should be 85,33.
Substitution way. Create a field on form(page) with SourceExpr of string type then parse it to whatever you like decimal format and save it to the real field.

PostgreSQL: unable to save special character (regional language) in blob

I am using PostgreSQL 9.0 and am trying to store a bytea file which contains certain special characters (regional language characters - UTF8 encoded). But I am not able to store the data as input by the user.
For example :
what I get in request while debugging:
<sp_first_name_gu name="sp_first_name_gu" value="ઍયેઍ"></sp_first_name_gu><sp_first_name name="sp_first_name" value="aaa"></sp_first_name>
This is what is stored in DB:
<sp_first_name_gu name="sp_first_name_gu" value="\340\252\215\340\252\257\340\253\207\340\252\215"></sp_first_name_gu><sp_first_name name="sp_first_name" value="aaa"></sp_first_name>
Note the difference in value tag. With this issue I am not able to retrieve the proper text input by the user.
Please suggest what do I need to do?
PS: My DB is UTF8 encoded.
The value is stored correctly, but is escaped into octal escape sequences upon retrieval.
To fix that - change the settings of the DB driver or chose different different encoding/escaping for bytea.
Or just use proper field types for the XML data - like varchar or XML.
Your string \340\252\215\340\252\257\340\253\207\340\252\215 is exactly ઍયેઍ in octal encoding, so postgres stores your data correctly. PostgreSQL escapes all non printable characters, for more details see postgresql documentation, especially section 8.4.2

Resources