PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
Paulo Viana Brumado: esse código é para gerar uma nova chave para o BD HFSQL em caso de problema com o sequencial
Paulo Viana Brumado: esse código é para gerar uma nova chave para o BD HFSQL em caso de problema com o sequencial
Started by Boller, Apr., 20 2022 5:12 PM - No answer
Connect yourself…
Boller
#1
Registered member
3,655 messages
Popularité : +175 (223 votes)
Posted on April, 20 2022 - 5:12 PM
//LOGIN
-------------
*
*
IF NOT rot_verifica_senha() THEN
RETURN
END
*
IF COMBO_tabela_editar IN ("",-1) THEN
Info("Selecione a tabela")
RETURN
END
*
tabela is string=COMBO_tabela_editar..DisplayedValue
*
sChave is string=tabela+"."+tabela+"id"
*
schavesimples is string=tabela+"id"
*
meusql is string=[
select max([%sChave%]) as maximo from [%tabela%]
]
*
dsDsquery is Data Source
*
IF NOT HExecuteSQLQuery(dsDsquery,hQueryDefault,meusql) THEN
*
Info(HErrorInfo(hErrMessage))
RETURN
*
END
*
HReadFirst(dsDsquery)
*
HReset({tabela})
*
{sChave}=dsDsquery.maximo+1
*
HSave({tabela},hSetIdAuto)
*
registro is 8-byte int={sChave}
*
IF HReadSeekFirst({tabela},schavesimples,registro) THEN
HDelete({tabela})
InfoWithTimeout(1s,"Remoção realizada com sucesso!")
END
*
Info("No do registro gerado "+registro)
Paulo Viana Brumado: esse código é para gerar uma nova chave para o BD HFSQL em caso de problema com o sequencial
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Message modified, April, 20 2022 - 5:20 PM
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text