[flexcoders] Re: Need help finding and fixing SQL Error in AIR App

2008-05-01 Thread bredwards358
That's fine, I again figured something out a short while ago while
experimenting with importing the text documents. Turns out you can't
have the special characters such as the - or / in the column
header, the actual data in the rows beneath them can have those
characters. So instead of doing a massive find/replace, I just needed
to change two characters and I was good to go.


--- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote:

 There are a few predefined characters that can confuse XML. A good
 article to peruse is at:
 
 http://articles.techrepublic.com.com/5100-22-5032714.html
 
 '-' and '/' aren't listed.
 





[flexcoders] Re: Need help finding and fixing SQL Error in AIR App

2008-04-30 Thread valdhor
Nope - nothing to do with the XML.

You have a comma missing between :Sheet_Depth and :Unique_Product_Code
in your sqlText variable in your insertData function.



--- In flexcoders@yahoogroups.com, bredwards358 [EMAIL PROTECTED]
wrote:

 So, I finish a simple application to turn an XML Document into a SQL
 Lite table, however, every time I try to run it, I simply get an error
 message in the error log I set up: [b]Error ID:3115 DetailsError #3115:
 SQL Error.[/b] As you can see, it's simply not descriptive enough.
 
 Going over my code, I really have no idea on where I could be doing
 things wrong here, it could be something as simple as improper
 formatting, but the document I'm working to convert is huge, thus making
 the create table, and insert statement with just the number of columns
 (34!). I'm not exactly sure where to begin here, and since posting
 snippets would exceed the max size of the post I suppose I could ask for
 a point in the right direction. Right now I'm thinking something is not
 matching up right.
 
 Here's a snippet from my XML document, and the statements in my app, due
 to the size of the XML,  I can't post it in it's entirety since it would
 exceed most message board limits.
 Xml
 Document Snippet
 Support xmlns=http://tempuri.org/Support.xsd;
 Avery
Original3267/Original
Product_Code3267/Product_Code
Unique_Product_ID3267/Unique_Product_ID
TrademarkYes/Trademark
Patent_PendingNo/Patent_Pending
Avery_Product_CategoryGreeting Cards/Avery_Product_Category
Product_DescriptionWhite Full-Size Card Sheet/Product_Description
Product_TypeCard/Product_Type
Coated_StockYes/Coated_Stock
Photo_Quality-/Photo_Quality
Full_Bleed-/Full_Bleed
Mirror_Image_Required-/Mirror_Image_Required
Printer_TypeInkjet/Printer_Type
Corresponding_A4_SKUC2356/Corresponding_A4_SKU
Template_Family9/Template_Family
Page_Size8 1/2 x 11/Page_Size
OrientationPortrait/Orientation
Number_of_Lbls_Cards_per_Sheet1/Number_of_Lbls_Cards_per_Sheet
Label_Height11/Label_Height
Label_Width8.5/Label_Width
Corner_Radius0/Corner_Radius
Number_Sections_Across1/Number_Sections_Across
Number_Sections_Down1/Number_Sections_Down
Top_Margin0/Top_Margin
Bottom_Margin0/Bottom_Margin
Left_Margin0/Left_Margin
Right_Margin0/Right_Margin
Horiz_Pitch8.5/Horiz_Pitch
Vertical_Pitch11/Vertical_Pitch
Sheet_Width8.5/Sheet_Width
Sheet_Depth11/Sheet_Depth
Unique_Product_Code3267/Unique_Product_Code
 /Avery

Crea\
 te Table Statement Snippet
 private function createTable():void
  {
  var sqlText:String = CREATE TABLE Avery(Original TEXT,
 Product_Code TEXT, Cross_Reference TEXT, Sequence NUMERIC,  +
  Unique_Product_ID TEXT, Trademark TEXT,
 Patent_Pending TEXT, Avery_Product_Category TEXT,  +
  Product_Description TEXT, Priority_SKU TEXT,
 Product_Type TEXT, Coated_Stock TEXT, Photo_Quality TEXT,  +
  Full_Bleed TEXT, Mirror_Image_Required TEXT,
 Printer_Type TEXT, Corresponding_A4_SKU TEXT,  +
  Template_Family NUMERIC, Page_Size TEXT,
 Orientation, Number_of_Lbls_Cards_per_Sheet NUMERIC,  +
  Label_Height NUMERIC, Label_Width NUMERIC,
 Corner_Radius NUMERIC, Number_Sections_Across NUMERIC,  +
  Number_Sections_Down NUMERIC, Top_Margin
 NUMERIC, Bottom_Margin NUMERIC, Left_Margin NUMERIC,  +
  Right_Margin NUMERIC, Horiz_Pitch NUMERIC,
 Vertical_Pitch NUMERIC, Sheet_Width NUMERIC,  +
  Sheet_Depth NUMERIC, Unique_Product_Code
 TEXT);
 
  createTableStatement = new SQLStatement();
  createTableStatement.sqlConnection = conn;
  createTableStatement.addEventListener(SQLEvent.RESULT,
 createTableResult);
  createTableStatement.text = sqlText;
  createTableStatement.execute();
  }

Inse\
 rt Statement Snippet





[flexcoders] Re: Need help finding and fixing SQL Error in AIR App

2008-04-30 Thread bredwards358
--- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote:

 Nope - nothing to do with the XML.
 
 You have a comma missing between :Sheet_Depth and :Unique_Product_Code
 in your sqlText variable in your insertData function.
 
Cool, thanks for pointing that out as well. I've figured a few things
out myself. As a workaround, I decided to export the table I wanted as
a CVS document and import it into SQL Lite using a browser I
downloaded. One of the things I've noticed is that SQL Lite does not
like special characters such as - or / in what you're importing,
so after changing a few things, I got the table imported and all is well.

However, I think that along with that missing comma you pointed out,
my problem may also have something to do with trying to write these
forbidden special characters into the table. It would explain the
sheer number of errors. Thanks for everything though, to all those who
responded, I appreciate it. Another question though, just out or
curiosity, is it possible to use some sort of escape character(s) to
get those -'s and /'s into the table?



Re: [flexcoders] Re: Need help finding and fixing SQL Error in AIR App

2008-04-30 Thread Michael Wills
Going back over this conversation, perhaps you could use a pastebin to 
post the code chunks? I have seen http://pastebin.org/ but I haven't 
used it before. I am curious about the invalid characters though because 
the only thing I have seen in the docs so far is that you have to use 
two single quotes, i.e. '' to get a single quote ' inserted. So 
Adobe's would have to be Adobe''s. But '-' and '/' aren't mentioned.

http://sqlite.org/faq.html#q14

bredwards358 wrote:

 --- In flexcoders@yahoogroups.com 
 mailto:flexcoders%40yahoogroups.com, valdhor [EMAIL PROTECTED] wrote:
 
  Nope - nothing to do with the XML.
 
  You have a comma missing between :Sheet_Depth and :Unique_Product_Code
  in your sqlText variable in your insertData function.
 
 Cool, thanks for pointing that out as well. I've figured a few things
 out myself. As a workaround, I decided to export the table I wanted as
 a CVS document and import it into SQL Lite using a browser I
 downloaded. One of the things I've noticed is that SQL Lite does not
 like special characters such as - or / in what you're importing,
 so after changing a few things, I got the table imported and all is well.

 However, I think that along with that missing comma you pointed out,
 my problem may also have something to do with trying to write these
 forbidden special characters into the table. It would explain the
 sheer number of errors. Thanks for everything though, to all those who
 responded, I appreciate it. Another question though, just out or
 curiosity, is it possible to use some sort of escape character(s) to
 get those -'s and /'s into the table?

  


[flexcoders] Re: Need help finding and fixing SQL Error in AIR App

2008-04-30 Thread valdhor
There are a few predefined characters that can confuse XML. A good
article to peruse is at:

http://articles.techrepublic.com.com/5100-22-5032714.html

'-' and '/' aren't listed.


--- In flexcoders@yahoogroups.com, Michael Wills [EMAIL PROTECTED] wrote:

 Going back over this conversation, perhaps you could use a pastebin to 
 post the code chunks? I have seen http://pastebin.org/ but I haven't 
 used it before. I am curious about the invalid characters though
because 
 the only thing I have seen in the docs so far is that you have to use 
 two single quotes, i.e. '' to get a single quote ' inserted. So 
 Adobe's would have to be Adobe''s. But '-' and '/' aren't mentioned.
 
 http://sqlite.org/faq.html#q14
 
 bredwards358 wrote:
 
  --- In flexcoders@yahoogroups.com 
  mailto:flexcoders%40yahoogroups.com, valdhor stevedepp@ wrote:
  
   Nope - nothing to do with the XML.
  
   You have a comma missing between :Sheet_Depth and
:Unique_Product_Code
   in your sqlText variable in your insertData function.
  
  Cool, thanks for pointing that out as well. I've figured a few things
  out myself. As a workaround, I decided to export the table I wanted as
  a CVS document and import it into SQL Lite using a browser I
  downloaded. One of the things I've noticed is that SQL Lite does not
  like special characters such as - or / in what you're importing,
  so after changing a few things, I got the table imported and all
is well.
 
  However, I think that along with that missing comma you pointed out,
  my problem may also have something to do with trying to write these
  forbidden special characters into the table. It would explain the
  sheer number of errors. Thanks for everything though, to all those who
  responded, I appreciate it. Another question though, just out or
  curiosity, is it possible to use some sort of escape character(s) to
  get those -'s and /'s into the table?
 
 





[flexcoders] Re: Need help finding and fixing SQL Error in AIR App

2008-04-29 Thread bredwards358
Here's the Insert statement snippet since it got cut off due to length:

private function insertData(node:XMLNode):void
 {//Quite possibly the biggest SQL statement I've ever done
thus far
 var sqlText:String = INSERT INTO Avery(Original,
Product_Code, Cross_Reference, Sequence, Unique_Product_ID,  +
 Trademark, Patent_Pending,
Avery_Product_Category, Product_Description, Priority_SKU, Product_Type,
 +
 Coated_Stock, Photo_Quality, Full_Bleed,
Mirror_Image_Required, Printer_Type, Corresponding_A4_SKU,  +
 Template_Family, Page_Size, Orientation,
Number_of_Lbls_Cards_per_Sheet, Label_Height, Label_Width,  +
 Corner_Radius, Number_Sections_Across,
Number_Sections_Down, Top_Margin, Bottom_Margin, Left_Margin,  +
 Right_Margin, Horiz_Pitch, Vertical_Pitch,
Sheet_Width, Sheet_Depth, Unique_Product_Code) +
 VALUES(:Original, :Product_Code, :Cross_Reference,
:Sequence, :Unique_Product_ID, :Trademark, :Patent_Pending,  +
 :Avery_Product_Category, :Product_Description,
:Priority_SKU, :Product_Type, :Coated_Stock, :Photo_Quality,  +
 :Full_Bleed, :Mirror_Image_Required, :Printer_Type,
:Corresponding_A4_SKU, :Template_Family, :Page_Size,  +
 :Orientation, :Number_of_Lbls_Cards_per_Sheet,
:Label_Height, :Label_Width, :Corner_Radius,  +
 :Number_Sections_Across, :Number_Sections_Down,
:Top_Margin, :Bottom_Margin, :Left_Margin, :Right_Margin,  +
 :Horiz_Pitch, :Vertical_Pitch, :Sheet_Width,
:Sheet_Depth :Unique_Product_Code);

 insertStatement = new SQLStatement();
 insertStatement.sqlConnection = conn;
 insertStatement.addEventListener(SQLEvent.RESULT,
insertResult);
 insertStatement.addEventListener(SQLErrorEvent.ERROR,
errorHandler);
 insertStatement.text = sqlText;

 insertStatement.parameters[:Original] =
node.attributes.Original;
 insertStatement.parameters[:Product_Code] =
node.attributes.Product_Code;
 insertStatement.parameters[:Cross_Reference] =
node.attributes.Cross_Reference;
 insertStatement.parameters[:Sequence] =
node.attributes.Sequence;
 insertStatement.parameters[:Unique_Product_ID] =
node.attributes.Unique_Product_ID;
 insertStatement.parameters[:Trademark] =
node.attributes.Trademark;
 insertStatement.parameters[:Patent_Pending] =
node.attributes.Patent_Pending;
 insertStatement.parameters[:Avery_Product_Category] =
node.attributes.Avery_Product_Category;
 insertStatement.parameters[:Product_Description] =
node.attributes.Product_Description;
 insertStatement.parameters[:Priority_SKU] =
node.attributes.Priority_SKU;
 insertStatement.parameters[:Product_Type] =
node.attributes.Product_Type;
 insertStatement.parameters[:Coated_Stock] =
node.attributes.Coated_Stock;
 insertStatement.parameters[:Photo_Quality] =
node.attributes.PhotoQuality;
 insertStatement.parameters[:Full_Bleed] =
node.attributes.Full_Bleed;
 insertStatement.parameters[:Mirror_Image_Required] =
node.attributes.Mirror_Image_Required;
 insertStatement.parameters[:Printer_Type] =
node.attributes.Printer_Type;
 insertStatement.parameters[:Corresponding_A4_SKU] =
node.attributes.Corresponding_A4_SKU;
 insertStatement.parameters[:Template_Family] =
node.attributes.Template_Family;
 insertStatement.parameters[:Page_Size] =
node.attributes.Page_Size;
 insertStatement.parameters[:Orientation] =
node.attributes.Orientation;

insertStatement.parameters[:Number_of_Lbls_Cards_per_Sheet] =
node.attributes.Number_of_Lbls_Cards_per_Sheet;
 insertStatement.parameters[:Label_Height] =
node.attributes.Label_Height;
 insertStatement.parameters[:Label_Width] =
node.attributes.Label_Width;
 insertStatement.parameters[:Corner_Radius] =
node.attributes.Corner_Radius;
 insertStatement.parameters[:Number_Sections_Across] =
node.attributes.Number_Sections_Across;
 insertStatement.parameters[:Number_Sections_Down] =
node.attributes.Number_Sections_Down;
 insertStatement.parameters[:Top_Margin] =
node.attributes.Top_Margin;
 insertStatement.parameters[:Bottom_Margin] =
node.attributes.Bottom_Margin;
 insertStatement.parameters[:Left_Margin] =
node.attributes.Left_Margin;
 insertStatement.parameters[:Right_Margin] =
node.attributes.Right_Margin;
 insertStatement.parameters[:Horiz_Pitch] =
node.attributes.Horiz_Pitch;
 

[flexcoders] Re: Need help finding and fixing SQL Error in AIR App

2008-04-29 Thread valdhor
I don't know whether this is your problem but your Orientation field
has no type in your create table function.


--- In flexcoders@yahoogroups.com, bredwards358 [EMAIL PROTECTED]
wrote:
Snip




[flexcoders] Re: Need help finding and fixing SQL Error in AIR App

2008-04-29 Thread bredwards358
--- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote:

 I don't know whether this is your problem but your Orientation field
 has no type in your create table function.
 
 
 --- In flexcoders@yahoogroups.com, bredwards358 bredwards358@
 wrote:
 Snip


Sadly, no, but thanks anyway for pointing that out. I think the
problem has something to do with the way the XML document is
structured. The example I drew this from used an example xml file
structured like this:

?xml version =1.0 encoding=utf-8?
months
month sortOrder=1 English=January Spanish=Enero/
...
...
month sortOrder=12 English=December Spanish=Diciembre/
/months

So perhaps it may be trying to read my xml document as if it were
structured like this and throwing an error for each and every entry?