PC Review


Reply
Thread Tools Rate Thread

How do I insert sysdate into a column

 
 
Phil Hunt
Guest
Posts: n/a
 
      20th Jun 2008
I am using OLEDataAdaptor, DataTable and DataRow to insert a row like

dr["CREATEDDATE"] = ......

My question is how do I set that column to "Oracle sysdate"

TIA.


 
Reply With Quote
 
 
 
 
Miha Markic
Guest
Posts: n/a
 
      20th Jun 2008
You have to properly compose (proper SQL syntax) InsertCommand or
UpdateCommand.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Phil Hunt" <(E-Mail Removed)> wrote in message
news:OTin6$(E-Mail Removed)...
>I am using OLEDataAdaptor, DataTable and DataRow to insert a row like
>
> dr["CREATEDDATE"] = ......
>
> My question is how do I set that column to "Oracle sysdate"
>
> TIA.
>


 
Reply With Quote
 
Phil Hunt
Guest
Posts: n/a
 
      20th Jun 2008
I know how to do it in a straight SQL statement. But not with thess fancy
object. Can you be more specific ???

"Miha Markic" <miha at rthand com> wrote in message
news:(E-Mail Removed)...
> You have to properly compose (proper SQL syntax) InsertCommand or
> UpdateCommand.
>
> --
> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
> RightHand .NET consulting & development www.rthand.com
> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>
> "Phil Hunt" <(E-Mail Removed)> wrote in message
> news:OTin6$(E-Mail Removed)...
>>I am using OLEDataAdaptor, DataTable and DataRow to insert a row like
>>
>> dr["CREATEDDATE"] = ......
>>
>> My question is how do I set that column to "Oracle sysdate"
>>
>> TIA.
>>

>



 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      21st Jun 2008
Phil,

The Oracle System date is only on the server an can therefore only be done
in the SQL script itself.

The dr["Sysdate"] which is at the client side never reaches the Oracle
system, that what reaches the Oracle system is a parameter in the insert SQL
procedure or SQL procedure.

You can of course first select it, however then that datetime is again old.

Cor

"Phil Hunt" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
>I know how to do it in a straight SQL statement. But not with thess fancy
>object. Can you be more specific ???
>
> "Miha Markic" <miha at rthand com> wrote in message
> news:(E-Mail Removed)...
>> You have to properly compose (proper SQL syntax) InsertCommand or
>> UpdateCommand.
>>
>> --
>> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
>> RightHand .NET consulting & development www.rthand.com
>> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>>
>> "Phil Hunt" <(E-Mail Removed)> wrote in message
>> news:OTin6$(E-Mail Removed)...
>>>I am using OLEDataAdaptor, DataTable and DataRow to insert a row like
>>>
>>> dr["CREATEDDATE"] = ......
>>>
>>> My question is how do I set that column to "Oracle sysdate"
>>>
>>> TIA.
>>>

>>

>
>


 
Reply With Quote
 
Miha Markic
Guest
Posts: n/a
 
      21st Jun 2008
If you look at dataadapter it has three commands:InsertCommand,
UpdateCommand and DeleteCommand.
Each is executed for specific action (based on DataRow.RowState property).
These are all instances of DbCommand descendent classes.
You should look at its CommandText property where SQL command text is
stored.
By default all values are (more or less all) fetched from DataRow.
You should change this SQL text to your wishes (substitue a parameter with
sysdate - so value isn't fetched from datarow but rather it is done by using
sysdate on the server)

HTH
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Phil Hunt" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I know how to do it in a straight SQL statement. But not with thess fancy
>object. Can you be more specific ???
>
> "Miha Markic" <miha at rthand com> wrote in message
> news:(E-Mail Removed)...
>> You have to properly compose (proper SQL syntax) InsertCommand or
>> UpdateCommand.
>>
>> --
>> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
>> RightHand .NET consulting & development www.rthand.com
>> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>>
>> "Phil Hunt" <(E-Mail Removed)> wrote in message
>> news:OTin6$(E-Mail Removed)...
>>>I am using OLEDataAdaptor, DataTable and DataRow to insert a row like
>>>
>>> dr["CREATEDDATE"] = ......
>>>
>>> My question is how do I set that column to "Oracle sysdate"
>>>
>>> TIA.
>>>

>>

>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sysdate bassam Windows Vista General Discussion 1 11th Dec 2008 04:59 PM
Getting SysDate from back end PC instead of front end PC? (PeteCresswell) Microsoft Access 12 19th Aug 2007 12:22 AM
sysdate query in ms access =?Utf-8?B?c3VraHdpbmRlcg==?= Microsoft Access Queries 1 3rd Dec 2004 08:52 AM
Append sysdate to file name Otto Naesset Microsoft Windows 2000 CMD Promt 1 23rd Dec 2003 02:20 PM
Sysdate Equivalent Mark Watkins Microsoft Access Queries 3 28th Oct 2003 09:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:08 AM.