SQLAssembler: Manipulation of dates

I wonder if anyone has had some luck using date/time with SQLAssembler fields, I have a few problems.

My update query statement looks like this:

Update < element >

< sql > update the VALUE of timesheet nobody = nobody # #, < sniiiiip, many fields >, date = #date # WHERE id = #_PREV.id # < / sql >

< / item update >


I'm editing data in the DataService with an editor of the article, which looks like this:

< mx:itemEditor >

< mx:Component > < mx:DateField formatString = "DD/MM/YYYY" / > < / mx:Component >

< / mx:itemEditor >

I use an actionscript class declaration in the config of SQLAssembler; this class, var, called 'date' is of type Date.

My database is an Access MDB connection with sun.jdbc.odbc.JdbcOdbcDriver.

If I remove the part that defines the date field (date = #date #) of my update query, everything works perfectly.

I set to show all messages in debug, and it comes to the specified error when I leave the date field after changing of LCDS:

When I put editorDataField = "selectedDate", I get the following error:

[Flex] 16:19:50.468 [DEBUG] [Service.Data.SQL] exception jdbc SQL assembler on the operation = update-point error = java.sql.SQLException: SQL Exception: Unknown Type SQL for PreparedStatement.setObject (Type SQL = 1111

And if I put editorDataField = 'text' (which seems to cause the format string to apply according to the Protocol rtmp message interceptions), then I get this:

[Flex] 16:27:23.500 [DEBUG] [Service.Data.SQL] exception jdbc SQL assembler on the operation = update-point error = java.sql.SQLException: syntax [Microsoft] [ODBC Microsoft Access driver] error in the UPDATE statement.

And if I add single quotes around the date field in the update query (date =' #date #'), I get this:

[Flex] 16:32:11.156 [DEBUG] [Service.Data.SQL] exception jdbc SQL assembler on the operation = update-point error = java.sql.SQLException: unexpected exception: 7

I tried various format strings, which I think should manage access, but they are all causing the unexpected exception error. I also tried to change the data type on the actionscript string class, but it still gives the same results.

What would be really handy would be if I could see the exact query that is executed on the database to try to determine what is actually entered when the error occurs.

I tried this driver jdbc logging, but so far I couldn't make it work with the Access driver and troubleshooting documentation is very sparse.

If anyone has any clues on how I can see the query to update real sqlassembler is running or what I need to do to activate the editable fields date I would be very grateful.

Thank you

Robert

I have now tried with 2 other databases:

MySQL works perfectly.

MSSQL fails with the error "the Java type java.util.Date is not a supported type."

So, this might be a question about whether a specific JDBC driver can map Java date to a field properly object.

EDIT:

I tried to experiment another JDBC driver to connect to MSSQL: jTDS

It failed with a very similar error message, but it can be tweaked to map the type JAVA_OBJECT to datetime, but there may be side effects of the change (for example another type without mapping available defined my cause now an exception of class go up rather than leading to an sql exception arises).

In most situations storing date into a timestamp would be more appropriate than a datetime field, but as the SQLAssembler seems to be impossible to map the stamp everything except ByteArray this solution doesn't seem possible here. If SQLAssembler was mapped to java. sql. Date instead of java. util. Date, this would be as undesirable as the java.sql version does not include the time.

If anyone is interested in the settings so that to do the jTDS driver then post them here and I'll put up the diff, but really he feels "a bit dodgy" to map the fields JAVA_OBJECT jdbc to this day and probably not something you want to do in production for the sake of reliability (it's just for a small internal project at my company).

Now, I just need to work how best to allow people to edit a time and date in the DateField...

Tags: Adobe LiveCycle

Similar Questions

  • Manipulation of data and ReadFile

    Does anyone know a tutorial readFile manipulation and data?

    Utils.blobtoString still not working?

    Hello arqlz,

    The problem described in this article was due to a blobToString method unheeded at the time. This problem has since been apparently corrected. I just tested the following successfully on my PlayBook example.

    Note that before could run this sample, I had to manually create the file expected readme.txt on the PlayBook filesystem under:

    \media\downloads\

    To complete the above, I went in my PlayBook storage and sharing settings and active file sharing, and the sharing of the Wi - Fi (so I could create the live file on my PC). Then, I created the file manually and it filled with the text:

    Hello world!

    My file config.xml looks like this.

    
    http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0">
        Sandbox
        Oros
        
        
    
        
        
    
        
            access_shared
        
    
    

    Most of this is just a standard configuration.

    • The white list is not mandatory, but it is included by habit.
    • Blackberry.io.file feature > me provides access to readFile and saveFile.
    • The blackberry.utils me gives access to the blobToString and stringToBlob methods.
    • Permission to access_shared ensures that you can access the shared folder on the PlayBook.

    My gaze to index.html as follows file.

    
    
        
            
        
        
            

    From top to bottom, a brief description of the main parts:

    • The #log
      take our logging messages so that we can keep track of what's going on.
    • The / * global * / definitions are there just to satisfy JSLint. Basically, he announced that these variables are defined elsewhere.
    • The logarithmic function takes the text and adds in his own
      to #log. Reviews of find a large number of calls to this function scattered throughout the code. Basically, I want to keep track of what's going on. These calls are not necessary.
    • The handleOpenedFile function is called if we execute successfully blackberry.io.file.readFile. This is where we do our manipulation of data read. Manipulation converts the blob to string, inserts the text "update the:" to the chain, and then converts this string to a BLOB that is then saved in our output file: test.txt. "."
    • The ready function is called when the DOMContentLoaded event is raised. We provide our default readme.txt filepath then try to read the data.
    • Finally, outside functions, we record the DOMContentLoaded event to trigger our ready function. We place outside all functions to ensure the event is recorded when the
  • Manipulation of data series

    I don't know how to handle the serial data I receive from a touch panel.

    What I want to do is view the two sets of coordinates, which are made up of two 4-digit.

    What I am struggling with, is the return of cart/line feed (Cr/Lf).

    For example, I get,

    TP TP CrLf = hurry touchscreen

    CrLf 0100 0100 = first game X coordinates where these values can be anything from 0000 to 4,000 and as wise as all coordinates

    0200 0200 first = CrLf series Y coordinates

    TR CrLf TR = touchscreen released

    CrLf 0100 0100 = last set of coordinates X

    0200 0200 CrLf = last set of coordinates Y

    If you drag the stylus on the touch screen, then I may receive many TP CrLf more details before final output all touchscreen.

    If I had all the CrLf but just a CrLf "after TP nnnn nnnn it wouldn't be problem.

    I had a discount using shift registers, but I'm not sure of the best way to go.

    Some advice would be most appreciated.

    Something like that?

  • Manipulation of data DVR - is that correct?

    Hello

    I'm new to DVR, but trying to integrate them into my current project. My data are in a cluster, and some things I want to change, while others, I want to just use in a calculation or a setting. For items that I don't want change, can I just ungroup them before the in-place-element (REI) where I change what needs to change? Or this will create a copy of the entire cluster of data?

    Also, about the antiderivative of exchange values, I use that correctly? I realized that if Exchange you the old value with the new value, then it will be able to put the new value in a memory space of the old value.

    Thanks for the pointers you can give me on this topic!

    gregoryj wrote:

    Right now I'm passing around my data using a FGV. At the end of a test, the data have some great paintings, the size of one can be about 2000 x 20, and I thought it would be more efficient to use digital recorders.

    You run into a problem, or you think that the DVR will be "more effective"? A large table takes up the same amount of space whether or not it is encapsulated in a DVR. A DVR serializes access to this table, as does a FGV or a single item queue, and made a normal thread as long as your subVIs that alter this table always pass the entrance through the exit.

    gregoryj wrote:

    I'm not too familiar with the Swap Values function. Should not be used when the data is stored is not unbundle node?

    In this case it worsens your code, unless the compiler optimizes out. The multiplication operation works normally in place on top of entry, if he can. However, with values of your Swap, the code now has a copy of the unedited value, as well, so he can exchange - you forced a copy where none was previously necessary. See the screenshot below showing buffer allocations. The version with the swap requires 4 allowances of buffer, the version without works with only 3. Does not clutter your code with unnecessary functions that you do not really understand.

  • Manipulation of data from a cursor ref in the block of data in a form

    I use Oracle Forms 10 g. I have a ref cursor that returns the columns A, B, C, D, E, B, C, D, E are where values. The attribute"query data Source name"in the datablock contains "CCTR_Extract_pkg.cctr_refcur". The attribute 'Column name' article A contains 'A', point B contains 'B', etc. All of these columns are displayed on the form, and everything works perfectly.

    I have a new request, users would like a 6th displayed column - F - where it is equal to D - B.

    Is it possible to do so in the form only, or do I have to change the ref cursor to accommodate the new column, and then the form?
    If it is possible in the form (only) - how to reference the 2 columns?

    Thank you in anticipation
    Michael

    Published by: user8897365 on August 24, 2011 10:32

    My understanding of the ref Cursor, if you change it and then all other objects that use it also require recompilation. I was trying to avoid this situation.

    Since your block of form data is based on the Ref Cursor, you cannot avoid this. You must change the Ref Cursor to add the required columns.

    I was hoping that there may be a way to reference the elements of ref cursor in a similar way (IE not change ref cursor).

    Depending on how the new columns are data in your Ref Cursor, you could add the columns as part of another base table and then use the trigger after query to retrieve the associated data. Unfortunately, this make the data in these new column cannot be changed. If you do not need the ability to update data, it is an option.

    Craig...

  • Manipulation of date in Flex?

    I found out how get the time UNIX in Flex. I do this by using the public service.


    public function getUnixTime (): String {}
    var myDate:Date = new Date();
    var unixTime:Number = Math.round(myDate.getTime()/1000;)
    Return unixTime.toString ();
    }

    So far, he doing it what I want it to do. But now I wanted to know, is it possible to get the consideration given readable to a UNIX timestamp date? If so, how?

    For example:

    1236268800 converts to Thursday March 5 08:00:00 GMT - 0800 2009 or vice versa.

    http://NTT.CC/2008/09/04/AS3corelib-tutorial-how-to-use-DateUtil-class-in-Flex.html

    should help you

  • manipulation of data

    Jin

    IAM in the presence of a field in my report, which is to have a source of (amount).
    I don't want the data that is retrieved from this source (amount). I jst need to assign the value is 0.00
    How to do

    Hello

    So just put a textthat contains * 0.00* instead of the amount column.

    Kind regards

    Manu.

  • UTF 8 Conversion and manipulation of data EXCEED_SIZE

    Currently, I am working on a UTF-8 conversion task.

    We ran the csscan on the database and identify the tables and columns that are data that can 'EXCEED_SIZE' and 'DATA_LOSS.

    Here are the details of my database:
    Database version: 9.2.0.8.0
    NLS_CHARACTERSET: WE8ISO8859P1

    My question is, how can we identify the number of characters to truncate data EXCEED_SIZE, so that the data resulting will be insert in the post column conversion?

    Any document available on the treatment of EXCEED_SIZE data and DATA_LOSS cases.

    Thank you
    Anil

    There is no function unique SQL or an expression that can allow you to find the maximum substring of the current value that is will insert in the column after the conversion. But you can write a PL/SQL function that returns the string on the right using probing approach.

    FUNCTION to CREATE or REPLACE max_substring (VARCHAR2, max_column_length NUMBER input_string) RETURN VARCHAR2 IS

    substring VARCHAR2 (4000 BYTE);
    BEGIN
    substring: = input_string;
    LOOP
    IF the substring IS NULL THEN
    RETURNS A NULL VALUE.
    END IF;
    IF LENGTHB (CONVERT (substring, 'UTF8', 'WE8ISO8859P1')) < = max_column_length THEN
    RETURNS the substring; -the substring is part of the column even after conversion
    END IF;
    substring: = SUBSTR (substring, 1, LENGTH (substring) - 1); -remove the last character
    END LOOP;
    END;

    Please, test and revise this function carefully before using it in production. It can be applied to:

    UPDATE table SET columnis max_substring(+column+,+column_length+);.

    Change the arguments to be CONVERTED if the character of the target or source of change.

    As it has already recommended:
    1. check if your database has WE8MSWIN1252 codes (bytes in the range 0 x 80-0x9F)
    2 consider using AL32UTF8 instead of the UTF8. UTF8 is needed only for databases that interface with clients 8.1 or older and databases.

    -Sergiusz

  • Pump data and Manipulation of data (DML)

    Hi all
    I wonder if there is a way to manipulate the table column, the data in a Data Pump export? For example, is it possible make the following changes in the export of DP:

    employee update
    Set firstname = 'a new string ";

    We are looking for a way where we can protect the sensitve data columns. We already have a script for updating the data in the column (ie the text scramble to protect privacy), but we want to automate changes that export us the database schema, rather than having to export, import, running DML and then export it again.

    Any ideas or advice would be great!

    Kind regards

    Leigh.

    Hi Leigh,

    Take a look at this great book:

    -[Transformations of data with Oracle Data Pump | http://www.oracle.com/technology/products/database/utilities/pdf/datapump11g2007_remapdata.pdf]

    I hope this helps you,

    See you soon,.

    Francisco Munoz Alvarez
    www.oraclenz.com

  • Need help with debugging case manipulation statement &amp; date

    Hi people,

    Can you get it someone please let me know what I am doing wrong?

    Select to_date (23-seven.-10', 'DD-MON-yy') expiry_date,.
    TO_DATE (23-sep-09', 'DD-MON-yy') order_date,.
    TO_DATE (23-seven.-10', 'DD-MON-yy')-to_date (23-sep-09', 'DD-MON-yy') diff,.
    (case diff
    When < 365 then 'low '.
    When > 365 then 'high '.
    other 'similar '.
    end)
    Double;


    ORA-00936: lack of expression
    00936 00000 - "missing expression.
    * Cause:
    * Action:
    Error on line: column 5:18


    Thanks in advance

    rogers42

    Here you go

    WITH temp_tab AS
        (SELECT to_date('23-sep-09',      'DD-MON-yy') order_date,
             to_date('23-sep-10',      'DD-MON-yy') -to_date('23-sep-09',      'DD-MON-yy') diff,
             to_date('23-sep-10',      'DD-MON-yy') expiry_date
         FROM dual)
    SELECT(
    CASE
    WHEN diff < 365 THEN 'low'
    WHEN diff > 365 THEN 'high'
    ELSE 'same'
    END)
    FROM temp_tab;
    
  • Manipulation of data collection with loop

    Hello

    I want to write a SQL procedure that calculates and generate revenue with the parameter array type.

    1. it has table for the type of income and the amount.
    > ('cash', '500')
    > ("Service", "100")
    > ('cash', '100')
    > ("sentence", "50")
    > ('Service', '200')
    > ("penalty, 80')

    2. I want to generate income as the sum of them.
    > cash: 600
    > Service: 300
    > sentence: 130

    3 table parameter means;
    "> create or replace the NUMBER TABLE (10.2) of TYPE"NUMBER_ARRAY"AS"

    Questions
    Q1. Can I sort and sum with table group?
    Q2. Type of income can be increased or decreased subsequently. This is why I don't want to fix it.
    How can I implement this dynamically?


    Any good idea?

    Thanks in advance
    Dan

    You are looking for something like this

    create or replace type objIncome as object(incomeType varchar2(50), income number(10,2))
    /
    create or replace type tblIncome as table of objIncome
    /
    declare
      lIncomeTbl tblIncome := tblIncome();
    begin
      lIncomeTbl.extend;
      lIncomeTbl(1) := objIncome('cash','500');
      lIncomeTbl.extend;
      lIncomeTbl(2) := objIncome('Service','100');
      lIncomeTbl.extend;
      lIncomeTbl(3) := objIncome('cash','100');
      lIncomeTbl.extend;
      lIncomeTbl(4) := objIncome('penalty','50');
      lIncomeTbl.extend;
      lIncomeTbl(5) := objIncome('Service','200');
      lIncomeTbl.extend;
      lIncomeTbl(6) := objIncome('penalty','80');
    
      for i in (select incometype, sum(income) income
                  from table(lIncomeTbl)
                 group by incometype)
      loop
        dbms_output.put_line('Income Type: ' || i.incometype ||' Income: ' || i.income);
      end loop;
    end;
    /
    
  • Help on the manipulation of data

    I hope I can explain it properly, go here

    I do a program help desk for a conversion on an old program help desk, in each case, there is evidence, but instead of putting this info a clob, the former program
    a pointer to the column as C:\Documents and Settings\burnetde\Desktop\Daarel has ' done s\Remedy\Ms closing Requests.msg DR
    and as
    C:\Documents and Settings\dburnette\My Documents\SCRs & DRs\Z Cooper Notice_Jun 05.Marco doc update

    so not all the same.

    then the old program comes all the docs support real in a directory so that just the names are in there as
    MS made DR closing Requests.msg
    Doc 05.Marco Z Cooper update Notice_Jun

    hope that can I do correspond to the top and put them in a clob in my new program.

    Thanks for you help,
    Doug

    more a question of sql or pl/sql to an apex question actually :)
    Select substr ( , instr ( , '-',-1) + 1) twice;

    something like this should do the trick.

  • Manipulation of the data in table

    I would like to be able to manipulate certain data (columns 2 and 3 of the txt file) that I collect according to time (column 1 of the txt file).

    Now, as the VI is running, these data are plotted on a graph in wave form and stored in a txt file.

    What I have to do is:

    Column 1 - convert every moment at a wavelength.  I know starting wavelength (nm) and the rate of change of wavelength (nm/s).  I do this conversion on an excel spreadsheet right now where [current wavelength = previous wavelength - rate of change of wavelength * (time-previous time)].  So how extract column 1, take the difference between the value of the second and the first value and create a new column (somewhere) corresponding to the wavelength?  And save it in a new column?

    Column 2 - need to divide each value by 100 and subtract by a 'base' (on average the first 20 points, for example).

    Column 3 - as it is.

    Last step - write to the file a new column defined as manipulated column 2 divided by column 100 3 times... and then this field (on the y-axis) based on the manipulated column 1 (x axis).

    It is extremely critical that the manipulation of data occur in real time... it can occur after the file has been written if necessary.  The graphic result should stand as the jpeg attached.

    Thank you in advance for the help - I'm a little unsure on the conversion of table, unbundling, etc. so much unlike mathematical and medium which must be obtained.

    Meredith


  • Database inside Openscript data manipulation

    Hi all

    Can someone help me in the manipulation of data within Openscript database.

    Anticipate the early response.

    Hello

    Make use of the following to manipulate the data to a csv file-
    Table table1 = utilities.loadCSV ("path of csv");
    After loading the table, we can use variables to manipulate the data.
    getVariables () .set ("variable name", table1.getRow(row_number).get (column number) ');

    Kind regards
    Rajesh

  • Best practices of implementation of Data Manipulation package

    Hello
    Would like to ask who is the best application for the manipulation of data (insert, update, delete) for a single table in the stored procedure.
    To create a procedure with an input parameter for the action such as 1 for insert, 2 for update and so on
    or
    creating separate procedures for each procedure pInsData for insert, pUpdData for update...

    Hello

    I propose to create a single procedure that manages all updates DML on a table. As you said, you can spend on one flag indicating the intended operation.
    It may be that one IN parameter, which can have different values, say - 'I' for Insert, 'U' for update and had "for deletion.

    Thank you
    Ankur

Maybe you are looking for