Displaying a table of data from database

Hi all,

How to display a database on a SCADA Screen after doing some SQL CICODE programs (or using a database Exchange Control).

I found this example program in Citect Help,

/* Make a connection to an SQL server and select the name field from each record in the employee database. */

 

FUNCTION ListNames()

INT hSQL;

STRING sName;

INT Status;

hSQL = SQLConnect("DSN=MyDatabase;UID=billw;SRVR=CI1");

IF hSQL <> -1 THEN

Status = SQLExec(hSQL, "SELECT NAME FROM EMPLOYEE");

IF Status = 0 THEN

WHILE SQLNext(hSQL) = 0 DO

sName = SQLGetField(hSQL, "NAME");

END

SQLEnd(hSQL);

ELSE

Message("Error", SQLErrMsg(), 48);

END

SQLDisconnect(hSQL);

ELSE

Message("Error", SQLErrMsg(), 48);

END

END

Can anyone help me how to display the table on SCADA screen?

Parents
  • Hi Nayana,
    Erik is right I came across with the same situation where I need to run certain SQL query and want to display the result on a SCADA screen I take help from Example Project.
    Its very useful where you can actually create connection to your multiple database depending upon your requirement and write your SQL query in Citect Runtime also.
    I have prepared small POC on that If you want I can share it with you.

    Thanks
    Mayur
Reply
  • Hi Nayana,
    Erik is right I came across with the same situation where I need to run certain SQL query and want to display the result on a SCADA screen I take help from Example Project.
    Its very useful where you can actually create connection to your multiple database depending upon your requirement and write your SQL query in Citect Runtime also.
    I have prepared small POC on that If you want I can share it with you.

    Thanks
    Mayur
Children
No Data