| |
|
|
- Page 1 - |
|
Dietmar Horn | Hello together,
today contact I time with a SQL-trouble order selected Hilfestellung on The SQL-Experten under you.
I work z.Z. with XProfan 11 in a komplexeren proposition. its already right far gediehen. The yet einzigste, but crucial Problempunkt is for me The on- or. Integration the RDBS Firebird (Freeware or. Open-Source) or. Interbase (the kostenpflichtige Gegenstück of Borland To Firebird - like the Relationship between MS Office and Open-Office).
yet had to I yet never big with SQL keep busy, except that I me always times the XProfan-Help to that SQL-Topic reingezogen and the everything as right logical felt having. still How often, lying the dog certainly only in a tiny detail bury, I not know, or in a Error, whom I made or overlooking have.
Firebird and Interbase knew I To to 4 weeks not yet time of names since, because I something like yet never needed having - but now is it so far.
ODBC-driver and Firebird are installs.
first of all goes it therefore, a link produce. under windows 2000 (in unserem Vereins-cabinet) works The Initialisierung with SQLInit meanwhile.
The Initialisierung supply under W 2000 How desired the lever back:
under Windows XP yields the however yet always 0 (means failed), and in the Contrast To W 2000 appear there before not yet time the dialog to that prompt of Username, PWD, etc.
before this Completed: the produce the link not resolved is, need I none big go on.
Literatur over Firebird have I meanwhile tonnenweise, still before I not create, on all windows-Systemen ex 2000 up a reliable link produce, nützt me the everything unfortunately not too plenty.
can me Perhaps someone help, the itself already time something hither so engage has?
The next steps, So the Neuanlegen of/ one data base, or the Edit / Reading of/ one vorhandenen DB and the Weiterverarbeiten the data in the actual Program might then solely another pure Fleiß- and Logik-work his.
the sheer z.B. on dBase isn't possible, because dBase dbzgl. not over The for this proposition erforderlichen Feautures verfügt.
who can evtl. help on?
I suspect time, if the program sometime with Firebird runs, then should the program too with Interbase functions - or?
Greeting and thanks beforehand Dietmar |
|
|
| Multimedia für Jugendliche und junge Erwachsene - MMJ Hoyerswerda e.V. [...] Windows 95 bis Windows 7 Profan² 6.6 bis XProfan X2 mit XPSE Das große XProfan-Lehrbuch: [...] | 01/11/09 ▲ |
|
|
|
| |
|
- Page 5 - |
|
|
Uwe ''Pascal'' Niemeier | Hi people!
The interne structure the db can you still alike sein; for there Yes whom driver
means again: where very lying the trouble, when and under whom Umständen exit it on? such testify How the works not or there comes only Garbage out are not very aussagekräftig and Ferndiagnosen definitiv unfit
suggestion: Poste still time of/ one a Kurzanleitung, what where runterladen & How install must, circa eure try nachzuvollziehen.
SeeYou Pascal |
|
|
| |
|
|
|
RGH | Hello Pascal,
i think, the trouble exists simply therein, that it evident no Possibility (or Documentation same) gives, How I with SQL-command (SQLEXEC) over ODBC on The BLOBs of Interbase/Firebird-Databases grab can.
How it simply possible is, a small detour large Files Interbase/Firebird To write and To reading, have I in example supra demonstrating. (the would even slight abgewandelt with dBase and others functions.) Dietmar has but well from his clients The demand, objectively BLOBs To reading and To write.
Firebird and the ODBC-driver find You here [...] in the Download Area. an Beispieldatenbank find You in this Thread moreover supra.
Greeting Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 02/24/09 ▲ |
|
|
|
|
Uwe ''Pascal'' Niemeier | *räusper*
means... The problem lying apparently therein, that the Kommandostring not longer as 64KB his must. becomes these boundary overstepped, comes it To Fehlermeldungen, where The informations self from the Überlänge take down. sees to one Buffer-Überlauf aus; möglicherweise one bow in the driver, whom yet none notice has, because the most Programmer with the jeweiligen Komponenten for your Programming-Language works (Weicheier ).
One Workaround would, überlange data not once into db To write, separate stückweise. though not How in Rolands example on several Datensätze distributed separate always in that same area the equal Satzes, where The new data on The already vorhandenen appended go. to link of Strings becomes thereby with FB one doppeltes Pipe-characters uses.
with this example go in several stepped 128 KB written: CompileMarkSeparationwindow 50,50-500,500
declare Exec$
var GDB$=C:2TestKURSDB.GDB------------Pfad anpassen!!
var Init$=Driver=Firebird/InterBase(r) driver;Uid=SYSDBA;Pwd=masterkey;DbName=+GDB$+;
SQLInit(Init$)
Set(Errorlevel,0)
Exec$=DROP TABLE TCS
SQLExec Exec$,0
Set(Errorlevel,1)
Exec$=CREATE TABLE TCS (Feld1 BLOB)
SQLExec Exec$,0
var Text$=mkstr$(X,1024*32)--Teststring 32KB
Exec$=INSERT INTO TCS (Feld1) VALUES (+Text$+)-------------------32K
SQLExec Exec$,0
Exec$=UPDATE TCS SET Feld1 = (SELECT Feld1 FROM TCS) || +Text$+--32KB + 32KB
SQLExec Exec$,0
Exec$=UPDATE TCS SET Feld1 = (SELECT Feld1 FROM TCS) || +Text$+--64KB + 32KB
SQLExec Exec$,0
Exec$=UPDATE TCS SET Feld1 = (SELECT Feld1 FROM TCS) || +Text$+--96KB + 32KB
SQLExec Exec$,0
Exec$=UPDATE TCS SET Feld1 = Hallo Leute! || (SELECT Feld1 FROM TCS) || Wie siehts aus?
SQLExec Exec$,0
SQLDone
waitkey
If one now whom Blob with Standart-functions read wants, kriegt one only The interne Blob-ID back. differently with the SQL-API-Variante: CompileMarkSeparationwindow 50,50-500,500
$H windows.ph
def SQLAllocHandle(3) !odbc32,SQLAllocHandle
def SQLError(8 ) !odbc32,SQLError
def SQLExecDirect(3) !odbc32,SQLExecDirect
def SQLGetData(6) !odbc32,SQLGetData
def SQLFetch(1) !odbc32,SQLFetch
def SQLFreeHandle(2) !odbc32,SQLFreeHandle
proc SQLErrorLog-----------------------------------------SQLErrorLog
parameters From$
declare Error$
SQLError(&SQLEnv,&SQLDBC,stmt&,0,0,Error#,512,0)
Error$=string $(Error#,0)
case len(Error$):addstring From$+ : +Error$
endproc-------------------------------------------------------------
proc SQLGetDataEx---------------------------------------SQLGetDataEx
parameters Exec$
declare Data#,Data$,Size&,stmt&,Error#
dim Error#,512
clearlist
SQLAllocHandle(3,&SQLDBC,addr(stmt&))--3=SQL_HANDLE_STMT
SQLErrorLog(SQLAllocHandle)
SQLExecDirect(stmt&,addr(Exec$),-3)-- -3=SQL_NTS
SQLErrorLog(SQLExecDirect)
dim Data#,1--Dummy-DIM
SQLFetch(stmt&)
SQLErrorLog(SQLFetch)
SQLGetData(stmt&,1,99,Data#,0,addr(Size&))--99=SQL_C_DEFAULT
--Fehlerabfrage would To small Puffer report (Dummy-appeal wg. Size&)
if Size&>0
dim Data#,Size&+1
SQLGetData(stmt&,1,99,Data#,Size&+1,addr(Size&))--99=SQL_C_DEFAULT
SQLErrorLog(SQLGetData)
Data$=char$(Data#,0,Size&)
endif
SQLFreeHandle(3,stmt&)--3=SQL_HANDLE_STMT
dispose Data#,Error#
case %getcount>-1:listbox$(Error,2)
return Data$
endproc-------------------------------------------------------------
var GDB$=C:2TestKURSDB.GDB--------------way adjust!!
var Init$=coachman=Firebird/InterBase(r) coachman;Uid=SYSDBA;Pwd=masterkey;DbName=+GDB$+;
SQLInit(Init$)
var Exec$=SELECT area1 FROM TCS
var Text$=SQLGetDataEx(Exec$)
print Gelesene KB:,len(Text$)/1024
print first 20 :,left$(Text$,20)
print latest 20 :,right$(Text$,20)
SQLDone
waitkey
pointed with binären data looks white I not yet, but I suspect, that one ums code not herumkommt, because Yes at least the Apostrophe in each drop of driver wrong understood go would.
HTH Pascal |
|
|
| |
|
|
|
RGH | Hello Pascal and Dietmar,
I have yesterday evening something Time had and times something moreover about geforscht:
to that write of BLOBs: here lying The boundary objectively with the SQL-Implementierung of Firebird/Interbase: in the Doku becomes objectively erwähnt, that The maximum length one SQL-Statements 64 kB not überschreiben must. for Text-BLOBs is means Pasacals Lösungsweg thoroughly gangbar. I have bislang though no SQL-Syntax for Firebird/Interbase found, circa more data or quite binäre data directly by SQL into scheduler einzufügen. others Databases afford there z.B. a Possibility complete Files einzufügen: CompileMarkSeparation it would helpful, if it like too for Firebird/Interbase were. i'll today evening moreover forschen ...
to that Reading of BLOBs: Pascal, as i your Sourcecode saw I thought as Erstes: but very so make I it still too in XProfan. at that closer studies of my Source code fell me then on, that one of me genutzte Definitionsdatei to ODBC32.DLL (I use The ODBC.DLL interface Unit, translated for Delphi Yasser Asmi) a tiny Error contains. it missing at a place one Minuszeichen and of course becomes The Constant SQL_LONGVARBINARY with 4, instead of with -4 definiert. The 4 standing but for SQL_INTEGER. Dummerweise has our BLOB very whom Datentyp SQL_LONGVARBINARY, so that means because of the Fehlers The length the data with 11 (reicht for supreme Integerzahl) naturally To lowly were, and these ausserdem wrong transfer get, namely as SQL_C_CHAR in lieu of of SQL_C_DEFAULT. concise: it watts not, How vermutet, one Key to the tatsächlichen data zurückgeliefert, separate the first Bytes in Hex-statement, from Hello watts so means 48616C6C6F. The problem can I naturally to fix and becomes in the next XProfan-Version then too fixed his.
Greeting Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 02/25/09 ▲ |
|
|
|
|
E.T. | RGH
....concise: it watts not, How vermutet, one Key to the tatsächlichen data zurückgeliefert, separate the first Bytes in Hex-statement, from Hello watts so means 48616C6C6F....
Well then knows I now Yes at least, wieso I at Reading always The (first) Hex-values from the Blob back get have (my mail of 15.02. moreover in front) . |
|
|
| Grüße aus Sachsen... Mario WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte... | 02/25/09 ▲ |
|
|
|
|
| for Java and binäre Interbase-BLOBS were it here Beispielcodes: [...] means ifs in Java goes, ought to it in Profan in principle still too klappen... there we here no Java-Forum are, poste I the code here nicht; it shows but still each steps right very. Perhaps ersieht one from it a Solution for XProfan. Greeting woodpecker
P.s.: JDBC can over one simple Brückenprogramm on ODBC-ansprechbare Databases grab, behauptet [...] at the worst could Profan yes a small Java-Program fernsteuern, that the stuff How described ordnungsgemäß rausholt. Zugegeben, plenty unelegant... |
|
|
| |
|
|
|
RGH | Peter woodpecker
for Java and binäre Interbase-BLOBS were it here Beispielcodes: [...] means ifs in Java goes, ought to it in Profan in principle still too klappen... there we here no Java-Forum are, poste I the code here nicht; it shows but still each steps right very. Perhaps ersieht one from it a Solution for XProfan. Greeting woodpecker
Hi, the have so did i already found, shows but no (presently) in XProfan possible Solution on, helps Dietmar means unfortunately not further. here becomes first of all one SQL-appeal prepared, subsequently go single boxes with data filled and first in the third step becomes the SQL-Statement carryed out. even if the ODBC-driver these engineering support would, so can it XProfan presently not. SQLEXEC lead the Statement same from (possibly vorberhaltlich one COMMIT-Befehles - see Transactions).
Greeting Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 02/25/09 ▲ |
|
|
|
|
Uwe ''Pascal'' Niemeier | Hi people!
If I the right see, missing a Syntax for driver (or. is no famous), circa a File directly in whom BLOB To write?
moreover two ask:
1. has someone a (theoretical) Possibility found, by ODBC/SQL Streams To benefit (of it was somewhere in the WWW a couple times the speech, faith I)?
2. gives it some Program, the definitiv under Use the ODBC-driver Files BLOBs write can? might To Testzwecken meaningfully his...
SeeYou Pascal |
|
|
| |
|
|
|
RGH | Hi,
I have time in the ODBC-API (I have here some hundred ausgedruckte pages the msn) and the supra named founts gestöbert. it might in the doing by ODBC-driver weg, but presumably not all Databases by einfachem directly with SQLExecDirect ausgeführtem SQL-Statement. (In XProfan I'm going whom lane over SQLExecDirect.) with FireBird is even The length this Statements on 64 kB terminable.
Folgender lane in lieu of the SQLExecDirect should klappen: - One SQL-commands with SQLPrepareStatement and ? for data vorbeiten, about with the Statement INSERT INTO MeineTabelle (MeinBlob) VALUES (?). The Return Value is a lever this vorbereiteten Statements. - The data by Zeiger/length with SQLPutData nachschieben - the Statement with SQLExecute perform. Diesen lane can naturally for all Datentypen weg and it goes too for UPDATE. the ought to by API-Aufrufe naturally too in XProfan possible his. (Since I here in the firm naturally no FireBird on my computer install must and can, hope I Perhaps sunday evening time to find, it auszuprobieren.*)
Greeting Roland
(tommorrow noon goes it first times for two Übernachtungen to Cologne. I conjoin The Use the in the Weihnachtsfeierverlosung won Hotelgutscheines for two Nights and Personen with the visiting one Auswärtsspieles the Mannheimer eagle against The Kölner sharks. naturally hoping we on the sunday timely to that Heimspiel against The Hamburg Freezers again back To his.) |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 02/26/09 ▲ |
|
|
|
|
Dietmar Horn | Hi,
here have I Examples to that write and Reading Firebird-Blobs found - unfortunately only in Delphi.
How could to the in XProfan 11 umsetzen?
Greeting Dietmar |
|
|
| Multimedia für Jugendliche und junge Erwachsene - MMJ Hoyerswerda e.V. [...] Windows 95 bis Windows 7 Profan² 6.6 bis XProfan X2 mit XPSE Das große XProfan-Lehrbuch: [...] | 02/28/09 ▲ |
|
|
|
|
Dietmar Horn | Sorry,
in the obigen Posting I had whom Link to that Delphi-Source for Blobs forget:
[...]
white someone, How to the with XProfan 11 umsetzen could?
Greeting Dietmar |
|
|
| Multimedia für Jugendliche und junge Erwachsene - MMJ Hoyerswerda e.V. [...] Windows 95 bis Windows 7 Profan² 6.6 bis XProfan X2 mit XPSE Das große XProfan-Lehrbuch: [...] | 03/01/09 ▲ |
|
|
|
|
Uwe ''Pascal'' Niemeier | Hi people!
Mutmaßung: either is the db-Unterstützungvon Delphi completely differently knitted as The of Profane or it come Special Komponenten to that employment.
me
gives it some Program, the definitiv under Use the ODBC-driver Files BLOBs write can?
The thought behind it was, over The windows-interne Ablaufverfolgung (under ODBC adjustable) The communication between Program and driver To protokollieren. thereby go sowohl commands as well as API-Aufrufe transcribed. the ought to a emulation the Funktionalität erleichern.
though is fraglich, whether these Possibility effective is as already suggested stückweise Aneinanderhängen of data. After Rolands testimony is indeed the Reading great Datenmengen soon without API possible, sodaß one complete on externe functions dispense could. (self I use APIs only there, where it necessary is or. visible advantages bring )
@ Roland: when becomes it a suitable Patch give? it has itself Yes still some angesammelt, what korrigiert go should...
SeeYou Pascal |
|
|
| |
|
|