Records in table are always insert empty in the table
See original GitHub issueHi We are planing to upgrade the alssql version from .2 to 1.7.3. We are using the browser version of alasql and download from https://cdn.jsdelivr.net/npm/alasql@1.7( Got this link from official site (https://github.com/AlaSQL/alasql) and include in the our webpage. But with latest records in table are always insert empty in the table.
We are trying to create the table ‘BCPartners’ and then insert the data into JSON formate. We can see the records set but each column has blank value.This is a blocker for us so need help ASAP Below are the sample code and more details ----------- Sample HTML page ---------------------
<html>
<head></head>
<body>
<script language="javascript" src="scripts/3rdParty/alasql.min.js"></script>
<script language="javascript" src="test.js"></script>
"CREATE TABLE IF NOT EXISTS [BCPartners] ( RecordNum INTEGER PRIMARY KEY AUTOINCREMENT , [TABLE_NAME] TEXT DEFAULT \"\", [BC] TEXT DEFAULT \"\")" =
<script>
var data = [
{TABLE_NAME: "S_CON_ADDR", BC: "Pharma Address Inter Table - CE,CUT Address for Ac…,Pharma Pick Address,CUT Address Inter Table - CE"},
{TABLE_NAME: "S_PROD_INT", BC: "Pharma Internal Product,Internal Product,FINS Security,Pharma Sample Lot for Picklist"},
{TABLE_NAME: "S_LST_OF_VAL", BC: "List Of Values,PickList Generic,List Of Values Chi… Of Values Dynamic,PickList Hierarchical Sub-Area"},
{TABLE_NAME: "S_EMP_PRDINT", BC: "Pharma Personal Products List,Pharma Personal Samp…Items List,Pharma Personal Promotional Items List"},
{TABLE_NAME: "S_ADDR_PER", BC: "CUT Address,CUT Address - CE,Pharma Address"},
{TABLE_NAME: "S_LIT", BC: "Admin Sales Tool,Admin Sales Tool Thumbnail"},
{TABLE_NAME: "S_EVT_ACT", BC: "Pharma Professional Call - Mobile,Pharma Account Call,Pharma Professional Call,Action"},
{TABLE_NAME: "S_MSG_PLAN", BC: "LS Messaging Plans BC,LS Admin Messaging Plans BC"},
{TABLE_NAME: "S_ACT_PRDINT", BC: "LS Pharma Call Sample Dropped Rollup,LS Pharma Pro…motional Items Dropped,Pharma Call Sample Dropped"},
]
function showResult(x){
document.getElementById('result').textContent = JSON.stringify(x, null, '\t');
}
CreateDB();
</script>
<xmp id="result"></xmp>
</body>
</html>
---------- Sample JS (test.js) code ---------
function CreateDB() {
debugger
var inmemDB = new alasql.Database("alasql_db");
window._memDB = inmemDB;
var
query = "CREATE TABLE IF NOT EXISTS [BCPartners] ( RecordNum INTEGER PRIMARY KEY
AUTOINCREMENT, [TABLE_NAME] TEXT DEFAULT\ "\", [BC] TEXT DEFAULT \"\")"
inmemDB.exec(query);;
inmemDB.exec("insert into [BCPartners] select * from ?
",[data]);
}
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
SQL insert into table if row not exists in empty table not working
If myTable is empty, then a SELECT ... FROM myTable will never produce any rows (even without the WHERE condition). Use. FROM dual....
Read more >Automatically inserting row in bottom of table
Hi, I would like my table to have an empty row below the data and above the summary where I can add information....
Read more >Table data entry - How to always have a blank row at the end ...
In the Table Tools/Design menu, click Resize Table and specify a longer range. Alternatively, the manual way is to select the last row...
Read more >Learn SQL: INSERT INTO TABLE - SQLShack
SQL INSERT INTO statement is one of the “big 4” in databases, next to SELECT, UPDATE, and DELETE.
Read more >Empty Table INSERT . . . SELECT Requests and Performance
For inserts into empty tables, if the transaction aborts, the system can easily return the table to its original state by deleting all...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
how can I check records table
Can I work on this issue