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 ...
Share:

Searching text in the SQL all tables columns

 EXEC SearchAllTables 'test'GOCREATE 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...
Share: