ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / HFSQL properties
  • Formatting the result
  • Use in HFSQL stored procedures
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
SQLCode (Property)
In french: CodeSQL
The SQLCode code property is used to get the SQL code of a query created with the query editor (".WDR" file). The comments entered in the query editor are visible in the SQL code.
Example
// Assigns the SQL code of the query to a string
MySQLCode is string
MySQLCode = QRY_QueryCalculation.SQLCode
Syntax

Getting the SQL code of a query Hide the details

<SQL code> = <Query used>.SQLCode
<SQL code>: Character string
SQL code of the specified query. If the ".WDR" file contains comments, they will appear in the SQL code of the query (comments start with "--").
<Query used>: Query name
Logical name of the query used. This name is defined in the query editor.
Remarks

Formatting the result

The SQL code of the query is identical to the one displayed in the query editor via "SQL code" in the context menu of the query: spaces, tabs and line breaks are preserved.

Use in HFSQL stored procedures

The SQLCode property can be used in the code of a stored procedure to get the code of a stored query on the server.
See also
Minimum version required
  • Version 12
This page is also available for…
Comments
Exemplo SqlCode
https://youtu.be/XtqStG3G3yA

http://windevdesenvolvimento.blogspot.com.br/2018/05/dicas-1771-publica-windev-23-sql-022.html

//--- exempla abaixo

TableDeleteAll(TABLE_CLIENTES)
_SQL is SQL Query =
[
SELECT
cliente.clienteid,cliente.nome
FROM
cliente
WHERE cliente.nome = {parametro_nome}
ORDER BY cliente.nome
]
IF EDT_NOME="" THEN
_SQL.parametro_nome=Null
ELSE
_SQL.parametro_nome=EDT_NOME
END
HExecuteQuery(_SQL)
FOR EACH _SQL
TableAddLine(TABLE_CLIENTES,_SQL.clienteid,_SQL.nome)
END

EDT_sql_code=_SQL..SQLCode
De matos
29 May 2018
Sql Code - Show Sql Code
//Sql Code - Show Sql Code
//Nessa aula de hoje, vou mostrar como mostrar o codigo da qry
//In this class today, I'll show you how to show the qry code

//Chamado a janela para mostrar codigo sql

EXTERN WIN_sql_codigo_usado
LoadWDL("utilitarios_matos.wdl")
//Chamado wdl utilitarios matos
//Called wdl utilities matos
Codigo_Sql is string=QRY_nota_fiscal_ler..SQLCode
//Estou colocando o codigo sql na variavel codigo_sql
//I am putting the sql code in the variable code_sql
Open(WIN_sql_codigo_usado,Codigo_Sql)
//Estou abrindo a janela, e passando parametro sql
//I am opening the window, and passing sql parameter

// Blog e Video com Exemplo

http://windevdesenvolvimento.blogspot.com.br/2017/03/aula-1101-sql-021-sql-sqlcode.html

https://www.youtube.com/watch?v=UBGxNb2pO60

De matos
24 Mar. 2017

Last update: 06/04/2024

Send a report | Local help