How to replace Table Loader - sas

During loading "Table loader" (replace) step I recived Java Error.
Is there is a way to replace mentioned above "Table loader" e.g Userr Written code to define there code to replace my dataset?

Related

PowerBI error when importing large excel worksheet

I'm trying to load an excel worksheet into PowerBI Desktop and when it reaches around 50 MB, it fails with the error "Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [DataFormat.Error] The input couldn't be recognized as a valid Excel document.. '."
If I reduce the size of that worksheet to about half, it loads fine.
The other worksheets in that doc (all are much smaller) load perfectly. I tried loading the failing worksheet first and get the same error. If I load the other worksheets first, they load fine but when I add the failing worksheet, I get the same error for all the worksheets.
Can someone suggest anything that I could try to resolve this?
Thanks in advance
V
As the error message indicates, the problem may be caused by a formatting error.Get a list of files found in a OneDrive folder, you can try again by following these steps:
Get a list of files (URLs) via
Source=SharePoint.Tables("https://your.sharepoint.com/personal/john_doe_acme_com/",[ApiVersion=15])
Expand Documents "Table"
Expand "File.LinkingUrl" and split by "?" to get a clean URL
Do filter the desired folder (via URL or Folder.Name or other attribution)
Add a Custom Column = Excel.Workbook(Web.Contents([File.LinkingUrl))
Click this link for detailed information:
https://community.powerbi.com/t5/Desktop/Error-when-connecting-folders-containing-excel-files/m-p/2343510#M845219

How can I check if a DB column exists or not when my query is stored in an XML file?

I'm working on a project with C++Builder. I need to create a program that allows the user to check if the structure of a database (Firebird or SQL Server) is good or bad.
I have many XML files for Firebird, and I have many XML files for SQL Server. In those files there are many SQL queries defined.
The idea that I want to implement is to execute every query with ExecSQL(). If there are any problems in the structure of a table, ExecSQL() would throw an exception with all the details of the error, and I just have to take all the error messages and generate a report PDF.
The types of queries that I have in the XML files are ALTER, INSERT, and CREATE.
When executing a CREATE, if the table does not exist I can execute the query, but if the table does exist and there is a column that does not exist, the error that I get from ExecSQL() only tells me the table exists but does not tell me the column is missing.
For exmple, if I have this SQL code:
CREATE TABLE CUSTOMERS(ID INT NOT NULL, NAME VARCHAR (20) NOT NULL);
After connecting to the database and executing the query, there are 3 cases:
if the table doesn't exist, ExecSQL() runs without problem.
if the table exists and all the columns that I need to create already exist, the exception that I get is "TABLE ALREADY EXIST".
if the table exists and one or more columns do not exist, the exception that I get is "TABLE ALREADY EXIST". It's not telling me about the column(s).

Qt SQL Pattern Matching

I am working on a C++ Qt program where I include a mysql database.
I want to do some sql queries and show the output on a tableview. Because I also want to filter the results I wrote this kind of code snippet:
query->prepare("SELECT * FROM contacts WHERE contactsName LIKE '%:name%';");
query->bindValue(":name", mUi->searchContactsLine->text());
query->exec();
mModel->setQuery(*query);
mUi->tableContacts->setModel(mModel);
... where
searchContactsLine
is the inputlinebox to search for a string,
mModel
is my QSqlQueryModel and
tableContacts
is my TableView in qt.
As you can see I want to use pattern matching with the dollar sign. But if I run the program I got no row back.. no matter what I am searching for.
In the past I had problems with the inverted commas ('...') while using the bindValue function, but if I delete it from the sql command I get an sql syntax error.
So what do I wrong? Maybe you have an idea of that.

Using a single ADO Query to copy data from a text file into another ODBC source

This may seem a odd question as I have a solution, I just dont understand why and that limits me.
I am copying data from various sources into SQL and am using a ADO connection in C++ Builder XE2.
When the data is from MSAccess or MSExcel the code is similar to the following:
//SetupADO..
ADOConn->ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/temp/testdb.mdb";
//Then open it..
ADOConn->Connected = true;
//Build SQL
UnicodeString sSQL = "SELECT * INTO [ODBC;DSN=PostgreSQL30;DATABASE=admin_db;SERVER=192.168.1.10;PORT=5432;UID=user1;PWD=pass1;SSLmode=disable;ReadOnly=0;Protocol=7.4;].[table1] FROM [accesstb]";
//And finally I use the EXCEUTE() function of the ADO Connection
ADOConn->Execute(sSQL, iRA, TExecuteOptions() << TExecuteOption::eoExecuteNoRecords);
This works fine for Excel too but not for CSV files. I'm using the same driver must can only get it working by changing the syntax around.
//SetupADO..
ADOConn->ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\temp;Extended Properties=\"Text;HDR=Yes;\";Persist Security Info=False";
//Then open it..
ADOConn->Connected = true;
//Build SQL with the IN keyword and start internal ODBC connection with 2 single quotes
UnicodeString sSQL = "SELECT * INTO [table1] IN '' [ODBC;DSN=PostgreSQL30;DATABASE=admin_db;SERVER=192.168.1.10;PORT=5432;UID=user1;PWD=pass1;SSLmode=disable;ReadOnly=0;Protocol=7.4;] FROM [test.csv]";
//And finally EXCEUTE() again
ADOConn->Execute(sSQL, iRA, TExecuteOptions() << TExecuteOption::eoExecuteNoRecords);
When using the same SQL as the Access query the error "Query input must contain at least one table or query" would be returned.
Intrestingly, one escaped quote, i.e. \' fails when used in place of the 2 single ones. I have also tried writing to another Access database in case the problem was with PG but I had the same results.
Can someone tell me why the IN keywork is required and what the single quotes do?
Extended Properties=\"Text;HDR=Yes;\" specifies text as the datasource, so the connection string is different. IN '' tells the database to map table1 to the first column of the CSV file, since there is no relational model in CSV.
References
Importing CSV Data and saving it in database - CodeProject

cant figure this error out

Can you guys see any obvious error in this query? The error im getting is: `Unknown column 003ADF50 in field list. 003ADF50 wtf?
query << "UPDATE `record` SET `record` = " << lastRecord << ", `time` = " << time;
What looks to be happening here is that one of those values that you're injecting into your sql is coming up as 003ADF50. (Probably the time value?)
Brendan Long is correct: you should be using prepared statements to properly handle parameters in your SQL. Manually concatenating strings leads to quoting problems like you see here, which can be serious security problems in your code. The specific quoting problem you're running into here is that the parameters aren't quoted in your resulting query string. If you were typing the SQL manually into the mysql client, you'd say something like:
UPDATE `record` set `record` = 'foo';
If instead you left out the quotes on 'foo', you'd have:
UPDATE `record` set `record` = foo;
which is trying to set the record column to the value of the foo column, rather than the literal string 'foo'. The same thing is happening with the SQL you're generating from your C++. Trying to solve this by manually adding quotes isn't a good idea -- what happens when the string parameter contains a quote character? The best thing to do is to use prepared statements.
Also, Google "little bobby tables" for a well-known XKCD comic about sql parameter injection, and consider what would happen if Bobby Tables' name found its way into one of your program's variables.