English
Online-Documentation

sqlexec procedure: data base, DBase, SQL

 

Michael
Wodrich
sends a SQL-commands on The data base. P:s1 is the SQL-Statement and P:I2 the Ergebnismodus.

The SQL-commands becomes usually on whom SQL-driver skillful, there's however Ausnahmen: Zusatzbefehle, The with "#" begin. These Zusatzbefehle are below described.

Ergebnismodus:
0- the Result becomes displayed. eachone Datensatz is a row.
1- the Result becomes into Listbox-list written and can then z.B. with the @LISTBOX$-function viewing go. eachone Datensatz is a Sign in the list and can maximum 32767 characters enthalten; maximum 32767 Datensätze fit into list.
2- the Result becomes in a File written. eachone Datensatz is a row. The File with Set("SQLFile",... set. becomes no Dateiname certainly, becomes "SQL.DAT" in the actually directory taken.

In LINKS:[SQLCount] becomes zurückgeliefert, wieviele Datensätze machine get or -1, if one Error auftrat.

with SQLEXEC can ex XProfan 9 directly variables, How in embedded SQL at C++ or. Java, inserted go. simply a colon to The Variable:

SQLEXEC "SELECT * FROM scheduler WHERE name = :name$ AND salary > :salary%", 1

If name$ = "Hugo" and salary% = 1200 power XProfan from it now automatically following row:

SQLEXEC "SELECT * FROM scheduler WHERE name = 'Hugo' AND salary > 1200", 1

it can simple variables ($ % & !) inserted go, as well as simple Objekteigenschaften or. Strukturelemente. Arrays and expressions are not allows.

here one small Beispielprogramm:

Declare db&, sql$, item$, number%, Price!
Cls
item$ = "Handbuch"
number% = 23
Price! = 1.99
db& = @SQLInit("DSN=dBase-Files)
If db& > 0
SQLEXEC "INSERT INTO ueb VALUES (:number%,:item$,:Price!)",0
SQLEXEC "SELECT * FROM ueb",0
Else
Print "Datenbank couldn't opened go!"
EndIf
WaitInput
End

with one "#" go some Zusatzbefehle eingeleitet:

SQLEXEC "#AUTOCOMMIT_OFF",n

usually becomes eachone SQL-commands immediate carryed out and is a Own Transkation. of these commands becomes this mode off and the Programmer undertaking The control over The Transactions. of these commands begins automatically a new Transaktion. These endures up to one the three subesquent command or up to LINK:[SQLDone].

SQLEXEC "#AUTOCOMMIT_ON",n

The ursprüngliche mode becomes again tuned: eachone SQL-commands becomes immediate carryed out. an yet apertured Transaktion becomes carryed out.

SQLEXEC "#COMMIT",n

The actually Transaktion becomes carryed out and automatically a new began. ought to The Transaktion not complete carryed out go can, results automatically one ROLLBACK.

SQLEXEC "#ROLLBACK",n

The actually Transaktion won't carryed out. any SQL-command since the Beginn the Transaktion go ignoring. an new Transaktion becomes began.

usually becomes under ODBC eachone SQL-commands immediate and for good carryed out, what in 90% all Cases too correctly is. but there's Cases, where several Datenbankanweisungen only complete or not at all carryed out go should. here grab The Transactions. an Transaktion becomes either complete carryed out or none.

in the Normalzustand (AUTOCOMMIT_ON) is eachone SQL-commands a Own Transaktion. with AUTOCOMMIT_OFF can this turn off. any subesquent command are now a Transaktion, until with a "COMMIT" confirm and for good carryed out go or with "ROLLBACK" verworfen go. any Changes into Datentabellen to "COMMIT" only temporär and go in the entrapment one "ROLLBACK" again zurückgenommen.

After COMMIT or ROLLBACK begins a new Transaktion. with AUTOCOMMIT_ON becomes the ursprüngliche behaviour again eingeschaltet. is To this Time another Transaktion open it is with the next SQL-commands exits. too SQLDONE exits etwaige apertured Transactions.

ought to during of/ one Transaktion one schwerer Error appear (Client-computer crashes, SQL-link to that Server breaks, etc.), lead The data base in all rule one automatisches ROLLBACK through. ex XProfan9 can variables in the SQL-String inserted go.
Profan-Arrays and expressions are not allows.
 
Programmieren, das spannendste Detektivspiel der Welt.
05/11/05  
 



Note / Question or Comment to the Help--Topic


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.803 Views

Untitledvor 0 min.
Member 361000509/14/22
Michael W.05/03/22
rquindt01/04/21
Martin Kempf12/18/20
More...

Themeninformationen

this Topic has 1 subscriber:

Michael Wodrich (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie