SQLSTATE provides detailed information about the cause of a warning or error. For errors that occur in the data source detected and returned by SQL Server, the SQL Server Native Client ODBC driver maps the returned native error number to the appropriate SQLSTATE. If a native error number does not have an ODBC error code to map to, the SQL Server Native Client ODBC driver returns SQLSTATE 42000 ("syntax error or access violation"). For errors that are detected by the driver, the SQL Server Native Client ODBC driver generates the appropriate SQLSTATE.
We're trying to execute a stored procedure via a custom query. We have an ODBC connection. We're initiation the workflow via Forms. We pass nearly 3 dozen Forms variables from the Retrieve Business Process Variables tool. When we run a test form, we receive an error stating: "ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '@P2'."
We've done this on other Forms/Workflow combinations just fine. However, on those we were only passing one variable via the stored procedure. I'm a relative novice when it comes to SQL, so I'm not even sure we're doing it correctly. Perhaps we're using the wrong separator between the variables. This is an example of what it looks like: stored_procedure_name ?, 'variable 1', ?, 'variable 2', ?, 'variable 3' etc. Is this the correct way to pass multiples?
Chris, your answer was the one that worked after all. There was an additional variable in the stored procedure that I wasn't aware of that needed to be added to the query. Once I did that, I was able to get it to work. Now I need to figure out the part of pulling a newly created variable back out from the query...
On thing I always have to do though is hit the Test button in the activity in workflow. Only after you test it do you get the output in usable activities below. Also, the name always seem to come in blank for some reason.
Yes, we're passing variables collected by a form. It's an ODBC database. As such, using the code that we enter into the stored procedure, would the process to enter the data and then retrieve the new variable look like the insert below?
It looks like you can run an sp using one parameter with just the single question mark. When you add multiple parameters you have to assign them. In the example above the names @param1, etc have to be the exact names of the parameters as defined in the stored procedure. In my case the parameters had names like @Department, and @DocumentType. But with that it worked. This may be connection dependent as well, with ODBC acting in a different manner than a direct connection.
I have one working (with one variable). This is it (see attached). You have to make sure that the workflow version and odbc version are the same: ie. 32 bit or 64 bit. Also very important that the data type and length you are bringing in is exactly the same in Laserfiche otherwise it will fail as well.
We do have other workflows where it works. But those were only for working with one variable as shown below. That's why I initially built the new one in the same format. This workflow works just fine, so I'm assume that there aren't any compatibility issues between Laserfiche Workflow and the OBDC database.
Hi Micheal, if you have the option to use a SQL connection instead of an OBDC connection to your DB, I'd suggest you do that. That way you can create real parameter names and use them in the SQL Query as opposed to having to play around with a bunch of "?"s
DataSource.Error : ODBC : ERROR [42000] [Microsoft][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: Error while compiling statement: FAILED: Runtime Exception org.apache.hadoop.hive.ql.metadata.HiveException: Table XXXX is an Iceberg table format which is not currently supported.
I tried also installing the Hive ODBC driver 2.7.0. I configured the User DSN and test was successful. When I try to connect form PBI Desktop, I can establish the connection but I receive the same error if I try to load an Iceberg table:
DataSource.Error: ODBC: ERROR [42000] [Cloudera][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: Error while compiling statement: FAILED: Runtime Exception org.apache.hadoop.hive.ql.metadata.HiveException: Table XXXX is an Iceberg table format which is not currently supported.
This is Sathish, I am trying to create a report and retrieve data through stored procedure using ODBC Connection. When connecting to the Stored Procedure it is showing Database Connection Error 42000:[Microsoft][ODBC driver for oracle] Syntax error or access violation' Error.
This is a not ODBC driver code, this error message is coming from an exception captured by aioodbc/connection.py at master aio-libs/aioodbc GitHub because our customer is using this library aioodbc/aioodbc at master aio-libs/aioodbc GitHub for async ODBC calls.
The problem is I have gotten these series of scripts to work perfectly on a personal computer running SQL Server 2014 Express, with the exact same schema setup for the databases A and B, but when I set everything up on my company's main server running SQL Server 2014 I get the following error message:
System.Data.Odbc.OdbcException (0x80131937):
ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]
The SELECT permission was denied on the object 'B_Table', database 'B', schema 'dbo'. ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]
The UPDATE permission was denied on the object 'B_Table', database 'B', schema 'dbo'.
I've tried giving the user activating the initial trigger all privileges on both A and B, as this was enough to fix the issue on my personal computer server. However, giving basically "god" privileges hasn't been enough to resolve this error on the server.
However, in that case there was a Trigger in Database B and that is not the situation here. Still, this should be fairly easy to solve and will use a setup similar to what is described in that other answer.
I have a user who is trying to do a Bulk Insert on a database using a Python script and gets the error - Cannot bulk load because the file "//server.local.com/File01/In Progress/Work/Script/file.csv" could not be opened. Operating system error code 5(Access is denied.)
Now I am no SQL expert or even an Admin, my knowlegde of SQL is very limited, so I hope someone who has far more knowledge and experience than I do can shed some light on what I can do to help this user.
Error:
ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot bulk load because the file "//server.local.com/File01/In Progress/Work/Script/file.csv" could not be opened. Operating system error code 5(Access is denied.).')
When using BULK INSERT the command will be executed in the context of the service account running SQL Server if the user logged into SQL Server using SQL Authentication. If the user logs into SQL Server using Windows Authentication then the permissions will be based on that user.
Microsoft Windows is required because Microsoft Access ODBC drivers are only available on Windows. As for the destination MySQL server, you can have it in the same local machine or elsewhere in your network.
Microsoft Access stores relationship/foreign key information in an internal table called MSysRelationships. That table is protected against read access even to the Admin user, so if you try to migrate without opening up access to it, then you will get an error like this:
To confirm that you're logged in as the "Admin" user, locate the Immediate panel and type the "? CurrentUser" and press Enter. This should output "Admin" under "? CurrentUser" in the panel (see the figure that follows).
From the main MySQL Workbench screen you can start the Migration Wizard by clicking the database-migration launcher ( ) in the Workbench side panel or by clicking Database and then Migration Wizard from the main menu. As the following figure shows, a new tab showing the Overview page of the Migration Wizard is displayed.
To verify that you have the ODBC driver installed, click Open ODBC Administrator from the MySQL Workbench migration overview page to open the system ODBC tool. Then, select the Drivers tab (see the figure that follows).
MySQL Workbench has a 64-bit executable. The ODBC drivers you use must be of the same architecture as the MySQL Workbench binaries you are using. If during migration you get an ODBC error about "architecture mismatch between the Driver and Application", you installed the wrong version of MySQL Workbench.
Click Start Migration from the Overview page to advance to the Source Selection page. Here you need to provide the information about the Access database you are migrating from, the ODBC driver to use, and the parameters for the Access connection.
Open the Database System combo box for a list of supported RDBMSes, and select Microsoft Access from the list. There is another combo box below it named Stored Connection. It lists saved connection settings for that RDBMS. You can save connections by marking the check box at the bottom of the page, along with a name for the saved connection.
The next combo box selects the Connection Method. This time we are going to select ODBC Data Source from the list. This allows you to select pre-existing DSNs that you have configured in your system.
In the Default Character Set field you can select the character set of your database (see the figure that follows). If your Access version uses western/latin characters, you can leave the default cp1252. However, if you use a localized version of Access, such as Japanese, you must enter the correct character set used by your edition of Microsoft Office, otherwise the data will be copied incorrectly.
Next, set up the target (MySQL) database parameters by defining the parameters that connect to your MySQL Server instance. When finished, click Test Connection to verify the connection definition. The following figure shows the Parameters tab.
c80f0f1006