SqlStrCpy%

Copies a portion of the command buffer to a program variable.

Syntax

SqlStrCpy% ( sqlconn%, start%, numbytes%, buffer$ ) ( )

where

sqlconn% ( )
Is a SQL Server connection. The value of sqlconn% is returned by SqlOpen%.
start%
Is the character in the command buffer to start copying from. The first character is 0. When start% is greater than the length of the command buffer, the returned string is set to an empty string.
numbytes% ( )
Is the number of characters to copy.
numbytes% setting Result
< 0 SqlStrCpy% copies the entire command buffer.
= 0 cmdstring$ is set to an empty string.
> 0 SqlStrCpy% copies the actual number of bytes in the buffer and returns SUCCEED.

buffer$
Is a string variable to which the source string is copied.

Returns

SUCCEED (1) or FAIL (0). FAIL is returned if start% is negative.

Remarks

Internally, the command buffer is a linked list of text strings. Parts of the command buffer can be located and copied using SqlStrCpy% and SqlStrLen%.

See Also

SqlCmd%, SqlFreeBuf, SqlStrLen%