文字列の連結 (||) / CONCAT

CONCAT関数は文字列を連結する。
連結演算子(||)と同じ動作となる。

|| を使う事が多い。

文法
CONCAT ( string1, string2 文字列string1string2を連結して返す
連結演算子( || )
string1||string2

文字列string1string2を連結して返す

引数
string1 , string2 文字列

使用例

select DEPTNO, DNAME, LOC, TEL ,
CONCAT(LOC,TEL)
from DEPT

結果
CONCAT

select DEPTNO, DNAME, LOC, TEL ,
LOC||TEL
from DEPT

結果
||結果

Imports Oracle.DataAccess.Client

Public Class frmSQL_Trim

    Private dt As DataTable = Nothing

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        
        Try
            Using da As New OracleDataAdapter(TextSQL.Text.Trim, clsGlobal.gConnetionString)

                dt = New DataTable
                da.Fill(dt)

                'Gridにバインド
                Grid1.DataSource = dt
            End Using
        Catch ex As OracleException
            MessageBox.Show(ex.Message)

        End Try

    End Sub

修正履歴

Loading