Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PL/SQL Datentyp Float

Empfohlene Antworten

Veröffentlicht

Hallo.

Ich möchte in Form eines SQL Skripts die Bearbeitungszeit verschiedener Datentypen testen.

set serveroutput on




DECLARE




   start_time INTEGER;


   SUBTYPE MY_FLOAT is FLOAT;

   ITERATIONS MY_FLOAT := 1.23456789;  --2147483647;


--   SUBTYPE MY_FLOAT is FLOAT;

--   ITERATIONS MY_FLOAT := 12345678.9;  --2147483647;


/*   

   SUBTYPE MY_INTEGER IS PLS_INTEGER; 

   iterations MY_INTEGER := 10000000;  --2147483647;

   Zeitdauer: 3.31 seconds


   SUBTYPE MY_BINARY_INTERGER is BINARY_INTEGER;

   iterations MY_BINARY_INTERGER := 10000000;  --2147483647;

   Zeitdauer: 3.34 seconds


   SUBTYPE MY_NATURAL is NATURAL;

   iterations MY_NATURAL := 10000000;  --2147483647;

   Zeitdauer: 6.43 seconds


   SUBTYPE MY_NUMBER is NUMBER;

   iterations MY_NUMBER := 10000000;  --2147483647;

   Zeitdauer: 6.68 seconds


   SUBTYPE MY_NUMERIC is NUMERIC;

   iterations MY_NUMERIC := 10000000;  --2147483647;

   Zeitdauer: 11.23 seconds

*/


BEGIN

   DBMS_OUTPUT.put_line ( 'Laufzeitmessung....' );

   start_time := DBMS_UTILITY.get_cpu_time;



   LOOP

   iterations := iterations - 1;

   IF iterations = 0 THEN GOTO ende; END IF;   

   END LOOP;


   <<ende>>


   zettier.show_elapsed_time ( 'Zeitdauer'

                     , DBMS_UTILITY.get_cpu_time - start_time

                     );


END;

/

Für alle Unterdatentypen bis auf Float funktioniert es. Die Fließkommazahl möchte ich einmal mit vielen Stellen vor und einmal mit vielen Stellen nach dem Komma testen. Doch wenn ich das sql Skript starte, erhalte ich keine Rückmeldung, auch nicht mit --10 iterations. Es scheint, als würde sich das ganze dann festhängen.

1) Muss ich die Fließkommazahlen anders "eingeben"?

2) Sind iterations auf Fließkommazahlen möglich?

3) Mache ich was anderes falsch?

Gruß,

Marko.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.