| || |
QARun database access to \"LONG RAW\"
I'm trying to automatically dump QARun scripts to the filesystem using a technique similar to the log file extractor which was posted earlier. I'm having trouble with the "SCRIPT_SOURCE" field, probably because of the data-type. It doesn't look like QARun can handle the "LONG RAW" datatype. We're actually using the default access.mdb setup, but peeked at the table-definition from an Oracle database. Here's a little snippet:
QR_NAME VARCHAR2 (50) NOT NULL,
SOURCE_CODE LONG RAW DEFAULT NULL,
And the code which I'm trying to use. The first part works fine, but the second part has problems with the dbGetField() call to "SCRIPT_SOURCE". *ANY* recommendations at all would be very welcome (including some Access or Oracle-fu which can convert the LONG RAW into something easier for QARun to understand).
// load all script names into an array
dbConnect( "my_database.mdb" ) ; connect to datasource
dbSelect( "SELECT QR_NAME FROM QR_SCRIPT;" ) ; select records
while not dbEOF()
Append( script_names, dbGetField("QR_NAME") )
// try to get script source from each script name
For zzz = 2 to ArraySize( script_names )
sn = script_names[zzz]
sql = "SELECT SOURCE_CODE FROM QR_SCRIPT_SOURCE WHERE QR_NAME='" + sn + "' ORDER BY QR_VERSION DESC;"
MsgBox( "sql", sql )
dbSelect( sql )
src = dbGetField("SOURCE_CODE")
fn = "c:\tmp\" + sn
open( fn, "create" )
write( fn, src )
close( fn )
MsgBox( "source", SubStr(src, 1, 100) )