GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 25
→
Wx - Alterar Schema do Postgresql de acordo com o usuario ou empresa
Wx - Alterar Schema do Postgresql de acordo com o usuario ou empresa
Iniciado por Boller, jan., 25 2021 2:13 PM - 1 resposta
Conecte-se…
Boller
#1
Membro registado
3.657 mensagems
Popularité : +175 (223 votes)
Publicado em janeiro, 25 2021 - 2:13 PM
Bom dia a todos
Procedure
alterarschemma
(
meuschemma
)
s
Tabelas
is string
=
HListFile
(
MyConnection1
)
s
Tabelasanalise
is string
=
HListFile
(
)
schema_tabela
is string
i
is int
HClose
(
"*"
)
FOR
EACH STRING
s OF
s
Tabelas SEPARATED
by
CR
s
Nometabela
is string
=
ExtractString
(s,
1
,
"."
,
FromEnd
)
s
_nomShema
is string
=
ExtractString
(s,
1
,
"."
,
FromBeginning
)
IF
Contains
(
s
Tabelasanalise
,
s
Nometabela
,
WholeWord
)
THEN
schema_tabela
=
meuschemma
+
"."
+
s
Nometabela
i
+
+
IF
NOT
HChangeName
(
s
Nometabela
,
schema_tabela
)
THEN
Info
(
"Erro "
+
s
Nometabela
+
" --> "
+
meuschemma
+
"."
+
s
Nometabela
)
RESULT
(
False
)
END
IF
NOT
HChangeConnection
(
schema_tabela
,
MyConnection1
)
THEN
Error
(
HErrorInfo
(
hErrMessage
)
)
RESULT
(
False
)
END
END
END
HOpen
(
"*"
)
RESULT
(
True
)
passe o schemma que deseja
a rotina faz o resto
tudo
100
%
com funções nativas
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Denunciar
0
0
Boller
#2
Membro registado
3.657 mensagems
Popularité : +175 (223 votes)
Publicado em março, 15 2021 - 11:49 PM
// Summary: <specify the procedure action>
// Syntax:
//[ <Result> = ] alterarschemma (<meuschemma>)
//
// Parameters:
//
meuschemma: <specify the role of meuschemma>
Procedure
alterarschemma
(
meuschemma
)
s
Tabelas
is string
=
HListFile
(
MyConnection1
)
s
Tabelasanalize
is string
=
HListFile
(
)
schema_tabela
is string
i
is int
HClose
(
"*"
)
FOR
EACH STRING
S OF
s
Tabelas SEPARATED
by
CR
s
Nometabela
is string
=
ExtractString
(S,
1
,
"."
,
FromEnd
)
s
ShemaName
is string
=
ExtractString
(S,
1
,
"."
,
FromBeginning
)
IF
Contains
(
s
Tabelasanalize
,
s
Nometabela
,
WholeWord
)
THEN
schema_tabela
=
meuschemma
+
"."
+
s
Nometabela
i
+
+
IF
NOT
HChangeName
(
s
Nometabela
,
schema_tabela
)
THEN
END
Error
(
"Erro"
+
s
Nometabela
+
"->"
+
meuschemma
+
"."
+
s
Nometabela
)
RESULT
(
False
)
END
IF
NOT
HChangeConnection
(
schema_tabela
,
MyConnection1
)
Error
(
HErrorInfo
(
hErrMessage
)
)
RESULT
(
False
)
END
END
HOpen
(
"*"
)
RESULT
(
True
)
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Denunciar
0
0
→ Voltar para WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto