c# - How to pass DateTime parameter in SQL query for Oracle DB -
I want to include some 'timestamp' fields in the SQL query WHERE clause:
In my code the created prefix parameter is defined in the following way ... command. Parameter. Add (": Built-in Project", Miscellaneous. ConvertoOurachtimestamp (built-in property); ... static class diversified {public static OracleTimeStamp convertor oretimestamp (date time date time) {OracleTimeStamp results = new OracleTimeStamp (datetime); Return result; }} And as a result, I get the following exception
Exception: Additional information: ORA-00932: Incompatible datatype: Expected TIMESTAMP found NUMBER
Can you please tell me, how to pass a datetime in SQL query for OKACKAL DB?
PS What I have tried: - I have created an Oracle parameter with attributes
OracleParameter Para = New OracleParameter (); Paragraph Parameter name = ": built prap"; Paragraph Direction = System.Data.Pameter Direction.Input; Paragraph Oracleb type = Oraclebetype Timestamp; Paragraph Value = Miscellaneous Convertro oakatimstamp (built-in); - I have just passed the date time and I got another exception
- I have tried to type the parameter DATE (to_date ()) From), but in this case it seems that I am losing minutes and seconds
unite it : from person SELECT * where PSN_CREATED_DATE & gt; = TO_TIMESTAMP or use the timestamp parameter in C #, this should be
OracleParameter Para = New OracleParameter (": Built Project", Oracle biotype timestamp, parameter direction. Input); Paragraph Value = (Oracle.DataAvetyTypeOrcal Timestamp) value; command.Parameters.Add (paragraph);
Comments
Post a Comment