question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Records in table are always insert empty in the table

See original GitHub issue

Hi 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:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
harish343commented, Oct 17, 2022

how can I check records table

1reaction
harish343commented, Oct 14, 2022

Can I work on this issue

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found