Skip to main content

Posts

Showing posts from February, 2013

Working with "Paths" in C#

using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ProTestService {     class Program     {          static void Main( string [] args)          {              string path = System.IO. Path .GetDirectoryName(System.Reflection. Assembly .GetExecutingAssembly().GetName().CodeBase);              path = Path .Combine(path.Replace( "file:\\" , "" ), "test.txt" );              using ( StreamWriter newTask = new StreamWriter (path, true ))              {                   newTask.WriteLine( "ProTestService calisma zamani--> "  + DateTime .Now.ToString());              }          }      } }

PL/SQL Synonym and Grant

grant select on table_name to schema_name; grant select on seq_name to schema_name; grant insert on table_name to schema_name; grant update on table_name to schema_name; grant execute on schema_name_x.pkg_package_name to schema_name_y; ------ create or replace synonym schema_name_2.table_name for schema_name_1.table_name; drop sysnonym schema_name_2.table_name;

PL/SQL Using In&In Reverse Options in the Loop

begin   for v_counter in 0..10 loop       if mod(v_counter,2)=0 then             dbms_output.put_line('v_counter='||v_counter);           end if;     end loop;     dbms_output.put_line('Done...'); end; begin   for v_counter in reverse 0..10 loop       if mod(v_counter,2)=1 then             dbms_output.put_line('v_counter='||v_counter);           end if;     end loop;     dbms_output.put_line('Done..'); end; *******outputs******** v_counter=0 v_counter=2 v_counter=4 v_counter=6 v_counter=8 v_counter=10 Done... v_counter=9 v_counter=7 v_counter=5 v_counter=3 v_counter=1 Done..

PL/SQL Use Loop with "Exit When" Condition

declare   v_student_id students.section_id%type:=5;   v_surname students.student_surname%type; begin   loop         v_student_id:=v_student_id+1;         insert into students         (           student_id,           student_surname         )         values         (           v_student_id,           'Test xyz'         );         exit when v_student_id=10;       end loop;       dbms_output.put_line('Done...'); end;