|
-
Hi Everybody,
I am trying to insert an increment of the binary numbers on a file... the binary for 1, 2, 3 ....etc. Using sequence will no work with binary. So I created the file:
CREATE TABLE testraw (col1 NUMBER, col2 LONG RAW);
---
Then I wrote a PL/SQL to insert the binary in the LONG RAW data column as it is incremented:
declare
i varchar2(200);
total number := 1;
begin
WHILE total <= 10 LOOP
i := '10010101000101010010011010100101010010011101010011';
if total = 1 THEN
insert into TESTRAW
values
(1,'10010101000101010010011010100101010010011101010011');
dbms_output.put_line(i);
total := total + 1;
else
i := i + 1;
dbms_output.put_line(i);
insert into TESTRAW
values (total, i);
total := total + 1;
end if;
END LOOP;
END;
---- Results ---
10010101000101010010011010100101010010011101010011
10010101000101010010011010100101010010010000000000
10010101000101010010011010100101010010010000000000
10010101000101010010011010100101010010010000000000
10010101000101010010011010100101010010010000000000
10010101000101010010011010100101010010010000000000
10010101000101010010011010100101010010010000000000
10010101000101010010011010100101010010010000000000
10010101000101010010011010100101010010010000000000
10010101000101010010011010100101010010010000000000
-------
How can I tell whether the binary is truly incremented in the long raw field (col2).... I ask that because when I display the ten records created the number that is shown is one (1) for the ten record created. I expected to see in col2 when I display.. 1, 2, 3, 4, ...10.
Please help!!!!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|