16 Ağustos 2021 Pazartesi

PLSQL % _ ' ÖZEL KARAKTER İLE ARAMA (ESCAPE)

 Veritabanında  % , _ ‘ , gibi değerler ile sorgulama yapabilmek için escape karakteri kullanımımıza sunulmuştur.

% ve _ (yüzde ve alt tire) aratırken uygulama aşağıdaki şekilde olmalıdır. 

%’nin veya _’nin başına * , / , \  gibi herhangi bir karakter eklenir. 

Where koşulunun sonuna ESCAPE metni yazılarak tırnak içinde arattığınız özel kelimenin önüne eklediğiniz karakteri belirtmemiz yeterlidir.


Örnek Kullanım ;

_ (alt çizgi) geçen kayıtlar.

SELECT * FROM ADRESLER WHERE CADDE LIKE '%*_%' ESCAPE '*';

SELECT * FROM ADRESLER WHERE CADDE LIKE '%/_%' ESCAPE '/';


% (yüzde) geçen kayıtları sorgulamak için

SELECT * FROM ADRESLER WHERE CADDE LIKE '%*%%' ESCAPE '*';

SELECT * FROM ADRESLER WHERE CADDE LIKE '%/%%' ESCAPE '/';


Tırnakta (') kullanım şekli uygulamada farklıdır. Arka arkaya iki tek tırnak ile ('') ile içinde ' (tırnak) geçen ifadeler aranabilir (tırnak=quote)

İçerisinde tek tırnak geçen kayıtları bulmak için; 

SELECT * FROM ADRESLER WHERE CADDE LIKE '%''%';

Not: ESCAPE karakteri olarak 1 karakter belirlenebilir.. Eğer 1 den fazla ESCAPE karakteri girilir ise aşağıdaki hatayı almanıza sebep olur.. 

ORA-01425: escape character must be character string of length 1

Share:

14 Mart 2021 Pazar

How to debug your Delphi application code?

You should type DEBUG in the same way as in this picture.

Delphi CPU debug seçeneğini kapatıp DCU olarak debug yapmak istiyorsanız aşağıdaki resimdeki ayarların karşısına aynı şekilde DEBUG yazarak kaydederseniz problem giderilmektedir.


Tools / Options / Building / Delphi Compiler

If you have any problems, please write to me. I try to help.
Share:

22 Ocak 2021 Cuma

Oracle tüm tablo kolonlarında text arama

 SQL> variable val varchar2(10)

  SQL> exec :val := 'Caddesi'

PL/SQL procedure successfully completed.

SQL> SELECT DISTINCT SUBSTR (:val, 1, 11) "ArananKelime",
  2    SUBSTR (table_name, 1, 14) "Tablo",
  3    SUBSTR (column_name, 1, 14) "Kolon"
  4  FROM cols,
  5    TABLE (xmlsequence (dbms_xmlgen.getxmltype ('select '
  6    || column_name
  7    || ' from '
  8    || table_name
  9    || ' where upper('
 10    || column_name
 11    || ') like upper(''%'
 12    || :val
 13    || '%'')' ).extract ('ROWSET/ROW/*') ) ) t
 14  ORDER BY "Table"
 15  /

ArananKelime Tablo          Kolon
-----------  -------------- --------------
CADDESI      CALISAN        ADRES
Share:

Searching text in the SQL all tables columns

 EXEC SearchAllTables 'test'

GO

CREATE PROC SearchAllTables
(
	@SearchStr nvarchar(100)
)
AS
BEGIN


	CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630))

	SET NOCOUNT ON

	DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)
	SET  @TableName = ''
	SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')

	WHILE @TableName IS NOT NULL
	BEGIN
		SET @ColumnName = ''
		SET @TableName = 
		(
			SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME))
			FROM 	INFORMATION_SCHEMA.TABLES
			WHERE 		TABLE_TYPE = 'BASE TABLE'
				AND	QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName
				AND	OBJECTPROPERTY(
						OBJECT_ID(
							QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)
							 ), 'IsMSShipped'
						       ) = 0
		)

		WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)
		BEGIN
			SET @ColumnName =
			(
				SELECT MIN(QUOTENAME(COLUMN_NAME))
				FROM 	INFORMATION_SCHEMA.COLUMNS
				WHERE 		TABLE_SCHEMA	= PARSENAME(@TableName, 2)
					AND	TABLE_NAME	= PARSENAME(@TableName, 1)
					AND	DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar')
					AND	QUOTENAME(COLUMN_NAME) > @ColumnName
			)
	
			IF @ColumnName IS NOT NULL
			BEGIN
				INSERT INTO #Results
				EXEC
				(
					'SELECT ''' + @TableName + '.' + @ColumnName + ''', LEFT(' + @ColumnName + ', 3630) 
					FROM ' + @TableName + ' (NOLOCK) ' +
					' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2
				)
			END
		END	
	END

	SELECT ColumnName, ColumnValue FROM #Results
END

Share:

18 Kasım 2020 Çarşamba

Çılgın Sayısal - Şans Topu - On Numara Kupon Oluşturucu

Yeni Çılgın Sayısal, Şans Topu ve On Numara için otomatik kupon oluşturucudur.

Geliştirilmesini istediğiniz istekleriniz için yorum yazabilirsiniz.


İndirmek için buraya tıklayabilirsiniz.

Share:

4 Haziran 2020 Perşembe

Windows Zaman Damgali ping Bağlantı Testi / Windows Time Stamp ping Connection Test


WindowsPowerShell:
seçenek 1 / Option 1
 ping.exe -t COMPUTERNAME|Foreach{"{0} - {1}" -f (Get-Date),$_}  veya
 ping.exe -t 10.227.23.241 |Foreach{"{0} - {1}" -f (Get-Date),$_} >> Ping_IP.txt
seçenek 2 / Option 2
 Test-Connection -Count 9999 -ComputerName COMPUTERNAME | Format-Table @{Name='TimeStamp';Expression={Get-Date}},Address,ProtocolAddress,ResponseTime
 ping 10.0.0.1 | while read line; do echo `date` - $line; done
 @echo off

set /p host=host Address: 
set logfile=Log_%host%.log

echo Target Host = %host% >%logfile%
for /f "tokens=*" %%A in ('ping %host% -n 1 ') do (echo %%A>>%logfile% && GOTO Ping)
:Ping
for /f "tokens=* skip=2" %%A in ('ping %host% -n 1 ') do (
    echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A>>%logfile%
    echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A
    timeout 1 >NUL 
    GOTO Ping)
Share:

8 Mayıs 2020 Cuma

Manage Engine Office 365 Mail Settings / Ayarları

Manage Engine Office 365 Mail settings

Outgoing Mail Settings
  • Login to O365 Manager Plus.
  • Go to Admin tab.
  • Select General Settings → Mail Server in the left pane.
  • Enter smtp.office365.com in the Mail Server field and 587 in the Mail Port field.
  • In the From Address field enter the Office 365 address from which the admins should receive emails.
  • In the Admin Address field, enter the email address of admin who should receive notifications. If you want to enter multiple email addresses, separate them using comma.
  • Select TLS in Secure Connection.
  • Select Authentication, and provide the Username and Password of the Office 365 account you had mentioned in step 5.
  • In Notification Settings section, select the notifications the admins must receive.
  • Send Test Mail to check the configuration.
  • Click Save.

Incoming Mail Settings
  • Login to O365 Manager Plus.
  • Go to Admin tab.
  • Select General Settings → Mail Server in the left pane.
  • Enter outlook.office365.com in the Mail Server field and 993 in the Mail Port field.
  • In the User Name field enter the Office 365 address from which the admins should receive emails.
  • In the Admin Address field, enter the email address of admin who should receive notifications. If you want to enter multiple email addresses, separate them using a comma.
  • Select Protocol IMAPS
  • Select TLS in Secure Connection.
  • Select Authentication, and provide the Username and Password of the Office 365 account you had mentioned in step 5.
  • In Notification Settings section, select the notifications the admins must receive.
  • Send Test Mail to check the configuration.
  • Click Save.


Share:

Blog Arşivi