troubleshooting Question

How to update Date column of sysbase IQ database Table

Avatar of welcome 123
welcome 123 asked on
Oracle DatabaseSybase DatabaseDB2
8 Comments1 Solution4517 ViewsLast Modified:
Hi,

This question I asked in this page earlier,
https://www.experts-exchange.com/OS/Unix/Q_28425882.html


I have Sybase iq Table Name dates_col in that I have column name DATE_BD whose
data stucture:
column_name: DATE_BD4
domain_name:date
width:4
scale:0
nulls:N

update  temp_table
set DATE_BD4= getdate()
WHERE PROCESS_MONTH        = 'MAR'
AND   PROCESS_YEAR        = 2014;
This works and updates DATE_BD4 with current date.

But I am only able to set to current date today's date to that column, is there is any way I can update any other value like tomorrow's date for that
column like below.

update  temp_table
set dateformat(DATE_BD4,'MM/DD/YYYY') = '05/05/2014'
WHERE PROCESS_MONTH        = 'MAR'
AND   PROCESS_YEAR        = 2014;
commit;

But I am getting the following error
> Script lines: 1-5 --------------------------
 SQL Anywhere Error -131: Syntax error near '=' on line 2
 Msg: 102, Level: 15, State: 0
 Line: 0

How can I update other dates by giving the value to the column directly.
https://www.experts-exchange.com/OS/Unix/Q_28425882.html


I want to assign any date to it, what I mean is here

update  temp_table
DATE_BD4 = '05/05/2014'
WHERE PROCESS_MONTH        = 'MAR'
AND   PROCESS_YEAR        = 2014;
commit;

DATE_BD4  can be,
DATE_BD4 = '05/05/2014'
DATE_BD4 = '10/07/2001'
DATE_BD4 = '03/05/1999'
DATE_BD4 = '09/07/2017'
DATE_BD4 = '08/25/2014'

etc you are functions might not happen in this case, I want the correct syntax where I can execute the update statement to set date column for any date value.

I am doing testing for this table, I will re-assign values as and when my testing is complete.

Thanks,
Sailaja
ASKER CERTIFIED SOLUTION
Ganapathi
Facets Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros