@@ -240,13 +240,81 @@ begin
240240 assert_equals('BINARY_FLOAT 2.', '2.2', trim(to_char(actual2, '9.9')));
241241 end;
242242
243+ --BINARY_DOUBLE.
244+ declare
245+ actual1 binary_double;
246+ actual2 binary_double;
247+ begin
248+ execute immediate
249+ q'<
250+ select *
251+ from table(method4.run('select 1.1d, cast(2.2 as binary_double) from dual'))
252+ >'
253+ into actual1, actual2;
254+
255+ assert_equals('BINARY_DOUBLE 1.', '1.1', trim(to_char(actual1, '9.9')));
256+ assert_equals('BINARY_DOUBLE 2.', '2.2', trim(to_char(actual2, '9.9')));
257+ end;
258+
259+ --TIMESTAMP [(fractional_seconds_precision)]
260+ --Note that SYSTIMESTAMP is not always the same as TIMESTAMP and worth testing.
261+ declare
262+ actual1 timestamp(9);
263+ actual2 timestamp(9);
264+ actual3 timestamp(9);
265+ actual4 timestamp(9);
266+ actual5 timestamp(9);
267+ begin
268+ execute immediate
269+ q'<
270+ select *
271+ from table(method4.run('
272+ select
273+ timestamp ''2000-01-01 12:34:56'',
274+ to_timestamp(''2000-01-02 12:34:56'', ''YYYY-MM-DD HH24:MI:SS''),
275+ to_timestamp(''2000-01-01 12:00:00.123456789'', ''YYYY-MM-DD HH24:MI:SS.FF9''),
276+ cast(date ''2000-01-01'' as timestamp(3)),
277+ systimestamp
278+ from dual'))
279+ >'
280+ into actual1, actual2, actual3, actual4, actual5;
281+
282+ assert_equals('Timestamp 1.', '2000-01-01 12:34:56', to_char(actual1, 'YYYY-MM-DD HH24:MI:SS'));
283+ assert_equals('Timestamp 2.', '2000-01-02 12:34:56', to_char(actual2, 'YYYY-MM-DD HH24:MI:SS'));
284+ assert_equals('Timestamp 3.', '2000-01-01 12:00:00.123456789', to_char(actual3, 'YYYY-MM-DD HH24:MI:SS.FF9'));
285+ assert_equals('Timestamp 4.', '2000-01-01', to_char(actual1, 'YYYY-MM-DD'));
286+ assert_equals('Timestamp 5.', to_char(systimestamp, 'YYYY-MM-DD HH24'), to_char(actual5, 'YYYY-MM-DD HH24'));
287+ end;
288+
289+ --TIMESTAMP [(fractional_seconds_precision)] WITH TIME ZONE
290+ declare
291+ actual1 timestamp(9) with time zone;
292+ actual2 timestamp(9) with time zone;
293+ actual3 timestamp(9) with time zone;
294+ actual4 timestamp(9) with time zone;
295+ begin
296+ execute immediate
297+ q'<
298+ select *
299+ from table(method4.run('
300+ select
301+ timestamp ''2000-01-01 12:34:56 +01:00'',
302+ timestamp ''2000-01-02 12:34:56 US/Eastern'',
303+ cast(date ''2000-01-04'' as timestamp(9) with time zone),
304+ cast(null as timestamp(9) with time zone)
305+ from dual'))
306+ >'
307+ into actual1, actual2, actual3, actual4;
308+
309+ assert_equals('Timestamp with time zone 1.', '2000-01-01 12:34:56 +01:00', to_char(actual1, 'YYYY-MM-DD HH24:MI:SS TZH:TZM'));
310+ assert_equals('Timestamp with time zone 2.', '2000-01-02 12:34:56 US/EASTERN', to_char(actual2, 'YYYY-MM-DD HH24:MI:SS TZR'));
311+ assert_equals('Timestamp with time zone 3.', '2000-01-04 00:00:00', to_char(actual3, 'YYYY-MM-DD HH24:MI:SS'));
312+ assert_equals('Timestamp with time zone 4.', '', actual4);
313+ end;
314+
243315
244316/*
245- BINARY_DOUBLE
246- TIMESTAMP [(fractional_seconds_precision)]
247- TIMESTAMP [(fractional_seconds_precision)] WITH TIME ZONE
248317TIMESTAMP [(fractional_seconds_precision)] WITH LOCAL TIME ZONE
249- SYSTIMESTAMP (in case it's different than a regular timestamp)
250318INTERVAL YEAR [(year_precision)] TO MONTH
251319INTERVAL DAY [(day_precision)] TO SECOND [(fractional_seconds_precision)]
252320RAW(size)
0 commit comments