Neo4j apoc procedures impala configuration - neo4j

1) Downloaded the impala drivers 2.5.37 from
https://www.cloudera.com/downloads/connectors/impala/jdbc/2-5-37.html
2) Executed:
call apoc.load.driver("com.cloudera.impala.jdbc4.Driver")
No errors.
3) Executed:
CALL apoc.load.jdbc("jdbc:impala://<URL>:21050/default;user=<username>;password=<password>",
'<database>.<table name>') YIELD row
RETURN row.account as account_num
Error :Failed to invoke procedure apoc.load.jdbc: Caused by:
java.lang.RuntimeException: Cannot execute SQL statement `SELECT *
FROM .. Error: [Simba]ImpalaJDBCDriver
Error setting/closing session: {0}.
Can you please help me out?

The second argument to apoc.load.jdbc must be a string that is either a table name or a SQL statement. Replace '.' with the appropriate value (in your case, probably the name of the table that contains the account column).

Related

Rails ActiveRecord::Base.connection to execute upon an external file

To run a one-off procedure of loading data that is already formatted for loading into postgresql
BEGIN;
INSERT INTO "public"."optionsets" [...]
COMMIT;
Rails has the command that allows to execute raw sql
ActiveRecord::Base.connection.execute()
However, the syntax alludes to placing the syntax within the parenthesis and the documentation confirms this: "Executes the SQL statement in the context of this connection". The following fail
ActiveRecord::Base.connection.execute(/Users/main/optionsets.sql)
SyntaxError ((irb):3: unknown regexp options - ma)
ActiveRecord::Base.connection.execute("/Volumes/main/optionsets.sql")
ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near "/")
LINE 1: /Users/main/optionsets.sql
location = "/Volumes/main/optionsets.sql"
ActiveRecord::Base.connection.execute(location)
ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near "/")
LINE 1: /Users/main/optionsets.sql
How can this be effected instead by calling an .sql file /[path_to]/optionsets.sql ?
Reading the file is not effected in the above scenarios, so it must be executed beforehand.
file = File.read('/[path_to]/optionsets.sql')
ActiveRecord::Base.connection.execute(file)
If run from the command line, then Rails also has a "dbconsole" command with a "db" alias, so you can do something like this
rails db < /Volumes/main/optionsets.sql
https://github.com/rails/rails/blob/bbd6d82dc4e00b00f07193a0c7ac3e266bce410a/guides/source/command_line.md#binrails-dbconsole

how to all Oracle Stored Proc in Package from Delphi

I have been given a stored procedure (developed by a 3rd party) to execute...
create or replace package body cux_ivr_task_assigupd_pkg is
-- Private type declarations
procedure cux_update_task_assgnments(
p_task_number in varchar2,
p_pressed_number in number,
x_err_code out varchar2,
x_err_message out varchar2) is
and trying to execute this procedure from a Delphi program. when trying to call with name cux_ivr_task_assigupd_pkg.cux_update_task_assgnments I get error
[Oracle][ODBC][Ora]ORA-06564: object
CUX_IVR_TASK_ASSIGUPD_PKG.CUX_UPDATE_TASK_ASSGNMENTS does not exist
ORA-06512: at "SYS.DBMS_DESCRIBE", line 117 ORA-06512: at line 1
and if I use name cux_update_task_assgnments then get error
[Oracle][ODBC][Ora]ORA-06550: line 1, column 7: PLS-00201: identifier
'CUX_UPDATE_TASK_ASSGNMENTS' must be declared ORA-06550: line 1,
column 7: PL/SQL: Statement ignored
I do not have access to the database itself - I am just a client that needs to be able to execute the procedure. I tried both names, as the people that manage the databases told me to try it one and then the other. So I not sure if it is permission related or ???
Ideally I would like to execute using an ADO command line
exec procedure-name(arg1, arg2, arg3, arg4)
but only error about incorrect syntax and the people responsible for the DB could not help?!?
Any clues about the above error?

Quartz.Net error on common logging.

I am getting the following error:
2013-11-14 11:57:33,994 [TestScheduler_QuartzSchedulerThread] ERROR Common.Loggi
ng.Factory.AbstractLogger.Error(:0) - An error occurred while scanning for the n
ext trigger to fire.
Quartz.JobPersistenceException: Couldn't acquire next trigger: Cannot insert the
value NULL into column 'SCHED_TIME', table 'quartz.dbo.QRTZ_FIRED_TRIGGERS'; co
lumn does not allow nulls. INSERT fails.
The statement has been terminated. ---> System.Data.SqlClient.SqlException: Cann
ot insert the value NULL into column 'SCHED_TIME', table 'quartz.dbo.QRTZ_FIRED_
TRIGGERS'; column does not allow nulls. INSERT fails.
The statement has been terminated.
I am using the example from HERE and I think I need to understand how jobs work with ADO.Net Jobstore better. My code works perfectly with RAMJobStore. Is there something else I have to do to get ADO to scan for triggers?
Turns out when I looked closer at the errors it was referencing the older version of Quartz.net.

Unable to retrieve destination column descriptions from the parameters of the SQL command

I am trying to upgrade an SSIS package from 2008 to 2012 and getting the below error.
Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has
occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Server Native
Client 11.0" Hresult: 0x80004005 Description: "The metadata could
not be determined because statement 'EXEC master.dbo.xp_logevent
#ErrorCode, #Message, error' in procedure 'DebugPrint' invokes an
extended stored procedure.".
Error: Unable to retrieve destination column descriptions from the
parameters of the SQL command.
Basically, we have an OLE DB Command to call a stored procedure which call several (nested) stored procedures and one of it is DebugPrint which call master.dbo.xp_logevent. Any idea to fix it? It works in SSIS 2008.
Thanks
You could try using 'with result sets' when calling your proc and setting your metadata there.
Example :
EXEC dbo.proc
WITH RESULT SETS (
ID INT
,Col2 VARCHAR)
I came across a similar error.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80004005 Description: "The metadata could not be determined because statement '....' uses a temp table.".
Work around.
If SP uses a #table or ##table and it is used in the SP, then we need to specify the #table structure along with the EXEC.
The SP should be given along with the structure.
EXEC SP_TestTemp 1,2
it should be given like
EXEC SP_TestTemp 1,2 WITH RESULT SETS
(
(
id int,
Marks int
)
)
Note: the 'retain same connection = true' and 'validate external metadata' = false did not help/work here

Delphi SQLite Update causing errors to appear

I have used Inserts, selects, updates, deleted without problem all over the program but for some reason this specific section causes it to except and not run the SQL I send it.
I am trying to "UPDATE SectionTable(AreaID) VALUES ('+IntToStr(ActClient.AreaID)+') WHERE SectionID='+IntToStr(iCount)"
The section with the ID "iCount" exists deffinately. The ActClient.AreaID is "2" and its overwriting null data in the "SectionTable" table.
What is the problem here?
OpenDatabase(slDb);
sltb:=sldb.GetTable('SELECT * FROM SectionTable WHERE SectionID='+IntToStr(iCount));
OutputDebugString(PAnsiChar(sltb.FieldAsString(sltb.FieldIndex['SectionID'])+sltb.FieldAsString(sltb.FieldIndex['Gender'])+sltb.FieldAsString(sltb.FieldIndex['CompetitionID'])));
sSQL := 'UPDATE SectionTable(AreaID) VALUES ('+IntToStr(ActClient.AreaID)+') WHERE SectionID='+IntToStr(iCount);
sldb.ExecSQL(sSQL);
CloseDatabase(slDb);
I get this error message appear when this is ran.
---------------------------
Debugger Exception Notification
---------------------------
Project CompetitionServer.exe raised exception class ESQLiteException with message 'Error executing SQL.
Error [1]: SQL error or missing database.
"UPDATE SectionTable(AreaID) VALUES (2) WHERE SectionID=2": near "(": syntax error'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
UPDATE table SET column = expression, column = expression WHERE predicates

Resources