UPDATE Database (using Schema) based on current START_DATE_TIME

Hi,
I  am using the TestStand Schema and a MYSQL datababse.
I have added a new table the MYSQL database that comes with TestStand. I am using the database tools to insert some local variable results into this table.
I also add the start date and time to this table, using
Str(RunState.Root.RunState.Sequence.Locals.StartDate.Month) + "-" +Str(RunState.Root.RunState.Sequence.Locals.StartDate.MonthDay) + "-" + Str(RunState.Root.RunState.Sequence.Locals.StartDate.Year) + " " + Str(RunState.Root.RunState.Sequence.Locals.StartTime.Hours) + ":" +Str(RunState.Root.RunState.Sequence.Locals.StartTime.Minutes) + ":" + Str(RunState.Root.RunState.Sequence.Locals.StartTime.Seconds)
I am trying to use the Schemato update the a colum with the parent ID, so I have it set up as a foreign key. I can get this to work when I use hardcode the the date/time in the SQP statement.
Example:
"UPDATE UUT_CTO_DATA SET ID=? ,UUT_RESULT=? where START_DATE_TIME='2009-03-20 15:13:24'"However I would like to change this so the SQL statement using the TestSTand Variables to figure out which is the current record to update...Is this possible..All help is greatly appreciated.
Regards,
Don1.

Hi Mark,
Thanks for the quick response,Some comments below: 
I need some clarification on the issue and your progress.  In the first poast you had said "I can get this to work when I use hardcode the the date/time in the SQP statement."  When you hardcode the date and time, does it update the ID & UUT_RESULT columns for all devices in a bath? 
When I hardcode the update SQL statement with a specific date, Example: "UPDATE UUT_CTO_DATA SET ID=? ,UUT_RESULT=? where START_DATE_TIME= '2009-03-24 10:31:13'"   , it will update the ID & UUT_RESULT columns for all devices in a batch, (I manually delete it from the MYSQL database after each device in the batch to confirm it updates on subsquent runs)
So do you think it now looks like my original SQL statement is somehow incorrect for all bar the first device in the batch?
I did try the following:
Created a StationGlobal called Test.
Assigned it as follows, to ensure it matches the database record format ('2009-03-24 10:31:13')
StationGlobals.Test =Str(RunState.Root.RunState.Sequence.Locals.StartDate.Year) + "-" +Str(RunState.Root.RunState.Sequence.Locals.StartDate.Month,"%02i") + "-" + Str(RunState.Root.RunState.Sequence.Locals.StartDate.MonthDay,"%02i") + " " + Str(RunState.Root.RunState.Sequence.Locals.StartTime.Hours,"%02i") + ":" +Str(RunState.Root.RunState.Sequence.Locals.StartTime.Minutes,"%02i") + ":" + Str(RunState.Root.RunState.Sequence.Locals.StartTime.Seconds,"%02i")
Change my SQL statement to "UPDATE UUT_CTO_DATA SET ID=? ,UUT_RESULT=? where START_DATE_TIME= '"+StationGlobals.Test+"'"
As before it updated for the first device in the batch and none of the rest.
Also, which version of TestStand are you using? 
I am using TestStand 4.1.1
Thanks & Regards,
Don1

Similar Messages

  • How to update database using Service in 11g

    Please some one provide the knowledge, how i will update database from a form and form is having multiple rows and column and and all are having different or same value.
    e.g. we have having clientName table and having column(clientname, legalContact, selfservice,usertype,details),
    We can search the data from clientName, now user can change other information except clientName can not be change but other information can change. now how i will update users changed value.

    Hi ,
    If you are looking to update the fields for a user such as description , telephone number etc then the following service needs to be used :
    UPDATE_USER_META_TABLE
    Details for this are available in : http://docs.oracle.com/cd/E23943_01/doc.1111/e11011/c04_core.htm#CSSRG2503
    Hope this helps .
    Thanks,
    Srinath

  • Update Database using Materialized Views

    I have a need to update the database across the firewall (on a partner network). Are there any issues/problems with this approach like performance, security,etc. I do not want to use dblinks.

    Materialized views generally don't work too well without a database link between the machines-- in fact, they don't work at all. Oracle replication is built around the assumption that the databases involved can communicate with each other.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Unable to update database using a remote bean call

    We have a system, in which one of the EJBs (say, local EJB) in one
    system remotely call an ejb (say, remote EJB) on another system. The
    problem is the that the remote EJB is unable to database with any
    changes when its method was invoked by the local EJB.
    We first call a set method which is supposed to update the DB. Then we
    call the get method which returns the recently updated value. However
    the data is not stored in the DB. The get method seems to retrieve the
    data from the cache. There is no exception thrown.
    However there is no issue with the remote EJB. If we call the method
    locally, it DOES update the database. I dont know if it has to do
    anything with the java security policy defined. We use Weblogic 6.1
    SP3.
    We have a release in another 2 days and any help on this will be
    appreciated.

    We have a system, in which one of the EJBs (say, local EJB) in one
    system remotely call an ejb (say, remote EJB) on another system. The
    problem is the that the remote EJB is unable to database with any
    changes when its method was invoked by the local EJB.
    We first call a set method which is supposed to update the DB. Then we
    call the get method which returns the recently updated value. However
    the data is not stored in the DB. The get method seems to retrieve the
    data from the cache. There is no exception thrown.
    However there is no issue with the remote EJB. If we call the method
    locally, it DOES update the database. I dont know if it has to do
    anything with the java security policy defined. We use Weblogic 6.1
    SP3.
    We have a release in another 2 days and any help on this will be
    appreciated.

  • Update database using check boxes

    I have a query region that produces a checkbox and an associated line with the checkbox. The data in the database that is a "Y", produces a checked box.
    select check_box_seq,
    htmldb_item.checkbox(1,is_it_checked,decode(is_it_checked,'Y','CHECKED')) D,
    check_box_text R
    from check_box_tbl
    What I need to happen is to change one or more check boxes. I have a MultiRow Update process, with a process point of On Submit - After Computations and Validations with a PL/SQL conditional processing of:
    FOR I in 1.. HTMLDB_APPLICATION.F_F01.COUNT LOOP
    update table check_box_tbl set is_it_checked = Y
    where check_box_seq = htmldb_item.application.g_f01(i);
    END LOOP;
    But the data in the database does not change. I have read numerous discussion on this thread but I have not found exactly what I need or can not recognize it.
    How can I get the data in the database to change when I either change a checked box or after I have changed all boxes and then press the SUBMIT.

    I am having a similar problem that I cannot find the answer to. (See my process below). I don't think that the process is "grabbing" the checked values in the SDN column. It is using NULL, so therefore no rows are being inserted in the table. Shg_id and SDN are both primary keys in this table, so I need to insert both. Shg_id has an assigned value already.
    My process is this:
    DECLARE
    l_selected HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
    BEGIN
    l_selected := HTMLDB_UTIL.STRING_TO_TABLE(:P312_SDN);
    FOR i IN 1..l_selected.count
    LOOP
    INSERT INTO shgm (Shg_id, SDN)
    VALUES (:P312_Shg_id, l_selected (i));
    END LOOP;
    END;

  • Error while updating database using jdbc receiver adapter

    Hi All,
    I am trying to update a single record using jdbc receiver adapter.
    This is my the message that is getting created..
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:Data xmlns:ns0="urn:Test">
    - <STATEMENT>
    - <TABLENAME ACTION="UPDATE_INSERT">
      <TABLE>ORDERS</TABLE>
    - <ACCESS>
      <OrderID>99999</OrderID>
      <CustomerID>VICTE</CustomerID>
      <EmployeeID>3</EmployeeID>
      <ShipAddress>VICTE</ShipAddress>
      </ACCESS>
    - <KEY>
      <OrderID compareOperation="EQ">99999</OrderID>
      <ShipAddress compareOperation="EQ">VICTE</ShipAddress>
      </KEY>
      </TABLENAME>
      </STATEMENT>
      </ns0:Data>
    But in Adapter Monitoring i am getting the following error..
    <i>Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'ORDERS' (structure 'STATEMENT'): java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'VICTE'.</i>
    Regards,
    Rahul

    Rahul,
    > In this case i believe the interface has to be synch.
    > So what will the response message type be like..
    Not necessary. UPDATE can be asynch as well.
    Can you turn the trace on like pointed by Michal and then you can see the Query in the Audit Log of the adapter montioring. Try to execute the same query from your DB Client like TOAD and see what is the Syntax error you are getiing.!
    The problem looks like some field has some dataype / column name mismatch.
    Regards
    Bhavesh

  • How to connect to database using sqlplusW (windows based  sqlPlus)

    Hi
    Thank you for reading my post
    I did some search and i find that i should use some kind of SYSTEM/SYSTEM@ORCLE
    to connect to database using windows based sqlplus.
    in the above SYSTEM is username and password and ORCLE is SID.
    but sqlplusw says that
    could not resolve the connect identifier specified.
    where i can find complete information about HOST string ?
    thanks

    You can look inside yours tnsnames.ora file it can be found in %ORACLE_HOME%\network\admin
    MOB92 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xxx)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = MOB92.world)
    Here my network service name in MOB92 so in sqlplus I would use:
    system
    password
    mob92
    and it should work. If you have no such entry in tnsnames.ora file you can use for example Network Configuration Assistant to configure your network service name.
    Best Regards
    Krystian Zieja / mob

  • Performance on  Schema based Xml and No Schema based XML

    Hai,
    We can insert two kind of xml like schema based xml document and non schema based xml document into XMLTYPE fields.I like to know which xml document will have good performance ( fast access ) compare to another.
    Even if we have any other approach than schema.It will be great.
    We do XPath query to get the values from xml document.Is there any way to get the fields faster than the XPath.I am using Oracle 10g R2.
    I need to access much fast the xml element from the table.Please help me!.
    Thanks,
    Saravanan.P

    HHave you read the FAQ or any of the XML DB whitepapers... If not I suggest that you do so before proceeding any further or asking any more questions. If you take the time to a do a little basic research you should be able to see that you have made the worst possible decision if performance is importantto you.
    If you invested a little bit of effort before posting you would soon understand that in 10gR2 you will need to use schema based storage to get high performance, and that it doesn't matter whether you use XPath or XQuery, what matters is whether or not the XPath or XQuery operations get re-written correctly so the database can optimize them.

  • How to access Oracle Using Dos Based FoxPro(2.5,2.6)

    Hello Sir,
    I need some clarification regarding the following question.
    Q. How can access Oracle Database using Dos Based Foxpro of version either 2.5 or 2.6
    Thanking you,
    Kishore.P

    Hi Alex,
    the host and port depends on your network setup of your VM.
    Do an ifconfig -a and see what IP adress your guest has.
    With this IP address you should be able to access EM from outside your VM (but on the VM host, not from outside the network) with the same port.
    Regards
    Sebastian

  • Updating different Databases Using XI

    Hello,
    I am having one requirement for updating different databases using XI.
    The scenario is that
    Data is coming from ERP to XI.
    This data should be inserted or updated in SQL server.
    Depending on certain conditions I need to update different SQL servers.
    Currently I am having one interface which updates one SQL server database.
    I want to change that interface for updating different SQL server databases depending on the data coming from ERP.
    Is it possible?
    How can I achieve this?
    Thanks in Advance
    Abhijit.

    Hi abi,
        For using more than one database server u can use the BPM.
        there in the design phase, while u making the layout of the picture type connection , there in the switch tool , u can put the condition and according to that
    it will connect to the database server.......
    if it is useful give the rewards
    Regards
    Sasi.........

  • How to update transaction data automatically into MySQL database using PI

    Dear All,
    With reference to subject matter I want a sincere advice regarding how to update transaction data automatically into MySQL database using PI. Is there any link available where I can get step-by-step process.
    Ex: I have a MYSQL database in my organization. Whenever a delivery created in SAP some fields like DO Number, DO quantity, SO/STO number should get updated in MYSQL database automatically.
    This scenario is related to updation of transactional data into MYSQL DB and I want your suggestions pertaining to same issue.
    Thanks and Regards,
    Chandra Sekhar

    Hi .
    Develop a sceanrio between SAP to Database system,When the data updates in SAP Tables read the data and update it in DATA Base using JDBC adapter,but there will be some delay in updating data in MySQL.
    serach in sdn for IDOC-TOJDBC sceannario,many documents available for the same.
    Regards,
    Raja Sekhar

  • Function in SQL: PRAGMA used, but '..does not guarantee not to update database'- WHY?

    I use function in SQL statement. It is a dynamicaly build SQL, therefore I need overload functions. These funcs defined in package. The package has PRAGMA Restrict_References (.., WNDS). So all functions should be restricted to update database.
    But Oracle returns an error:
    Function NVL_ does not guarantee not to update database
    This is my build SQL:
    ----- the execution string is: ---------------
    Begin
    INSERT INTO TEST_TBL_BS (MILL_ORDER, CLM1, CLM2, CLM3, NOTES, INIT_DATE )
    VALUES (NV.NVL_(Arc_Utl.TEST_TBL_dltd.MILL_ORDER),
    NV.NVL_(Arc_Utl.TEST_TBL_dltd.CLM1),
    NV.NVL_(Arc_Utl.TEST_TBL_dltd.CLM2),
    NV.NVL_(Arc_Utl.TEST_TBL_dltd.CLM3),
    NV.NVL_(Arc_Utl.TEST_TBL_dltd.NOTES),
    Arch.Init_Time );
    End;
    This is NV package:
    PACKAGE NV IS
    PRAGMA Restrict_References ( NV, WNDS );
    NULL_date DATE := TO_DATE ('01/01/1001', 'mm/dd/yyyy');
    NULL_numb NUMBER := 0;
    NULL_str VARCHAR2 (10)
    := '?';
    -- overloaded NULL_Val function returns NULL_<type> value (defined early)
    -- depend on received variable type
    FUNCTION NULL_Val ( val_in IN DATE )
    RETURN DATE ;
    FUNCTION NULL_Val ( val_in IN NUMBER )
    RETURN NUMBER ;
    FUNCTION NULL_Val ( val_in IN VARCHAR2 )
    RETURN VARCHAR2 ;
    -- PRAGMA Restrict_References ( NULL_Val, WNDS ); -- can be used in SQLs
    -- these pretends to cover hole of the SYS.NVL that do not have posibility
    -- to return default NULL value for every given type
    FUNCTION NVL_ ( val_in IN DATE )
    RETURN DATE ;
    FUNCTION NVL_ ( val_in IN NUMBER )
    RETURN NUMBER ;
    FUNCTION NVL_ ( val_in IN VARCHAR2 )
    RETURN VARCHAR2 ;
    -- PRAGMA Restrict_References ( NVL_, WNDS ); -- can be used in SQLs
    END NV;
    CREATE OR REPLACE PACKAGE BODY NV AS
    -- NULL_Val set of overloaded functions - returns appropriate NULL value
    FUNCTION NULL_Val ( val_in IN DATE )
    RETURN DATE IS
    BEGIN RETURN NULL_date;
    END NULL_Val; -- for date
    FUNCTION NULL_Val ( val_in IN NUMBER )
    RETURN NUMBER IS
    BEGIN RETURN NULL_numb;
    END NULL_Val; -- for NUMBER
    FUNCTION NULL_Val ( val_in IN VARCHAR2 )
    RETURN VARCHAR2 IS
    BEGIN RETURN NULL_str;
    END NULL_Val; -- for VARCHAR2
    -- set NVL_ function to return default NULL value if received variable
    -- is NULL or the received variable if it is not NULL
    FUNCTION NVL_ ( val_in IN DATE )
    RETURN DATE IS
    BEGIN RETURN NVL( val_in, NULL_Val ( val_in )); END NVL_;
    FUNCTION NVL_ ( val_in IN NUMBER )
    RETURN NUMBER IS
    BEGIN RETURN NVL( val_in, NULL_Val ( val_in )); END NVL_;
    FUNCTION NVL_ ( val_in IN VARCHAR2 )
    RETURN VARCHAR2 IS
    BEGIN RETURN NVL( val_in, NULL_Val ( val_in )); END NVL_;
    END NV;
    Can anybody help : where is a problem and what I can do in my case?
    I work in Oracle 7.3
    Thank you,
    Alex

    Hi Alex,
    I've found that on the RDBS docs:
    If you specify DEFAULT instead of a function name, the pragma applies to all functions in the package spec or object type spec (including, in the latter case, the
    system-defined constructor). You can still declare the pragma for individual functions. Such pragmas override the default pragma.
    Try using that and let me know.
    The docs says also that the declaration of the pragma for an overloaded function applies to the nearest one. You may also try to insert several declaration, one after every function declaration.
    Bye Max

  • Updating a database using EJB Inheritance

    I am new to EJB's, so please forgive my ignorance. I creating the following classes that inherit from each other along with a method to update my database:
    @Entity
    @Inheritance(strategy = InheritanceType.JOINED)
    @DiscriminatorColumn(name="TYPE", discriminatorType=DiscriminatorType.STRING)
    public abstract class ObjectA implements java.io.Serializable {
         protected String name;
         protected String desc;
         protected String type;
    @Entity
    @DiscriminatorValue("OBJECTB")
    public class ObjectB extends ObjectA implements java.io.Serializable {
         protected String str_b;
         public ObjectB(String name, String desc, String type, String str_b) {
              this.name = name;
              this.desc = desc;
              this.type = type;
              this.str_b = str_b;
    @Entity
    @DiscriminatorValue("OBJECTC")
    public class ObjectC extends ObjectB implements java.io.Serializable {
         private String str_c;
         public ObjectC(String name, String desc, String type, String str_b, String str_c) {
              this.name = name;
              this.desc = desc;
              this.type = type;
              this.str_b = str_b;
              this.str_c = str_c;
    public class MyFacade implements ServletContextListener {
         @PersistenceUnit(unitName="Pu")
        private EntityManagerFactory emf;
        @Resource
        private UserTransaction utx;
        public MyFacade() { }
        public void contextDestroyed(ServletContextEvent sce) {
            if (emf.isOpen()) emf.close();
        public void contextInitialized(ServletContextEvent sce) {
            ServletContext context = sce.getServletContext();
            context.setAttribute("MyFacade", this);
         public void updateObject(ObjectA obj) {
            EntityManager em = emf.createEntityManager();
            try{
                utx.begin();
                em.merge(obj);
                utx.commit();
            } catch(Exception exe){
                try {
                    utx.rollback();
                } catch (Exception e) {}
                throw new RuntimeException("Error updating obj", exe);
            } finally {
                em.close();
    }If I do the following:
         String name = "test name";
         String desc = "updating object c";
         String type = "OBJECTC";
         String b = "b";
         String c = "c";
         MyFacade myf = new MyFacade();
         ObjectC objC = new ObjectC(name, desc, type, b, c);
         myf.updateObject(objC);
         .....In my database, only the values associated with ObjectC get updated and nothing from ObjectA or ObjectB get updated in the database. Does the "merge" method not work on inheritance. How do I update my database using inheritance?
    Thanks!
    Message was edited by:
    FourierXForm

    did you only have ISQL for testing it?
    Can you debug the form and look, if someone happens - exceptions, ... ?
    after the update you can use
    message (SQL%ROWCOUNT); pause ;
    to look, how many records were updated

  • Read from database (Access) and update fields using MS ADODB

    Hello,
    I am trying to get records from database using MS ADODB._connection & ADODB._Recordset objects (from LabVIEW 6)
    I can:
    1. open connection (with ADODB._connection)
    2. write into tables (with ADODB._command)
    I can not: gets records and update fields using ADODB._connection & ADODB._Recordset.
    I do not know:
    1. how to connect between the connection that was opened and the recordset object
    2. where I can write the SQL text as input to the recordset
    Attached is DataBase.llb with DB_read.vi that display my steps.
    Thanks.
    Attachments:
    DataBase.llb ‏40 KB

    Try this one, after updating the names for database and the table you want.
    Let me know if it's working.
    p.s.: if you have problems, it could be a different adodb version ... but the sequence of methods is the same
    Attachments:
    EditdatabaseMe.vi ‏57 KB

  • My requirement is to update 3 valuesets daily based on data coming to my staging table. What is the API used for this and how to map any API to our staging table? I am totally new to oracle and apps. Please help. Thanks!

    My requirement is to update 3 valuesets daily based on data coming to my staging table. What is the API used for this and how to map any API to our staging table? I am totally new to oracle and apps. Please help. Thanks!

    Hi,
    You could use FND_FLEX_LOADER_APIS.UP_VALUE_SET_VALUE to upload them from staging table (I suppose you mean value set values...).
    You can find a sample scripts if you google around.
    What do you mean "how to map any API to our staging table" ?
    You should do at least the following mapping (which column(s) in the staging table will provide these information):
    - the 3 value sets name which you're going to update/upload (I suppose these are existing value sets or which have been already created)
    - the value set values and  description
    Try to start with something and if there is any issues the community could then help... but for the time being with the description of the problem you have provided, that's the best I can do...

Maybe you are looking for

  • JNLP does not trigger JRE installation

    Hi I want to launch my application with a minimum version of jre(i.e. 1.6.0_10). If on the system there is no jre installed or jre installed on the system is older than 1.6.0_10, i want jnlp to trigger the installation of jre 1.6.0_25. I tried follow

  • Why does FlexTime appear when I try to edit an audio clip in GarageBand 11?

    Hello, I just upgraded to GarageBand '11 and in the past you could highlight audio and clip, edit, and delete selected waveforms (As seen here: http://cl.ly/2wR6). Now, this just seems to invoke FlexTime! How do I highlight and clip audio like in the

  • Is oracle OODBMS (Object Oriented database management system)?

    Hello, All Is oracle OODBMS (Object Oriented database management system)? and if yes, please explain. I have query in my mind so, I just posted here. Regards, Rahul Edited by: Rahul K. Thakar on Nov 3, 2010 12:03 PM Edited by: Rahul K. Thakar on Nov

  • The HTML Sample Panel (and PSCS6)

    hi, I'm hoping someone from Adobe can take a look at this post. There are two sample Photoshop Extensions available directly from Configurator 3.1.1 (see the File menu). One operates properly for me (in 64 bit CS6) - it is shown below: As is shown th

  • System.MissingMethodException on ReportDocument.SetParameterValue

    Hello, I am having trouble identifying the cause and resolution for the MissingMethodException problem I am facing.  This only appears on certain machines, so I would guess it is not the code.  We have tried to uninstall our custom app that uses the