You Asked
1)If I created a procedure in trigger after that i modify the procedure. my question is the trigger is working fine or procedure changes, effected trigger also?..
2)There is one table.
table1(inpt)...........target(output)...
1 0000000001
12 0000000012
123 0000000123
1234 0000001234
12345
123456
I have already asked this question a few days back.You gave me an answer like.
Select colname,to_char(123,'fm0000000000000') from tbl.
But we can solve with lpad also...like...Select lpad(col,10,0) from table.
Note:--what is the major diff of both the codes.
and Connor said...
Minimal difference. The to_char might be a tiny bit faster because the lpad is actually TWO operations (1) convert the number to string, (2) pad it out.
SQL> set timing on
SQL> declare
2 x varchar2(20);
3 begin
4 for i in 1 .. 10000000 loop
5 x := to_char(i,'fm0000000000');
6 end loop;
7 end;
8 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.98
SQL>
SQL>
SQL> declare
2 x varchar2(20);
3 begin
4 for i in 1 .. 10000000 loop
5 x := lpad(i,10,'0');
6 end loop;
7 end;
8 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:03.15
but it's hardly noticeable
Rating
(1 rating)
Is this answer out of date? If it is, please let us know via a Comment