[sqlite] sql select of varchar text with special chars

2009-03-25 Thread anjela patnaik
Hello all,
 
I've a table in oracle that contains fields of type varchar2. In these fields 
are TCL scripts that contain backslash chars and brackets.
 
Now, I've generated an SQL file from the Oracle table data that contains SQL 
insert statements. I then use sqlite .read to read in the entire db. This runs 
fine with no issues.
 
However, when I select the rows using SQLite (TCL api), I notice some of the 
data comes back garbled and messed up. This doesn't happen to all of the rows, 
just some of them.
 
How do I get around this? It's not exactly clear why the SQLite TCL API is not 
handling some of the data properly.
 
Note that when I do a select using the sqlite3 command API, I don't see any 
problems.
 
Below is the insert corresponding to a row that comes back messed up. By messed 
up, I mean that the data that comes back has a \ for every space in the 
original field. But that is not what the original data contained. 
 
Thanks for any help!!
 
 
Insert into AUTO
   (OPERATION, INTERFACE, OCRELEASE, RUNDATE, PRODUCTS, SERVER, REQUEST, 
REQUEST2, RESPONSE)
 Values
   ('addConnections', 'MultiLayerSubnetworkMgr_I', '9.0.1', '01/16/2009', 
'{Core CI}', 
    '10.120.6.104', '  set ver 7.1
  set callName \
    [NamingAttributes_T $ver \
    [NVSList_T $ver \
    [NameAndStringValue_T $ver \
    "EMS" \
    "CI/LightWorks_ON-Center" \
    ] \
    [NameAndStringValue_T $ver \
    "Call" \
    "Tunnel" \
    ] \
    ] \
    ] 
  set connectionsToAdd \
    [SNCCreateDataList_T $ver \
    [SNCCreateData_T $ver \
    "" \
    "false" \
    "" \
    "1" \
    "1" \
    "3" \
    "2" \
    "2" \
    "0" \
    [LayerRate_T $ver \
    "14" \
    ] \
    [CrossConnectList_T $ver \
    ] \
    [ResourceList_T $ver \
    ] \
    "false" \
    [ResourceList_T $ver \
    ] \
    [NamingAttributesList_T $ver \
    [NamingAttributes_T $ver \
    [NVSList_T $ver \
    [NameAndStringValue_T $ver \
    "EMS" \
    "CI/LightWorks_ON-Center" \
    ] \
    [NameAndStringValue_T $ver \
    "ManagedElement" \
    "inci095" \
    ] \
    [NameAndStringValue_T $ver \
    "FTP" \
    
"/rack=1/shelf=3/slot=15/port_group=1/port=Tunnel" \
    ] \
    [NameAndStringValue_T $ver \
    "CTP" \
    "/sts1_au3=29" \
    ] \
    ] \
    ] \
    ] \
    [NamingAttributesList_T $ver \
    [NamingAttributes_T $ver \
    [NVSList_T $ver \
    [NameAndStringValue_T $ver \
    "EMS" \
    "CI/LightWorks_ON-Center" \
    ] \
    [NameAndStringValue_T $ver \
    "ManagedElement" \
    "inci095" \
    ] \
    [NameAndStringValue_T $ver \
    "PTP" \
    "/rack=1/shelf=3/slot=2/sub_slot=1/port=1" \
    ] \
    [NameAndStringValue_T $ver \
    "CTP" \
    "/sts1_au3=27" \
    ] \
    ] \
    ] \
    ] \
    [NVSList_T $ver \
    [NameAndStringValue_T $ver \
    "SNC_NAME" \
    "ethSNC222" \
    ] \
    [NameAndStringValue_T $ver \
    "SNC_PREEMPTING" \
    "No" \
    ] \
    [NameAndStringValue_T $ver \
    "SNC_PREEMPTABILITY" \
    "No" \
    ] \
    [NameAndStringValue_T $ver \
    "SNC_PRIORITY" \
    "0" \
    ] \
    [NameAndStringValue_T $ver \
    "SNC_UNPROTECTED_LINES" \
    "Yes" \
    ] \
    [NameAndStringValue_T $ver \
    "SNC_PROTECT_LINES" \
    "No" \
    ] \
    [NameAndStringValue_T $ver \
    "SNC_LINEAR_APS_PROTECTED_LINES" \
    "No" \
    ] \
    [NameAndStringValue_T $ver \
 

[sqlite] memory and db size

2009-03-19 Thread anjela patnaik
Hello all,
 
I'm working on a GUI application using Tcl/Tk with sqlite back end on windows. 
Now, multiple users will be running this and all users must have a copy of the 
db local to their PC or in a shared drive. At least that is my understanding of 
how sqlite works.
 
1. What are my options if the db gets very large (say > 1 G) and we don't want 
users to allocate that much disk space and RAM?
 
2. How does sqlite allocate RAM when doing select statements? what about when 
opening the db ?
 
3. Are there any ways to compress db files in disk (for free) and then is 
sqlite able to still get to the data easily?
 
Thank you!


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


[sqlite] extra character when reading SQL file

2009-03-09 Thread anjela patnaik

Hello,
 
I noticed that when I .read a SQL file with insert statements, sqlite is 
inserting an \r before the \n for multiline chars. So I had to regsub out the 
\r char. Is there a way to override this extra char?
 
I'm on Windows2k
 
Thank you


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


[sqlite] problem with sqlite storing TCL scripts

2009-03-06 Thread anjela patnaik
Hello all,
 
I've used sqlite3 .read command to read in an SQL file from (exported via TOAD) 
Oracle that contains TCL scripts.
 
The .read worked fine, but now I'm noticing that my multi-line scripts are not 
running properly on the shell when I retrieve them from the sqlite table.
 
I notice that somehow extra newlines were added or some other control chars. 
 
The original scripts in the exported SQL file are fine and can be run directly 
on the shell.
 
Do I need to do something to properly import/store TCL scripts with backslashes 
and newlines into SQLite??
 
still new to sqlite...
 
 
Thank you for any advice!
 
Below is the script from the SQL file:
 
set ver 7.1
set managedElementName \
[NamingAttributes_T $ver \
[NVSList_T $ver \
[NameAndStringValue_T $ver \
"EMS" \
"" \
] \
[NameAndStringValue_T $ver \
"ManagedElement" \
"IN_CN4200_22" \
] \
] \
] 
set tpLayerRateList \
[LayerRateList_T $ver \
] 
set connectionLayerRateList \
[LayerRateList_T $ver \
] 
set how_many \
"1000" 
if [catch {getAllPTPs $thread $managedElementName $tpLayerRateList 
$connectionLayerRateList $how_many tpList tpIt} err] {
puts stderr "getAllPTPs failed, err = $err"
}
 
Below is the return from the select off the sqlite db:
 
set ver 7.1
 
  set managedElementName \
    [NamingAttributes_T $ver \
    [NVSList_T $ver \
    [NameAndStringValue_T $ver \
    "EMS" \
    "" \
    ] \
    [NameAndStringValue_T $ver \
    "ManagedElement" \
    "IN_CN4200_22" \
    ] \
    ] \
    ] 
 
  set tpLayerRateList \
    [LayerRateList_T $ver \
    ] 
 
  set connectionLayerRateList \
    [LayerRateList_T $ver \
    ] 
 
  set how_many \
    "1000" 
 
  if [catch {getAllPTPs $thread $managedElementName $tpLayerRateList 
$connectionLayerRateList $how_many tpList tpIt} err] {
  puts stderr "getAllPTPs failed, err = $err"
  }
 
 


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


[sqlite] problem reading in SQL file with To_Date from Oracle

2009-02-26 Thread anjela patnaik
Hello all,
 
I'm new to sqlite3. I have data in a Oracle table with one column being a date 
type. Now, I've exported this table into a sql file with insert statements. 
 
Then, I ran the .read command in sqlite3 to read in the sql statements. 
sqlite doesn't support the TO_Date function.
 
How do I get around this? My sql file is large, i.e > 8000 rows.
 
Is there maybe a way to define this function internally?
 
I'm using TOAD to create the sql file from Oracle.
 
Your inputs appreciated!!
 
Thanks.
 
ps my table schema below:
 
CREATE TABLE NBIAUTO
(
  OPERATION  VARCHAR2(50),
  INTERFACE  VARCHAR2(50),
  OCRELEASE  VARCHAR2(8),
  RUNDATE    DATE,
  PRODUCTS   VARCHAR2(255),
  SERVER VARCHAR2(50),
  REQUEST    VARCHAR2(4000),
  REQUEST2   VARCHAR2(4000),
  RESPONSE   CLOB
)


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


[sqlite] question on creating/populating table with varchar/clob data types

2009-02-23 Thread anjela patnaik
Hello all,
 
I have a TCL application that writes database records to an Oracle db. This 
database has grown to contain 8000 records. There are 2 columns of varchar with 
4k chars and 1 column of clob which contains 1Mg max. The data in this database 
are scripts.
 
Now, I need to write another application in TK that works offline, but 
retrieves the data in this database and presents it to the user. I am not going 
to be able to access this Oracle db so I was wondering if I could export all 
the data to a SQLite db and then access it from TCL/TK. 
 
Does SQLite handle 4k Varchar fields and clobs? Is there a limit on # of rows? 
Can I create a db on the fly as part of a TCL/TK application ?
 
My other alternative was to offload the Oracle data to a XML/Xcel file and then 
write TCL code to parse it.
 
Thank you


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