Forum Discussion
It would be helpful if you provide more context, such what database you are using, how are you connecting to the database, any code snippets, what does the actual data look like in the database etc?
The expression \uXXXX is JSON Unicode escape notation
This is how i connect to database and extract a value. Script and quesry works fine with all the values,But when it came to Json, It returns everything in \\u0000 format
function GetDataSetFromDatabase(sql,fieldName)
{
var AConnection, RecSet;
AConnection = ADO.CreateADOConnection();
AConnection.ConnectionString ="Provider=MSDASQL.1;Persist Security Info=False;Data Source=BSDSN";
AConnection.LoginPrompt = false;
AConnection.Open();
RecSet = AConnection.Execute_(sql);
let value=RecSet.Fields.Item(fieldName).Value
AConnection.Close
return value
}
BSDSN is the database name we gave in th ODBC.
My query looks like
use B2B select top 10 * from database where table1 = 1235 and Type = 'Request'
The data in Database looks like
{"id":{"abc":"11111"},"productGroup":"FLEXLINE","flexline":{"purposeType":"NEW","purposeInfoType":"PURCHASE","propertyType":"PRIMARY_RESIDENCE","planLimit":552500.00,"revolvingCreditLimit":552500.00,"pricingProvince":"ONTARIO","closingDate":"2023-05-09","interestRate":{"rate":4.10000,"rateType":"VARIABLE","variance":0.000},"flexTerm":{"amortization":30,"amountRequested":552500.0,"rateEffectiveDate":"2023-05-09","flexTermProduct":"FLTV060C","interestRate":{"rate":5.140,"rateType":"VARIABLE","variance":-1.040},"paymentDetail":{"paymentFrequency":"MONTHLY","firstPaymentDate":"2023-06-09","paymentAccountNumber":{"bank":"002","branchNumber":"31682","number":"81922"}},"rateExceptionInd":"NO"},"preApproval":false}}
Related Content
- 3 years ago
- 6 months ago