Click or drag to resize
sqx

SQXVectorFromQuery Method

Procedure VectorFromQuery [nvarchar](max) @Query, [bit] @Population, [Vector] @V OUTPUT

Namespace:  sqx
Assembly:  SQX (in SQX.dll) Version: 1.0.2.6 (1.0.2.6)
Syntax
C#
public static int VectorFromQuery(
	SqlChars Query,
	SqlBoolean SnapShot,
	out Vector V
)

Parameters

Query
Type: System.Data.SqlTypesSqlChars
[nvarchar](max)
SnapShot
Type: System.Data.SqlTypesSqlBoolean
[bit] 0 Read Commited | 1 SnapShot
V
Type: sqxVector
[Vector]

Return Value

Type: Int32
[int] 0 success | -1 failure
Remarks
Vector from query procedure.
Vector do not preserve the original data type. All data will be converted to float.

NOTE: Query must return a dataset of 1 column with numeric data type.

NOTE: Use ORDER BY clause.
Examples
SQL
declare @V sqx.Vector
declare @Query nvarchar(max) = '
SELECT X FROM (VALUES (6), (15), (36), (39), (43), (47), (49)) AS T(X)
'
exec sqx.VectorFromQuery @Query = @Query, @SnapShot = 0, @V = @V OUTPUT
print @V.ToString()
/*
6,15,36,39,43,47,49*/
See Also