[sqlite] [Wishlist] Make RAISE function accept derived arguments

2014-04-24 Thread Mark Lawrence
In triggers I often want to include information when raising an error.
However, RAISE doesn't accept dynamic/derived arguments which would
otherwise be valid in a SELECT.

SELECT RAISE(ABORT, 'string1' || 'string2');
-- Error: near 'string1': syntax error

Does anyone know of a work-around?

-- 
Mark Lawrence
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [Wishlist] Make RAISE function accept derived arguments

2014-04-24 Thread Mark Lawrence
On Thu Apr 24, 2014 at 09:42:20AM +0200, Mark Lawrence wrote:
 In triggers I often want to include information when raising an error.
 However, RAISE doesn't accept dynamic/derived arguments which would
 otherwise be valid in a SELECT.
 
 SELECT RAISE(ABORT, 'string1' || 'string2');
 -- Error: near 'string1': syntax error

I forgot to mention my real use case: using NEW.column / OLD.column
values in the exception message. Neither of those work either
(syntax error near .).

-- 
Mark Lawrence
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] BLOBs and NULLs

2014-04-24 Thread Francisco Tapia
UNSUBSCRIBE
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Long table fails to create with exec sql on windows 8.1

2014-04-24 Thread Mark Potter
I have this table and SQL LITE crashes on windows when I try to create using
exec sql.  System just stops responding.

 

CREATE TABLE Bridge (_id INTEGER PRIMARY KEY,

StateCode INTEGER,

StructureNumber TEXT,

InventoryRoute TEXT,

RecordType TEXT,

RouteSigningPrefix INTEGER,

LevelOfService INTEGER,

RouteNumber TEXT,

DirectionalSuffix INTEGER,

HighwayAgencyDistrict TEXT,

CountyCode INTEGER,

PlaceCode TEXT,

FeaturesIntersected TEXT,

FeaturesIntersected2 TEXT,

CriticalFacility TEXT,

FacilityCarried TEXT,

Location TEXT,

MinVertClearance TEXT,

Kilometerpoint TEXT,

BaseHighwayNetwork INTEGER,

SubrouteNumber TEXT,

LRSInventoryRoute TEXT,

SubrouteNumber TEXT,

Latitude TEXT,

Longitude TEXT,

BypassLength TEXT,

Toll TEXT,

MaintResponsibility TEXT,

Owner TEXT,

FunctionalClass TEXT,

YearBuilt INTEGER,

LanesOnStructure INTEGER,

LanesOnStructure2 INTEGER,

LanesUnderStructure INTEGER,

AverageDailyTraffic INTEGER,

YearOfAverageDailyTraffic INTEGER,

DesignLoad INTEGER,

ApproachRoadwayWidth NUMERIC,

BridgeMedian INTEGER,

Skew INTEGER,

StructureFlared INTEGER,

TrafficSafetyFeatures TEXT,

BridgeRailings TEXT,

Transitions TEXT,

ApproachGuardrail TEXT,

ApproachGuardrailEnds TEXT,

HistoricalSignicance TEXT,

NavigationControl TEXT,

NavigationVerticalClearance TEXT,

NavigationHorizontalClearance TEXT,

StructureOpen TEXT,

TypeOfService TEXT,

TypeofServiceBridge TEXT,

TypeofServiceUnder TEXT,

StructureType TEXT,

KindOfMaterial TEXT,

TypeOfDesign TEXT,

StructureTypeApproach TEXT,

KindOfMaterialApproach TEXT,

TypeOfDesignApproach TEXT,

NumberOfSpans INTEGER,

NumberOfApproachSpans INTEGER,

TotalHorzClearance NUMERIC,

LengthOfMaximumSpan NUMERIC,

StructureLength NUMERIC,

CurbSidewalkWidths NUMERIC,

LeftCurbSidewalkWidth NUMERIC,

RightCurbSidewalkWidth NUMERIC,

BridgeRoadwayWidth NUMERIC,

DeckWidth NUMERIC,

MinVertClear NUMERIC,

MinimumVerticalUnderclearance NUMERIC,

ReferenceFeature TEXT,

MinimumVerticalUnderclearance2 NUMERIC,

MinLateralUnderclearRight NUMERIC,

ReferenceFeature2 TEXT,

MinimumLateralUnderclearance NUMERIC,

MinLateralUnderclearLeft NUMERIC,

Deck TEXT,

Superstructure TEXT,

Substructure TEXT,

ChannelProtection TEXT,

Culverts TEXT,

MethodUsedToDetermineOperatingRating TEXT,

OperatingRating TEXT,

MethodUsedToDetermineInventoryRating TEXT,

InventoryRating TEXT,

StructuralEvaluation TEXT,

DeckGeometry TEXT,

UnderclearVerticalHorizontal TEXT,

BridgePosting TEXT,

WaterwayAdequacy TEXT,

ApproachRoadwayAlignment TEXT,

TypeOfWork TEXT,

TypeOfWorkProposed TEXT,

WorkDoneBy TEXT,

LengthOfStructureImprovement TEXT,

InspectionDate TEXT,

DesignatedInspectionFrequency TEXT,

CriticalFeatureInspection TEXT,

FractureCriticalDetails TEXT,

UnderwaterInspection TEXT,

OtherSpecialInspection TEXT,

CriticalFeatureInspectionDates TEXT,

FractureCriticalDetailsDate TEXT,

UnderwaterInspectionDate TEXT,

OtherSpecialInspectionDate TEXT,

BridgeImprovementCost NUMERIC,

RoadwayImprovementCost NUMERIC,

TotalProjectCost NUMERIC,

YearOfImprovementCostEstimate INTEGER,

BorderBridge TEXT,

NeighboringStateCode TEXT,

PercentResponsibility TEXT,

BorderBridgeStructureNumber INTEGER,

STRAHNETHighwayDesignation TEXT,

ParallelStructureDesignation TEXT,

DirectionOfTraffic TEXT,

TemporaryStructureDesignation TEXT,

HighwaySystemOfInventoryRoute TEXT,

FederalLandsHighways TEXT,

YearReconstructed INTEGER,

DeckStructureType TEXT,

WearingSurfaceSystem TEXT,

TypeOfWearingSurface TEXT,

TypeOfMembrane TEXT,

DeckProtection TEXT,

AverageDailyTruckTraffic NUMERIC,

DesignatedNationalNetwork TEXT,

PierProtection TEXT,

NBISBridgeLength NUMERIC,

SCOURCriticalBridges TEXT,

FutureAverageDailyTraffic NUMERIC,

YearOfFutureAvgDailyTraffic INTEGER,

MinNavigationVerticalClearanceVerticaLiftBridge NUMERIC,

FederalAgencyIndicator TEXT,

WashingtonHeadquartersUse TEXT,

StatusWith10yrRule TEXT,

AsteriskFieldInSR TEXT,

SufficiencyRating TEXT,

StatusWithout10yrRule TEXT);

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Long table fails to create with exec sql on windows 8.1

2014-04-24 Thread Donald Griggs
fyi, when I run it from sqlite3.exe on windows I get:
Error: duplicate column name: SubrouteNumber

You're checking returned error codes, right?



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Long table fails to create with exec sql on windows 8.1

2014-04-24 Thread Simon Slavin

On 23 Apr 2014, at 10:47pm, Mark Potter mpott...@cfl.rr.com wrote:

 I have this table and SQL LITE crashes on windows when I try to create using
 exec sql.  System just stops responding.

Does it crash inside the routine ?  If so, can you show us a crash message of 
some kind ?

Donald Griggs spotted the error in the SQL command, of course.  But it 
shouldn't have crashed anyway, it should have returned an error result.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Long table fails to create with exec sql on windows 8.1

2014-04-24 Thread Teg
Hello Mark,

System just stops responding.

It's  not clear if you're talking about the program or your PC. If the
PC  is hanging, it's broken and this isn't a software problem (well not
a Sqlite problem).

Anytime  a PC running windows hangs or crashes, you know it's a driver
or hardware problem (or V scanner).

I  just  thought  your  comment  was  a bit ambiguous. I have plenty of
windows  customers  who  have  PC's  that hang or crash so, I'm pretty
aware of these issues.

C

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Question about checking table requirements on INSERT into a table

2014-04-24 Thread yaneurabeya .
Hi sqlite-users,
When I was toying around with sqlite in python, I ran into an
interesting caveat when INSERTing into a table where an unsupported
data type didn't throw an exception/error from sqlite's perspective.
In the example below, I expected an insert of a text field to an
integer column to throw an error, but the insert succeeded:

$ sqlite3.exe ~/test.db 'CREATE TABLE bar2(foo INTEGER)'
$ sqlite3.exe ~/test.db 'INSERT INTO bar2(foo) VALUES(6)'
$ sqlite3.exe ~/test.db 'INSERT INTO bar2(foo) VALUES(a)'
$ sqlite3.exe ~/test.db 'SELECT * FROM bar2'
6
a
$ sqlite3.exe --version
3.8.4.3 2014-04-03 16:53:12 a611fa96c4a848614efe899130359c9f6fb889c3

Being able to INSERT and print out 'a' above caught me off guard a bit.
Is this programmer error when I ran CREATE TABLE or the INSERT
(this is the most likely answer, but I wanted to be sure), or is this
by design?
Thank you!
-Garrett
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Question about checking table requirements on INSERT into a table

2014-04-24 Thread Igor Tandetnik

On 4/24/2014 1:03 PM, yaneurabeya . wrote:

 Being able to INSERT and print out 'a' above caught me off guard a bit.
 Is this programmer error when I ran CREATE TABLE or the INSERT
(this is the most likely answer, but I wanted to be sure), or is this
by design?


By design. For details, see http://www.sqlite.org/datatype3.html . If 
you want strict typing, you can request it with a CHECK constraint:


CREATE TABLE bar2(foo INTEGER CHECK (typeof(foo)='integer') );

--
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Question about checking table requirements on INSERT into a table

2014-04-24 Thread yaneurabeya .
On Thu, Apr 24, 2014 at 10:23 AM, Igor Tandetnik i...@tandetnik.org wrote:
 On 4/24/2014 1:03 PM, yaneurabeya . wrote:

  Being able to INSERT and print out 'a' above caught me off guard a
 bit.
  Is this programmer error when I ran CREATE TABLE or the INSERT
 (this is the most likely answer, but I wanted to be sure), or is this
 by design?


 By design. For details, see http://www.sqlite.org/datatype3.html . If you
 want strict typing, you can request it with a CHECK constraint:

 CREATE TABLE bar2(foo INTEGER CHECK (typeof(foo)='integer') );

Perfect -- thank you for the help :)!!!
-Garrett
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Provider not showing up in .Net Model import wizard

2014-04-24 Thread Sean McBride
First, I am a long time SQLite user, (first time on .Net).

I installed the NuGet packages (the one with all 3 modules) into my C# project.

I want to import an existing SQLite DB and create a Entity Data Model from it.  
But, when I try to generate from database, the data source and provider do not 
appear in the list.  

I know this is supported because in some tutorials I have found I see screen 
shots where the SQLite Data source appears.

I am using VS 2013.  Did this break in the current version of VS or SQLite 
NuGet packages,? or is there possibly something I am doing wrong?

I haven’t done anything complex.
1.) Create new C# exe.
2.) NuGet the latest SQLite packages
3.) Restart VS and re-open my project (just in case)
4.) Add New Item: ADO.NET Entity Data Model
5.) Choose “Generate from Database”
6.) Click New connection”
7.) Look for SQLite in the data source list (it isn’t there.  only SQL Server 
items appear in the list)

Thanks in advance!

Sean
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Provider not showing up in .Net Model import wizard

2014-04-24 Thread Joe Mistachkin

Sean McBride wrote:

 I installed the NuGet packages (the one with all 3 modules) into my C#
project.
 
 I want to import an existing SQLite DB and create a Entity Data Model from
it.
 But, when I try to generate from database, the data source and provider do
not
 appear in the list.  
 

None of the NuGet packages for System.Data.SQLite install the design-time
components
for Visual Studio, since that would require various machine-wide changes.

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Long table fails to create with exec sql on windows 8.1

2014-04-24 Thread Mark Potter
Good catch, thank you!

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Donald Griggs
Sent: Thursday, April 24, 2014 8:20 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Long table fails to create with exec sql on windows
8.1

fyi, when I run it from sqlite3.exe on windows I get:
Error: duplicate column name: SubrouteNumber

You're checking returned error codes, right?



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Provider not showing up in .Net Model import wizard

2014-04-24 Thread Sean McBride
Thanks for your reply Joe!

I think I am just not getting across exactly where I expect SQLite to show up.  
I am pretty sure it is supposed to be there because there are tutorials 
floating around that show screen shots with the SQLite source showing up where 
I would expect it to.

For example, in this tutorial: (specifically the 6th screen shot)
http://www.geekswithblogs.net/danielggarcia/archive/2013/12/22/portable-databases-ii-using-sqlite-with-entity-framework.aspx

It shows the .Net Data provider for SQLite in the drop down.

Any idea why this wouldn’t be working or what other step I am missing that 
would make this show up there?

Thanks
Sean 

On Apr 24, 2014, at 1:01 PM, Joe Mistachkin sql...@mistachkin.com wrote:

 
 Sean McBride wrote:
 
 I installed the NuGet packages (the one with all 3 modules) into my C#
 project.
 
 I want to import an existing SQLite DB and create a Entity Data Model from
 it.
 But, when I try to generate from database, the data source and provider do
 not
 appear in the list.  
 
 
 None of the NuGet packages for System.Data.SQLite install the design-time
 components
 for Visual Studio, since that would require various machine-wide changes.
 
 --
 Joe Mistachkin
 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users