Archive

Archive for the ‘Snippets’ Category

performance

Tuesday, 18 August, 2009 Leave a comment
DECLARE
 l_start NUMBER;
 l_end   NUMBER;
BEGIN
 ...
 l_start := dbms_utility.get_time;
 ...
 l_end   := round((dbms_utility.get_time - l_start) / 100, 2);
 dbms_output.put_line(l_end || ' seconds...');
END;
Advertisements
Categories: PL/SQL, Snippets Tags: ,

performance

Tuesday, 18 August, 2009 Leave a comment
DECLARE
 l_start NUMBER;
 l_end   NUMBER;
BEGIN
 ...
 l_start := dbms_utility.get_time;
 ...
 l_end   := round((dbms_utility.get_time - l_start) / 100, 2);
 dbms_output.put_line(l_end || ' seconds...');
END;
Categories: PL/SQL, Snippets Tags: ,

(PL\SQL) How to get MAX(num)+DISTINCT str

Tuesday, 18 August, 2009 2 comments
CLEAR;  
with t as  
 (
 select '11' num, 'string1' str, '1' DATA from dual union all  
 select '12' num, 'string1' str, '3' DATA from dual union all  
 select '15' num, 'string1' str, '3' DATA from dual union all  
 select '25' num, 'string2' str, '10' DATA from dual union all  
 select '26' num, 'string2' str, '2' DATA from dual union all  
 SELECT '29' num, 'string2' str, '4' DATA from dual  
 )  
SELECT * FROM t  
WHERE num IN (SELECT MAX(num) FROM t tt WHERE t.str = tt.str);
Categories: PL/SQL, Snippets Tags: ,

(PLSQL) How to get MAX(num)+DISTINCT str

Tuesday, 18 August, 2009 2 comments
CLEAR;  
with t as  
 (
 select '11' num, 'string1' str, '1' DATA from dual union all  
 select '12' num, 'string1' str, '3' DATA from dual union all  
 select '15' num, 'string1' str, '3' DATA from dual union all  
 select '25' num, 'string2' str, '10' DATA from dual union all  
 select '26' num, 'string2' str, '2' DATA from dual union all  
 SELECT '29' num, 'string2' str, '4' DATA from dual  
 )  
SELECT * FROM t  
WHERE num IN (SELECT MAX(num) FROM t tt WHERE t.str = tt.str);
Categories: PL/SQL, Snippets Tags: ,

Index info oracle

Tuesday, 20 January, 2009 Leave a comment
SELECT a.index_name,  b.column_name, 
           a.index_type, a.table_name
  FROM USER_INDEXES a, USER_IND_COLUMNS b
 WHERE a.index_name = b.index_name
       AND a.table_name = upper('tDocument');
Categories: Oracle, Snippets Tags: ,

Global Variable 2nd method

Thursday, 15 May, 2008 3 comments

App_Code\GData.cs
using System;
using System.Data;
...
public class UserInfo
{
private static string pin;
public static string Pin
{
get { return pin; }
set { pin = value; }
}
private static string fio;
public static string Fio
{
get { return fio; }
set { fio = value; }
}
}
public class QData
{
...
public class GData
{
public static void SetUserInfoPIN(string pin)
{
UserInfo.Pin = pin;
}
public static string GetUserInfoPIN()
{
return UserInfo.Pin;
}
...
}

Read more…

Read typed file – pascal

Wednesday, 7 May, 2008 1 comment

File structure in C++

typedef struct TAGRECORD
{
char DeviceName[50]; // Имяприбора
char TagName[10]; // Имяпараметра
char TagValue[50]; // Значение
time_t TagTime; // Время записи
int TagChannel; // Канал
int TagInfo; // 0 - info, 1 - control
} TAGRECORD,*LPTAGRECORD;

Read it with Pascal?

Solution >>>
Read more…

Categories: Delphi, Pascal Tags: , ,