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.

BIN_TO_NUM Oracle Problem

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

Wie damals von auch vorgeschlagen, möchte ich die BIN_TO_NUM-Funktion nutzen.

Jetzt habe ich aber folgendes Problem:

In einem Array stehen die Zahlen so drinne:

0 0 0 1 1

Da die Syntax von BIN_TO_NUM(expr [,expr]) habe ich das Problem, dass die die Zahlen mit Komma von einander trennen muss.

Mit dem Schrittweise durchgehen des Arrays hat auch Funktioniert.

Wenn ich nun Select BIN_TO_NUM(ArraymitKommas) into xyz from dual sage, dann sagt mr Oracle gerechterweise, dass die Number invalid ist.

Warum? Ich habe mir einen String zusammengebastelt, der '0,0,0,1,1' beinhaltet.

Gibt es eine Möglichkeit aus dem Array diesen Befehl ausführbar zu machen?

Gruß Ganymed

  • Autor

Nachtrag:

Also ich habe jetzt folgendes Probiert


   sql:='select BIN_TO_NUM(';

        FOR i IN Bin1.FIRST..bin1.LAST-1

           LOOP

              sql := sql || Bin1(i) || ',';

           END LOOP;

           test :=bin1.LAST;

           sql := sql|| Bin1(test);

    sql := sql ||') INTO ausgabe1 from dual;';


    -- SELECT bin_to_num(sql) INTO ausgabe1 FROM dual; 


       [B]EXECUTE IMMEDIATE sql;[/B]


Mit dem Execute sagt er mit Invalid Character...

  • Autor

So, nochmal ich und jetzt hab ich wirklich keine Idee mehr.

Ich habe das Semikolon am Ende des SQL-Strings Entfernt.

Jetzt habe ich die Fehlermeldung "missing keyword"...

Was kann denn da fehlen?! :confused:

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.