Creating more tables in URL Logger MS-SQL database

More
2 years 4 weeks ago - 2 years 4 weeks ago #23943 by prashant
HI,
I am using URL logger and working with JSON to process it , I had also like to store some of my data in SQL against a logID. Obvious choice is to make another database and do any queries using cross-database queries.

But thought will get your feedback on the same. 
1. store in separate db on same server
2. store in separate "table" but in url_logger 
3. store in same table as event_log in same database in url_logger , use one the many text_field01,text_field02 etc etc

 
Last edit: 2 years 4 weeks ago by prashant.

Please Log in or Create an account to join the conversation.

More
2 years 4 weeks ago #23944 by admin
There are some dummy tables you can use

First of all event_log table has a lot of unused fields
you can also use data, data_value, lookup and lookup_value tables.

It might be possible to update those tables from the script,
we will check it for you next week and provide you with the example.

 

Mike
ETL Architect
The following user(s) said Thank You: prashant

Please Log in or Create an account to join the conversation.

More
2 years 3 weeks ago #23947 by Peter.Jonson
Here is basic example

const dataSource = require('../../connection');
const rep = dataSource.getRepository('EventLog');
try {
      const record = { char_field_03: 'test' };
      rep.update({ id: logId }, record);
    return 200;
} catch (err) {
    logger.error(`Caught an error: ${err.message ? err.message : err}`);
    return 500; // Any error caught here results in a 500 status
}

Peter Jonson
ETL Developer

Please Log in or Create an account to join the conversation.

More
2 years 3 weeks ago #23948 by Peter.Jonson
you can also use

const rep1 = dataSource.getRepository('Data');
const rep2 = dataSource.getRepository('DataValue');
const rep3 = dataSource.getRepository('Lookup');
const rep4 = dataSource.getRepository('LookupValue');




 

Peter Jonson
ETL Developer

Please Log in or Create an account to join the conversation.

More
2 years 3 weeks ago #23949 by prashant
Thank you for these , travelling for next 2 weeks , will revert with my findings

Few More questions
1. Reconfirming - As mentioned char_03 to char_10 , text_field_03 to text_field_10 are all blanks , I can write to them as well ?
2 Reconfirming - OK to create even more columns inside event_log 
3. Reconfirming - OK to create more tables inside url_logger database 
4. I don't see data_value, lookup and lookup_value tables.
 
 

Please Log in or Create an account to join the conversation.

More
2 years 3 weeks ago #23950 by admin
Regarding N1

Yrs you can use any of the fields except  id,  object_id,  meta_id,  char_field_01, char_field_02,  text_field_01, text_field_02, hostname, created_by

Regarding N2 and N3 this can be done as well if necessary 

Regarding N4
change set RUN_SQL_SCRIPTS to 1 and restart the logger this should create missing tables.
 

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save