Use of pop calendar

Hello All,
I am trying to Insert DateTime into database using popcalendar.
I am not getting the result after many tries.
....................................................................................................................
queryValue2 =event.source.parent.getComponent('Popup Calendar').date
system.db.runPrepUpdate("INSERT INTO SCRAP_ENTRY (DateTime) VALUES (?)", [queryValue2],getKey=1)
.............................................................................................................................
on my window: powertable bind with SQL Query - select

pop calendar and Button,

this is my query.

Please help me in this.
I am new to this ignition.
Thank you

What is the actual error you are getting while clicking?

I would expect your DB to choke on a column name that is a reserved word (data type).

But please show us the actual error.

1 Like

Changed the column name from DateTime to ScrapDate changed datatype to nvarchar()also.
no error. query is inserting into the the database when I checked in SQL.
but in ignition table inserted data is not showing.

Why? DateTime or Timestamp column types should work, and are necessary if you want Ignition to handle time zones.

Show your binding for your table data. Seems like a separate problem.

{ Or does your script not tell the binding to refresh? }

Thank you so much for your guidelines.

machineid = event.source.parent.getComponent('machineid').text
machinename = event.source.parent.getComponent('Machine name').text
scrap = event.source.parent.getComponent('Scrap').text
totaldelay = event.source.parent.getComponent('Toal Delay').text
cal = event.source.parent.getComponent('Popup Calendar').text

system.db.runNamedQuery("Insert_scrap", {"MachineID":machineid, "MachineName":machinename, "Scarp_Last_Hour":scrap, "TotalDelay":totaldelay,"SCRAP_DATE":cal})
system.db.refresh(event.source.parent.getComponent("Power Table"), "data")

........................................................................
this is my code. its working good

Is it possible to send data from Ignition to SAP, as we are sending Ignition data to data base.

please help me out in this

Sepasoft has a module for connecting to SAP. That's probably your best choice, unless you want to integrate SAP's API Jars yourself.

Thank you for the information.

Can we send data to SAP by using Python script only like how in SQL DB in Ignition.

Is there any way to transfer data from SAP to ignition, other than Sepasoft.

Already answered:

Thank you, I will try the same.