MySQL Workbench reading out a BLOB containing a date - mysql

I have a table with questions in them. They have a date column with as type a BLOB.
Is it possible for MySQL to read out the BLOB as I can't convert it to a normal DATE type

Without knowing why you have a DATE stored in a BLOB field have you tried using the STR_TO_DATE function?
SELECT STR_TO_DATE(your_blob_field,'%d,%m,%Y');

Related

informatica Datetime conversion to SQL server Timstamp

I have a requirement where I have to load Informatica SESSSTARTTIME(datetime) to SQL server timestamp. When I am trying to connect datetime to timestamp I am getting error incompatible data type. 
Any suggestions how this can be achieved? 
Thanks
I had a similar issue in the past, where the date column was not getting loaded because of the difference in precision of date/time used by Informatica and SQL server. You can try this workaround: Change the data type in the target definition (not in SQL Server table, only in Informatica Target definition) to String, then Informatica will pass the date/time value in quotes when firing the insert query, which SQL server can convert to date/time automatically.
in the mapping try to create output port in expression as sessionstarttime (which is a inbuilt variable) and pass it to target
hope this will help to get desire output
in session there is config tab where you can change the format for date and time
MS SQL Server timestamp datatype has nothing to do with time. It's an autogenerated number and you cannot load it.
https://msdn.microsoft.com/en-us/library/ms182776(v=SQL.90).aspx
quote:
"Is a data type that exposes automatically generated, unique binary numbers within a database. timestamp is generally used as a mechanism for version-stamping table rows. The storage size is 8 bytes. The timestamp data type is just an incrementing number and does not preserve a date or a time. To record a date or time, use a datetime data type."

convert column to varchar in oracle which is mysql longtext

i have a insert statement pulling data from db link.
insert into table (a,b,c)
select a,b,c from table#mysqldb;
here column c is long type in mysql and in oracle its varchar
i tried to cast as varchar, substr(c, 1,2400), UTL_RAW.CAST_TO_VARCHAR2,dbms_lob.substr
none of them are working on oracle side.
tried cast on mysql read part no use.
Can someone tell me how to do this. Here Iam trying to convert long to varchar. we cannot load as clob as this table is used in many places and we cannot change things at so many places
Thanks.
i had to convert the target column to clob to handle this scenario

Changing the format of data inputs for dates. From sybase to mysql

Changing the format of data inputs for dates. From sybase to MySQL
I am trying to see if there is a way to change the data format of dates from
Sybase(YYYYMMDD) to MySQL(YYYY-MM-DD)
I exported a Schema Script from Sybase to be use/migrate to MySQL but for one of my tables the data for the dates were enter as YYYYMMDD and is not recognize by MySQL so it just zeroes it out when attempting to insert the data.
updated format
You can use function STR_TO_DATE to format from sybase format to MySQL format
https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_str-to-date
You can store the data from sybase in a varchar column in mysql and then convert in data by str_to_date
SELECT STR_TO_DATE('20160701','%Y%m,%d') from your_table;

php/mysql routine to help me extract all dates strings stored in a column as text dd/mm/yyyy into another fresh column with mysql date datatype

i am new here and i need help with writing a php/mysql routine to help me extract all dates strings stored in a column as text in this format dd/mm/yyyy into another fresh column with mysql date datatype in the format yyyy-mm-dd.
i have tried to query through the table using a date range and it seems not to work, so i have resolve to change th already store dates into the proper mysql format to enable me query with date easily.
indeed i am most greatful of any assistance i get.
thanks
Handyx
First of all you probably shouldn't be doing what your doing, convert the date on the go. Nevertheless here's the SQL query to do what you want to do
USE `DATABASE`;
UPDATE `TABLE_NAME` SET `TABLE_NAME.NEW_COLUMN` = DATE_FORMAT(
STR_TO_DATE(`TABLE_NAME.OLD_COLUMN`,'%d/%m/%Y'), '%Y-%m-%d');

Importing date value from .csv file to MySql database using LOAD DATA INFILE

In my project i need to upload the data which are stored in .csv file in to MySql database table. One of the column in the table is "dateTime".
I tried to upload the data using LOAD DATA INFILE. But i am getting below error when i ran the script.
Incorrect datetime value : "23-JUN-14 01.50.00.944000000 PM"
So my question is how i can load this type of date value to the table.
Please direct me.
AS per mysql for datetime data type of a column,
The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.
So you can change the data type of that column to varchar and after loading the file, you can update the value of that column according to that data type.
for more >>
http://dev.mysql.com/doc/refman/5.1/en/datetime.html