I am using Data Stage version 11.5. We recently migrated from Oracle to PostgreSQL. But now I am facing issues in how to call the PostgreSQL procedure in Datastage.
CALL executes a procedure.
If the procedure has any output parameters, then a result row will be returned, containing the values of those parameters.
See: https://www.postgresql.org/docs/current/sql-call.html
Related
I am looking to create a temporary view on Snowflake using the Snowpark API (version 1.6.0). I have created a DataFrame and was attempting to use the createOrReplaceTempView() function as follows:
// code to create dataframe here
finalDF.createOrReplaceTempView(outputTableName)
When I run this code, I see the following error:
net.snowflake.client.jdbc.SnowflakeSQLException: Stored procedure execution error: Unsupported statement type 'temporary VIEW'.
On a worksheet within my Snowflake account, I am able to create the same table successfully through raw SQL.
Any ideas why I'm prevented from doing the same through Snowpark?
From the error message, I understood that you are running a stored procedure. By default, if not specified, stored procedure runs on the owner's rights which blocks the creation of temporary objects. So, use the caller's rights by adding EXECUTE AS CALLER statement in the stored procedure.
eg:
CREATE or replace PROCEDURE sample_proc(
)
RETURNS VARCHAR
...
...
EXECUTE AS CALLER
AS
I use Spring boot with spring-jpa, database postgresql.
I'd like to call Stored Procedure via EntityManager.createStoredProcedureQuery.
One of stored procedure parameter is postgresql xml. If I transfer String as parameter I get an error. Could you explain me, please, how can I convert String to SQLXML in this situation?
What is the equivalent of sp_refreshsqlmodule (sys stored procedure) in SQL Server for PostgreSQL?
sp_refreshsqlmodule
https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-refreshsqlmodule-transact-sql?view=sql-server-ver15
Updates the metadata for the specified non-schema-bound stored
procedure, user-defined function, view, DML trigger, database-level
DDL trigger, or server-level DDL trigger in the current database.
Persistent metadata for these objects, such as data types of
parameters, can become outdated because of changes to their underlying
objects.
In Postgres views, procedures and functions are created in a similar way as SQL Server's "with schema binding".
So there is no equivalent procedure in Postgres, because there is no need for it.
Can you help me please? I have to call with job a stored procedure located in an Informix database (stored procedure with 4 parameters) and after store the data generated by stored procedure in a SQL Server database. Please tell me how to call this stored procedure (stored procedure stage do not support informix). Thanks in advance
I am running Sybase Adaptive Server Enterprise 15.7, please could anyone tell me how to write a procedure that iterates through each table within the database and truncates the data in each table.
Thanks
:-)
There's two ways:
(i) write it yourself by cycling over sysobjects and constructing a truncate table command for every table found, and then executing it with exec(#cmd).
(ii) download my stored procs from http://www.sypron.nl/new_ssp_dwn.html, install them and then run:
sp_rv_findobject 'db=your_db_name', type=U', 'exec=immediate', 'execarg=truncate table OW.NM'