how to all Oracle Stored Proc in Package from Delphi - 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?

Related

new to dbt and trying to learn how to execute procedure using dbt but getting error

create or replace procedure output_message(message varchar)
returns varchar not null
language sql
as
begin
return message;
end;
call output_message('Hello World');
error I'm getting:
Database Error in model my_first_dbt_model (models/example/my_first_dbt_model.sql)
001003 (42000): SQL compilation error:
syntax error line 2 at position 7 unexpected 'create'.
syntax error line 3 at position 0 unexpected 'returns'.
compiled SQL at target/run/dbt_project/example/my_first_dbt_model.sql
You cannot put code for a stored procedure in a model file (any .sql file in your models directory). dbt assumes that a model file contains a single select statement; it then wraps that select statement in DDL (usually a create table my_model as (...) statement), depending on your materialization config for that model.
Macros are more flexible. Generally, Stored Procedures aren't part of the dbt workflow, but there are some valid use-cases for them (along with UDFs).
You can create a output_message.sql file in your macros directory, and use the code you provided, wrapping it in a macro definition, like:
{% macro output_message(msg) %}
create or replace procedure output_message(message varchar)
returns varchar not null
language sql
as
begin
return message;
end;
call output_message(msg);
{% endmacro %}
You can then call that macro in a post-hook or by using run-operation:
dbt run-operation output_message --args "{'msg': 'Hello World!'}"
You can customize your code using materialization link and I have followed a link to create ddl objects. You need to write macros for that.

MYSQL 6 - You have an error in your SQL Syntax 'Diagnostics Condition 1'

I have version 8 of MySQL but need to update a database stored procedure that is using 5. When I test this code in version 8 I do not receive any errors. However when I add it to the stored procedure on the the older version I receive the following error:
ERROR 1064: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near 'DIAGNOSTICS CONDITION 1 errstate = RETURNED_SQLSTATE, msg =
MESSAGE_TEXT;
This is the code that I have inserted that is causing the error.
DECLARE errstate CHAR(5) DEFAULT '00000';
DECLARE msg TEXT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
GET DIAGNOSTICS CONDITION 1
errstate = RETURNED_SQLSTATE,
msg = MESSAGE_TEXT;
END;
I could not find any documentation specific to version 5 for using GET DIAGNOSTICS CONDITION.

Neo4j apoc procedures impala configuration

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).

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