How to call Oracle stored procedure - parameter-passing

I am working on Oracle Apex forms. I have to call an Oracle stored procedure on click of a button and pass input parameters.
I am able to call the Procedure but do not know how to pass input parameters in it.

If parameter value stored on APEX form you should call like this proc_name(:Pxxx_ITEM_NAME, :Pxxx_ITEM_NAME2)

Related

How to Call Procedure With Dynamic SQL from View

I am trying to create a view that calls a procedure at initiation to compute 2 variables to be used in the WHERE clause. The query runs but will not save as a view as it appears procedure calls are not allowed. I researched this and found some suggestions about using a Function, but in trying that, I get errors that dynamic SQL is not allowed in a function.
Is there a way to do what I am attempting?
Code snippet:
CALL p_GetOutlierLimits('ROI_Imputed_Percent','DB1',#ClassicLowerROIPct, #ClassicUpperROIPct);
CALL p_GetOutlierLimits('576_VMC_Sol_Savings_Pct','DB2',#vmctcoLower149Pct, #vmctcoUpper149Pct);
USE Database;
SELECT
{CODE}
from TABLE
WHERE ROI_Imputed_Percent BETWEEN #ClassicLowerROIPct AND #ClassicUpperROIPct;
I found another way to do this by removing the calls from the view and just performing them from another procedure that accesses the view.

Script error when function/sub parameter is 3 or more in Lotusscipt IBM Notes 9.0

I have a simple validation code in Lotusscript to check if an entry is already existing in a view. I use a function with 2 parameters passed ByVal, and is working fine.
But when I added a third parameter, it causes script error when called.
Here's a screenshot of the error I get when using 3 parameters in function call:
Here's function parameter setup:
I can use a workaround for the third parameter, but it makes no sense adding nested if's or select case inside the function, and will not make the function flexible for other modules.
How can I solve this?

Oracle Forms Execute_query giving FRM-40737 error

I am getting an error
FRM - 40737 - illegal restricted procedure GO_BLOCK in
WHEN-VALIDATE-RECORD trigger.
My Code is
IF event_name = 'WHEN-VALIDATE-RECORD'
THEN
IF (form_name = 'OEXOEORD' AND block_name = 'ORDER')
THEN
-- call procedure to validate and cascade the ship method code.
cascade_ship_method;
execute_query;
END IF;
What am I doing wrong here ?
This is because Oracle Forms has two types of built-in procedures - restricted and unrestricted. Some triggers enable restricted procedures, some not (see Oracle Forms help, every trigger has information which procedures it enables).
Trigger WHEN-VALIDATE-ITEM fires for example when user moves cursor from one record to the other (this is called navigation). In this case it leaves one record and enters other. There is fired following chain of triggers
WHEN-VALIDATE-ITEM
WHEN-VALIDATE-RECORD
POST-ITEM
POST-RECORD
PRE-RECORD
PRE-ITEM
If any of this trigger fails, navigation is canceled and cursor returns to the original item. If you call any procedure, which starts new navigation (like GO_BLOCK), Oracle Forms would not be able to manage first navigation.
This is, why some procedures are restricted.
It might be relevant with content of cascade_ship_method. When I got this error, I had missed an apostrophe in the SET_BLOCK_PROPERTY statement. When I fixed, it worked. This is the correct structure in my code block:
SET_BLOCK_PROPERTY (
'TABLE_A',
default_where,
'column_a= '
|| ''''
|| variable
|| '''');

Variable in Data flow task in SSIS

I have developed SSIS package where in I have script component and Data flow task. Script component take 2 input variables namely Db2Con, SQLCon which are DB2 connection string and SQL Connection String. In this script component, I am dynamically generating Query and saving its value to the output variable namely DB2Qry. Now, In Data flow task, I am using this variable for source component.But it is not allowing me to do so with an Error "SSIS Error Code DTS_E_OLEDBERROR". In script component, I have made this variable as 'ReadWrite Variable.' Please suggest if I am missing something.
SQL's EvaluateAsExpression should be set to FALSE. You're not putting an expression into the variable, As you're assigning a static value through your script.
and you need to manually set a "default" value for your SQL variable in the Variables pane, otherwise the OLE DB Source has nothing to use for the SQL statement at design time

Getting the Rows Updated Count using stored procedures and Linq to SQL

I have a Linq to SQL data context class, where I am firing a stored procedure. I can trace through the generated code to where the stored procedure is being fired. I inspect System.Data.Linq.SqlClient.SqlProvider.ExecuteResult and can see that there is a private member called "value" which contains the number of rows updated. There does not appear to be any public accessor for that, and as well the result does not appear to be returned back to the data context anyhow. Is there some other way to access this value or do I have to return ##RowCount from every stored procedure (yuck) ?
Hmm. Admittedly this is a "best guess" as I haven't tried it out with a stored procedure, but is this what you are looking for:
... Do Updates ...
// if sdc is your DataContext
int changedRecords = sdc.GetChangeSet().Updates.Count();
sdc.SubmitChanges();
That's for Updated records and you can replace .Updates with .Inserts and .Deletes as necessary. As long as the stored procedure is part of the data context it should be tracked by the GetChangeSet().