Using KpDBImport and SQL

Forum Home Forums Understanding the Software Using KpDBImport and SQL

Tagged: ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #9951
    Hennie_Kotze
    Participant

    Good Day,

    I can successfully connect to my SQL database and retrieve the latest data from a DB. I just have some general questions about the functionality and capabilities of this driver:

    1. I have to assign each column in my SQL DB to an input channel. If I query correctly, then I will always read the latest variable from the table into my channel. Is there any way that I can read the whole table from SQL? Say I want to query ” SELECT TOP (10) “… Is it not possible to display the top 10 entries?

    2. I have a primary key in my DB called “Date_Time_String” and it is nchar(50). The format is entered yyyy-mm-dd hh:mm:ss. This format seems to be too long for my input channel to display. My input channel only displays yyy-mm-d and then the string ends. It seems like I can only read (8) characters from the source. (The input channel type is configured as “REAL”). Is there any workaround for this?

    Regards,

    #9952
    Mikhail
    Moderator

    Hello,

    1. The DB Import driver reads only 1st row. You may write a stored procedure to convert to 10 entries into 1 row.

    2. Right, max. string length of input channel is 8 chars. In SQL request you should convert it to Unix time (integer seconds) and then use in Rapid SCADA. The details we could discuss on the forum.

    #9962
    Hennie_Kotze
    Participant

    Mikhail,

    Thank You for the response.

    Let me test it and I’ll revert back to you if I struggle.

    Regards,

    #11743
    gabeirinhas
    Participant

    Hello,

    I have questions about dbimport,

    1. How could I do to communicate a sqlite database with the rapid scada environment. I have been trying without success.

    2. When I communicate with a sql server database,
    in “data retrieval”, I ask for the following fields as an example.

    SELECT value FROM tags WHERE name = ‘LT1’ ORDER BY stamp DESC

    SELECT value FROM tags WHERE name = ‘PT1’ ORDER BY stamp DESC

    However, I only get in tags data, the first data. How can I get both data.

    Thanks in advance, greetings

    #11744
    Hennie_Kotze
    Participant

    Gabeirinhas,

    If you look at the attached pictures you will see an example of how I did it.

    Hope it helps…

    Regards,IMG1

    IMG2

    IMG3

    IMG4

    #11746
    Hennie_Kotze
    Participant

    Links to the images:

    IMG1

    IMG2

    IMG3

    IMG4

    #11747
    gabeirinhas
    Participant

    Hello,

    Thank you, it has helped me

    To be able to dump the values ​​as I need them,

    I must create a new table, where each of the columns corresponds to the value that I want to show,

    Thanks for your help,

    greetings

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.