FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
[WD24] SQL OLE DB Insert into statement breaking query output.
[WD24] SQL OLE DB Insert into statement breaking query output.
Débuté par Robert, 15 avr. 2019 21:23 - 1 réponse
Connectez-vous…
Robert
#1
Membre enregistré
105 messages
Posté le 15 avril 2019 - 21:23
I was having some trouble getting a SQL stored procedure to work, so I wrote a little program that just takes SQL code input and runs it against a server, and returns the first column of the first row returned.
Nothing fancy.
n
Connection
is int
=
SQLConnect
(
s
Server
,
s
User
,
s
Password
,
s
Database
,
"OLEDB"
,
hOledbSQLServer
,
)
s
SQL
is string
=
E
DT_NoName1
b
Res
is boolean
=
SQLExec
(
s
SQL
,
"QRY_Query"
)
s
Result
is string
IF
b
Res
=
False
THEN
SQLInfo
(
"QRY_Query"
)
Info
(
SQL.MesError
)
RETURN
END
IF
SQLFetch
(
"QRY_Query"
) <
>
0
THEN
SQLInfo
(
"QRY_Query"
)
Info
(
SQL.MesError
)
RETURN
END
Info
(
SQLGetCol
(
"QRY_Query"
,
1
)
)
SQLClose
(
"QRY_Query"
)
SQLDisconnect
(
)
If you run a simple select query, such as:
SELECT
'Done'
You get the expected output.
However, if your code has an INSERT INTO statement in it, such as within a stored procedure, the output doesn't return any records.
INSERT INTO TestTbl
(
SNo
,
SetupNumber
)
Values
(
1
,
2
)
SELECT
'Done'
The insert into code does execute, but something with the return value of the SQL call is getting erased, or corrupted, or something.
Am I doing something wrong?
If anyone has any pointers, it'd be greatly appreciated.
Message modifié, 15 avril 2019 - 21:26
Signaler
0
0
Gregdlv
#2
Posté le 29 août 2023 - 16:36
Same problem here, in Windev28...
Looking for solution.
No problem when using native access but not working with OLEDB
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte