calling function or procedure within same package - sql

Can I call a function or procedure by using package name, if they are defined in the same package?

May be this will be helpful for you.
http://docs.oracle.com/cd/B10501_01/appdev.920/a96590/adg10pck.htm

Yes You can call it using procedure name, for your help see the link
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7452431376537

Related

Catching OUT parameter value of a bigquery Procedure from composer

I am calling a bigquery procedure using BigQueryInsertJob operator using "declare out_var String; call bq_sp("input params", out_var)". This is getting called properly and executing the stored procedure properly also. But what I need to do along with that, is to print the value of out_var to the composer log, to catch the value of out_var, so that I can do some more things depending on the value of that variable. Could you please help me, how can I catch the value of the OUT parameter value from the cloud composer. Thank you.
I have a stored procedure with input and output parameters. and calling that from composer.
This is working absolutely fine.
I am expecting to fetch the OUT parameter value in the cloud composer job

Dynamic Procedure BigQuery

Does Bigquery support dynamic procedure calls? I am looking to generate a procedure name as string based on variables and call the string.
EXECUTE IMMEDIATE returns this error clearly it doesn't support CALL. Is there any other way?
SQL created by EXECUTE IMMEDIATE contains unsupported statement type: CallStatement.
Thank you.
I make this answer for visibility, the approach you can use is as follow (as mention in the comments by mikhail):
CREATE OR REPLACE PROCEDURE `project-id.dataset`.maker(option INT64)
BEGIN
IF option=1 THEN
CALL `project-id.dataset`.create_user(); #call to procedure
ELSEIF option=2 THEN
CALL `project-id.dataset`.create_customer(); #call to procedure
ELSE
SELECT "END"; #default
END IF;
END
to use
CALL `project-id.dataset`.maker(2)
As stated in the comments, execute immediate do not support at the moment the usage of call.
I also found a feature request about supporting using call with execute immediate on google issue tracker you can leave a comment to support the feature request.

Ada: package linking error

I have a problem with my project.
The issue problem with linking a package and visibility of the tasks.
in bufor1.ads
package bufor1 is
task type Bufor is
entry Przyjmij(Wyrob: in Typ_Wyrobow; Numer: in Integer);
entry Wydaj(Zestaw: in Typ_Zestawow; Numer: out Integer);
end Bufor;
end bufor1;
in another ads file I want to call Wydaj function like that:
with bufor1; use bufor1;
...
bufor1.Bufor.Wydaj(Rodzaj_Zestawu, Numer_Zestawu);
which causes the error:
invalid use of subtype mark in expression or call
I'm new user of ADA. Thank in advance for your time.
Greetings.
You are trying to make calls to a task type, not a task object.
Either make it a task object (of an anonymous task type):
task Bufor is
or create a task object:
foo : bufor1.Bufor;
...
foo.Wydaj(Rodzaj_Zestawu, Numer_Zestawu);

How to find dbcreatestruct method in mule esb3.8.4 jar file?

Recently i want to use UDT while inserting data into db through procedure call.Now UDT is supported in Mule ESB 3.8.4 version.They have given some example in MULE-11138 jira task.But when i am using MEL function defined in above task.I am getting
java.lang.AbstractMethodError: org.enhydra.jdbc.standard.StandardXAConnectionHandle.createStruct(Ljava/lang/String;[Ljava/lang/Object;)Ljava/sql/Struct;
Can any one help me on this?
Thanks.
Finally i am able to resolve this error all i need to do is to use type defined in db directly for creation of array or struct like.
dbCreateArray('Oracle_Configuration', 'APPS.CONTACT_INFO_ASYNC_TAB_TYPE', payload);
Thanks,
Anurag
#Anurag
This is available only in enterprise edition.

Way to access a REST Service via a SQL Server stored procedure?

We are looking for a way to call a REST service from a SQL Server 2008 & newer stored procedure. We do not need to get any information from this service. We just need to force the call to run in the middle of a stored procedure.
I have found some 3rd party options or CLR; but I refuse to think there isn't an easier way since we just need to fire a call and don't need anything in return.
Hopefully someone can shed some light. Thanks!
You could make a SQL Agent job to run a PowerShell script, then run the job via msdb.dbo.sp_start_job. That way you wouldn't need any external scripts or utilites, nor any SQL-CLR.
Your job step would be something like:
$request = [System.Net.WebRequest]::Create('http://stackoverflow.com/')
$result = $request.GetResponse()
I can think at least of 2 ways of doing that:
1) Probably prefered way:
Make a C# dll and call its function from the store procedure example:
How to call C# function in stored procedure
2) Call the rest service with the help of CURL utility.
DECLARE #PassedVariable VARCHAR(100)
DECLARE #CMDSQL VARCHAR(1000)
SET #PassedVariable = 'SqlAuthority.com'
SET #CMDSQL = 'c:findword.bat' + #PassedVariable
EXEC master..xp_CMDShell #CMDSQL
have the call to the ws inside the bat file