
// Called by BasicSQL2.script. This config file contains information
// for basic API tests. We're going to exercise to some basic level all
// client side APIs the SQLite system. In some cases we'll make deliberate
// errors and look for the expected error codes and messages.


// First some basic RSqlDatabase tests.
[Top]
Close0=
Delete1=C:\BrieflyExists.db
ExpectedError1=KErrNotFound
Open2=C:\BrieflyExists.db
ExpectedError2=KErrNotFound
NoOperation3=
NoOperation4=C:\BrieflyExists.db
NoOperation4=KErrNotFound
Create5=C:\BrieflyExists.db
Close6=
Create7=C:\BrieflyExists.db
ExpectedError7=KErrAlreadyExists
Open8=C:\BrieflyExists.db
Exec9=what a load of gibberish
ExpectedError9=KSqlErrGeneral
LastErrorMessage10=near "what": syntax error
Exec11=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
SetIsolationLevel12=EReadUncommitted
Close13=
Delete14=C:\BrieflyExists.db
Delete15=C:\SqlStatement.db
ExpectedError15=KErrNotFound
Create16=C:\SqlStatement.db
Exec17=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
NewBlock18=rsqlstatement
Close19=
EndBlock20=
// Leave the db lying around, we'll do some more in another script line.

// Play with BindInt, BindReal, BindNull and BindText.
// Check the result with AtRow, ColumnInt, ColumnReal, ColumnTextL (result
// specified inline, not in a file), also checks IsNull to check the previous
// BindNull.
[rsqlstatement]
Prepare0=Insert into Table1(Field1, Field2, Field3) values(:huey, :dewey, :louie);
ParameterIndex1=:huey
ParameterIndex2=:dewey
ParameterIndex3=:louie
BindInt4=0,711
BindText5=1,Here's some text.
BindReal6=2,2.7182818282
St_Exec7=
Reset8=
BindInt9=0,1234
BindText10=1,Some more text....
BindReal11=2,3.141592654
St_Exec12=
Reset13=
BindInt14=0,1235
BindText15=1,Yet more text....
BindReal16=2,9.869604401
St_Exec17=
Reset18=
BindInt19=0,1236
BindNull20=1
BindReal21=2,6.0827626
St_Exec22=
St_Close23=
Prepare24=select * from table1;
AtRow25=FAlse
ColumnIndex26=Field1
ColumnIndex27=Field2
ColumnIndex28=Field3
Next29=
AtRow30=TruE
ColumnInt31=0,711
ColumnType32=1,ESqlText
ColumnTextL33=1,Here's some text.
ColumnReal34=2,2.7182818282
Next35=
ColumnInt36=0,1234
ColumnSize37=1,18
ColumnTextL38=1,Some more text....
ColumnReal39=2,3.141592654
ColumnSize40=2,8
Next41=
ColumnInt42=0,1235
ColumnTextL43=1,Yet more text....
ColumnReal44=2,9.869604401
Next45=
ColumnInt46=0,1236
IsNull47=1,tRue
ColumnReal48=2,6.0827626
Delete49=C:\SqlStatement.db
ExpectedError49=KErrInUse
Next50=
AtRow51=FalSe
St_Close52=
EndBlock53=

// This is a separate case, trigger by the second line in the script file.
// It adds to the existing table in SqlStatement.db, checks 'ColumnInt64',
// and BindInt64, plus verifies the return from 'Next'. On completion this
// section deletes the database.
[AddtoTable]
Open0=C:\SqlStatement.db
Exec1=alter table Table1 add Field4 int;
Prepare2=Update Table1 Set Field4=108 where Field3 < 5.8;
St_Exec3=
Reset4=
St_Close5=
Prepare6=Insert into Table1(Field1, Field2, Field3, Field4) values(:huey, :dewey, :louie, :donald);
ParameterIndex7=:huey
ParameterIndex8=:dewey
ParameterIndex9=:louie
ParameterIndex10=:donald
ParameterIndex11=:somerubbish
ExpectedError11=KErrNotFound
// The next line may not be appropriate - I think LastErrorMessage is only
// relevant following a 'KSqlErrGeneral' (which we don't have).
LastErrorMessage12=not an error
BindInt13=0,17141
BindText14=1,AddtoTable stuff
BindReal15=2,299792458
BindInt64_16=3,123456789012345
St_Exec17=
Reset18=
St_Close19=
Prepare20=select * from table1 where Field1=17141;
ColumnIndex21=Field4
AtRow22=FaLse
Next23=
AtRow24=trUe
ColumnType25=0,ESqlInt64
ColumnInt64_26=0,123456789012345
Next27=KSqlAtEnd
St_Close28=
Close29=
Delete30=C:\SqlStatement.db
EndBlock31=

// Tests writing to a text field with a stream (RSqlParamWriteStream).
// Checks the content with all variants of ColumnText.
[SWBindText]
Delete0=C:\texttest1
ExpectedError0=KErrNotFound
Create1=C:\texttest1
Exec2=create table table2(field1 text(32770), field2 integer);
Prepare3=insert into table2(field1, field2) values(:largetext, :int);
ParameterIndex4=:largetext
ParameterIndex5=:int
StreamWriteBindText6=0,Z:\TEF_SQL\TestData\reference1.txt
BindInt7=1,1234321
St_Exec8=
Reset9=
St_Close10=

Prepare11=SELECT * from table2;
ColumnIndex12=field1
ColumnIndex13=field2
Next14=KSqlAtRow
ColumnSize15=0,3626
ColumnSize16=1,4
ColumnTextP17=0,Z:\TEF_SQL\TestData\reference1.txt
ColumnInt18=1,1234321
Next19=KSqlAtEnd
St_Close20=ignored

Prepare21=SELECT * from table2;
ColumnIndex22=field1
ColumnIndex23=field2
Next24=KSqlAtRow
ColumnSize25=0,3626
ColumnSize26=1,4
ColumnTextL27=0,Z:\TEF_SQL\TestData\reference1.txt
ColumnInt28=1,1234321
Next29=KSqlAtEnd
St_Close30=ignored

Prepare31=SELECT * from table2;
ColumnIndex32=field1
ColumnIndex33=field2
Next34=KSqlAtRow
ColumnSize35=0,3626
ColumnSize36=1,4
ColumnTextD37=0,Z:\TEF_SQL\TestData\reference1.txt
ColumnInt38=1,1234321
Next39=KSqlAtEnd
St_Close40=ignored

Prepare41=SELECT * from table2;
ColumnIndex42=field1
ColumnIndex43=field2
Next44=KSqlAtRow
ColumnSize45=0,3626
ColumnSize46=1,4
StreamReadColText47=0,Z:\TEF_SQL\TestData\reference1.txt
ColumnInt48=1,1234321
Next49=KSqlAtEnd
St_Close50=ignored

Close51=also ignored
Delete52=C:\texttest1
EndBlock53=

[SWBindBinary]
Delete0=C:\binarytest1
ExpectedError0=KErrNotFound
Create1=C:\binarytest1
Exec2=create table table2(field1 blob(32770));
Prepare3=insert into table2(field1) values(:largebin);
ParameterIndex4=:largebin
StreamWriteBindBin5=0,Z:\TEF_SQL\TestData\reference1.bin
St_Exec6=
Reset7=
St_Close8=

Prepare9=SELECT field1 from table2;
ColumnIndex10=field1
Next11=KSqlAtRow
ColumnSize12=0,8094
ColumnBinaryL13=0,Z:\TEF_SQL\TestData\reference1.bin
Next14=KSqlAtEnd
St_Close15=ignored

Prepare16=SELECT field1 from table2;
ColumnIndex17=field1
Next18=KSqlAtRow
ColumnSize19=0,8094
ColumnBinaryP20=0,Z:\TEF_SQL\TestData\reference1.bin
Next21=KSqlAtEnd
St_Close22=ignored

Prepare23=SELECT field1 from table2;
ColumnIndex24=field1
Next25=KSqlAtRow
ColumnSize26=0,8094
ColumnBinaryD27=0,Z:\TEF_SQL\TestData\reference1.bin
Next28=KSqlAtEnd
St_Close29=ignored

Prepare30=SELECT field1 from table2;
ColumnIndex31=field1
Next32=KSqlAtRow
ColumnSize33=0,8094
StreamReadColBin34=0,Z:\TEF_SQL\TestData\reference1.bin
Next35=KSqlAtEnd
St_Close36=ignored

Close37=also ignored
Delete38=C:\binarytest1
EndBlock39=

// Use anonymous (if that's the right word) column indices to check, for
// example the number of records in a database.
// Use a Copy..
[Countlines]
Copy0=Z:\TEF_SQL\TestData\test1.db,Z:\test1.db
ExpectedError0=KErrAccessDenied
Delete1=C:\test1.db
ExpectedError1=KErrNotFound
Copy2=Z:\TEF_SQL\TestData\test1.db,C:\test1.db
Open3=C:\test1.db
Prepare4=select count(*) from phone;
Next5=KSqlAtRow
ColumnIndex6=
ColumnInt7=0,1000
Next8=KSqlAtEnd
St_Close9=
Prepare10=select avg(cm_id) from phone;
Next11=KSqlAtRow
ColumnIndex12=
ColumnReal13=0,500.5
Next14=KSqlAtEnd
St_Close15=
Prepare16=select sum(cm_id) from phone;
Next17=KSqlAtRow
AtRow18=True
ColumnIndex19=
ColumnInt20=0,500500
Next21=KSqlAtEnd
St_Close22=
Close23=
// This delete is in itself a test - the 'Copy' above does not and should not
// propagate file permissions from the Z: drive. If it did, this delete would
// fail, but it should not.
Delete24=C:\test1.db
EndBlock25=

