Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Date column as TEXT in pre-existing database
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
sebastijanp  
View profile  
 More options Jul 12 2012, 11:46 am
From: sebastijanp <sebastijan.pistot...@gmail.com>
Date: Thu, 12 Jul 2012 08:46:23 -0700 (PDT)
Local: Thurs, Jul 12 2012 11:46 am
Subject: Date column as TEXT in pre-existing database

Hi

I have a pre-existing database that I copy from assets dir to sd card.
I have a table with date column and I store it as TEXT in the format
yyyy-MM-dd HH:mm:ss.

I noticed that you use long for storing date:

stmt.bindLong(2, WorkingDate.getTime());

Is there a way to map the date property to date as TEXT column type in
database?

I tried with
t.addDateProperty("workingDate").columnName("WorkingDate").columnType("TEXT ");

But it still generates the above long type bind.

Regards,
Sebastijan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Markus Junginger  
View profile  
 More options Jul 12 2012, 12:02 pm
From: Markus Junginger <mar...@greenrobot.de>
Date: Thu, 12 Jul 2012 09:02:22 -0700 (PDT)
Local: Thurs, Jul 12 2012 12:02 pm
Subject: Re: Date column as TEXT in pre-existing database

The Date type currently always maps to a long value. There's already a
ticket to for text based Datess, but this is currently supported.

My suggestion: bind the text to a String property and use keep sections to
create a custom Date or long property that maps from/to the string property.

Markus


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sebastijanp  
View profile  
 More options Jul 12 2012, 12:43 pm
From: sebastijanp <sebastijan.pistot...@gmail.com>
Date: Thu, 12 Jul 2012 09:43:52 -0700 (PDT)
Local: Thurs, Jul 12 2012 12:43 pm
Subject: Re: Date column as TEXT in pre-existing database

AAA great...nice feature:) It is working! Thank you.

Sebastijan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »