Execute this pl/sql function with some proper example & syntax
--program is compiled but how to run this function with some proper example please please help me
CREATE OR REPLACE
FUNCTION EMP_GENDER(
EMP_GEN CHAR)
RETURN CHAR
IS
CUST_GEN CHAR(1) ;
DTECH1 EXCEPTION;
BEGIN
CUST_GEN :=UPPER(EMP_GEN);
IF CUST_GEN !='M' OR CUST_GEN != 'F' THEN
RAISE DTECH1;
ELSE
RETURN CUST_GEN;
END IF;
EXCEPTION
WHEN DTECH1 THEN
DBMS_OUTPUT.PUT_LINE('INVALID GEN');
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
Or in pl/sql;-
declare
v_gender char(1) default 'M';--change M to whatever test scenario
begin
v_gender:= emp_gender(v_gender);
dbms_output.put_line(v_gender);
end;And remember to set your serveroutput on.... though your errors will be obvious enough...
Similar Messages
-
Doubts in XI basics..help me with some practical examples
hi friends,
I am new to SAP XI have some basic doubts. Answer my questions with some practical examples.
1. what is meant by "Business System" and what is difference between client,customer,Business partner,3rd party
2.If a small company already using some systems like Oracle or peopleSoft,if it wants to use SAP products then what steps it has to follow.
3. SAP system means a SERVER?
4.SAPWebAs means a server software?
5.R/3 system comes under SAP system?
6.XI is also one of the SAP module..how it relates to other modules.
7.In one organization which is using SAP modules,each module will be load in separate servers?
8.PO(purchase order) means just looks like one HTML file..customer will fill the form and give it.like this,Combination of many files like this is one SAP module.Is it right assumption..?if so,then what is speciality SAP?
I have an theoretical knowledge about IR and ID and SLD.what are general business transactions happens in any business ?(like who will send cotation,PO) give some practical example for what actually happens in business?..who will do what?and what XI will do?Hi Murali,
<u><b> 1.Business System</b></u>
Business systems are logical systems that function as senders or receivers within the SAP Exchange Infrastructure(XI).
Before starting with any XI interface,the Business systems involved has to be configured in SLD(The SLD acts as the central information provider for all installed system components in your system landscape.)
business system and technical system in XI
<u><b>2.Third Party</b></u>
http://help.sap.com/saphelp_nw04/helpdata/en/09/6beb170d324216aaf1fe2feb8ed374/frameset.htm
eg.For the SAP system a Bank would be a third-party which would be involved in interfaces involving exchange of data(Bill Payment by customer).
<u><b>3.XI(Exchange Infrastructure)</b></u>
It enables you to connect systems from different vendors (non-SAP and SAP) in different versions and implemented in different programming languages (Java, ABAP, and so on) to each other.
Eg.If an interface involves Purchase Order sent from SAP system to the vendor(Non-SAP system)then,the vendor might expect a file.But the Data is in the IDOC(intermediate document) form with the SAP system.Here XI does the work of mapping the IDOC fields and the File fields and sends it to the vendor in the form of a file.
In short,always the scene is Sender-XI-Receiver.
The Sender and the Receiver depends upon the Business you are dealing with.
<u><b>4.Business Partner</b></u>
A person, organization, group of persons, or group of organizations in which a company has a business interest.
This can also be a person, organization or group within this company.
Examples:
Mrs. Lisa Miller
Maier Electricals Inc.
Purchasing department of Maier Electricals Inc.
<u><b>5.Client</b></u>
http://help.sap.com/saphelp_nw04/helpdata/en/6c/a74a3735a37273e10000009b38f839/frameset.htm
<u><b>6.SAP System</b></u>
http://help.sap.com/saphelp_nw04/helpdata/en/33/1f4f40c3fc0272e10000000a155106/frameset.htm
<u><b>7.SAP WebAS</b></u>
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=sapwebapplication+server&cat=sdn_all
As you are a beginner, I understand you musnt be aware of where to search what.
For all details search out in http://help.sap.com
And sdn(key in keyword in Search tab).
You will get list of forums,blogs,documentation answering all your queries. -
Using PL/SQL Function with CLOB types and a Java Source
Hi people.
I have some problems trying to use a function in pl/sql with a CLOB parameter to a java source function.
Here is the problem: I have to read a TXT file and return a CLOB with the data of the file. The reading is done with a java source function.
The problem is how to read the file without messing the content and return it to the pl/sql function?
Another problem: If I pass a CLOB as a parameter to a pl/sql function and have to write the content to a file, how to do it without screwing the EOL chars and so?
My code is:
/******** PLSQL FUNCTIONS ********/
function fn_gravaconteudoarquivo( pv_caminho in varchar2
, pv_nomearquivo in varchar2
, pc_conteudo in clob ) return varchar2 as language java
name 'Importacao.gravaConteudoArquivo(java.lang.String, java.lang.String, oracle.sql.CLOB) return varchar2';
function fn_lerconteudoarquivoclob( pv_caminho in varchar2
, pv_nomearquivo in varchar2 ) return clob as language java
name 'Importacao.lerArquivoClob(java.lang.String, java.lang.String) return clob';
/******** JAVA SOURCE FUNCTIONS *********/
public static String gravaConteudoArquivo(String caminho, String nomeArquivo, CLOB conteudo) {
File file = new File(caminho, nomeArquivo);
PrintWriter pwFile;
String mensagem = "";
StringBuffer sb = new StringBuffer();
try {
pwFile = new PrintWriter(new BufferedWriter(new FileWriter(file,true)));
for (int i=0;i<=(conteudo.length()/32000);i++) {
sb.append(conteudo.getSubString(conteudo.getLength()+1,32000));
pwFile.println(sb.substring(0));
pwFile.close();
} catch (Exception ex) {
mensagem = "Erro: "+ex;
return mensagem;
public static CLOB lerArquivoClob(String caminho, String nomeArquivo) throws SQLException {
File file = new File(caminho, nomeArquivo);
Connection conn;
CLOB clob = null;
String lineSep = System.getProperty("line.separator");
StringBuffer sb = new StringBuffer();
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:csdesv", "csestoque", "liberada");
clob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
BufferedReader brFile = new BufferedReader(new FileReader(file.getPath()));
while (brFile.ready()) {
sb.append(brFile.readLine());
sb.append(lineSep);
clob.open(CLOB.MODE_READWRITE);
clob.setString(clob.getLength()+1, sb.toString());
clob.close();
} catch (Exception ex) {
ex.printStackTrace();
return clob;
Ah, just remembered... This will work as a JOB.... >.< ... So the connection aparently is at localhost.
Thanks.No one? I really need this....
-
How to register PL/SQL function with Varchar2 argument in Discoverer
Hi,
I have registered a PL/SQL function in Discoverer Administrator 10.1.2.1. Function has two arguments with data type varchar2. In discoverer I've selected varchar as it doesn't have varchar2.
When i use this function in report using discoverer desktop it gives an error "One of the function argument has an incorrect datatype.
I would appreciate if somebody can help
Regards
BAHi,
First, do not wait to use it in order to check it.
In the discoverer admin you can "Validate" the function on after registering it.
there are couple of things you should know about registering the function:
1. the "Varchar" option you selected is correct (there is no varchar2 in the admin definition).
2. check the database function to verify that you indeed registered all its arguments and they match the names and types of the db function.
3. during the registration, type everything in UPPER CASE.
the other way to register the function (and you will not need to deal with the definition of it) is to search for the function in a list.
in order to do that, on the register function screen press the "Import" button (on the bottom right side of screen).
then search by the owner (db user / schema) that the function / package is registered.
Tamir -
Anyone help with this PL\SQL function
I have this function which goes through my table form and comapares the row to see if the attrubte super type has been set to confimed. If it has then it should add one to the current allocation and minus one from the slots left. But i have these errors (which are not very helpful)
1 error has occurred
ORA-06550: line 8, column 23: PL/SQL: ORA-00936: missing expression ORA-06550: line 5, column 11: PL/SQL: SQL Statement ignored
DECLARE
check_if_confirmed VARCHAR2 (50);
BEGIN
FOR c IN (SELECT proposal_id
FROM student_current_project
WHERE supervisor_id = :p1_supervisor_id
AND supervisor_type == 'Confirmed')
LOOP
check_if_confirmed := c.proposal_id;
IF check_if_confirmed IS NOT NULL
THEN
UPDATE supervisor
SET Current_Supervision_Allocation = (Current_Supervision_Allocation + 1),
Supervision_Slots_Left = (Supervision_Slots_Left - 1)
WHERE supervisor_id = :p1_supervisor_id;
END IF;
END LOOP;
END;
Can anyone spot the error as i cant see it.
Thanks DanHi Dan,
You have a double equals sign in your cursor's 'where' clause.
i.e. AND supervisor_type == 'Confirmed'
Cheers,
Rhodri -
Execute Stored Procedure SQL Statement with Parameter from Cell
I would like to know if there is a way to pass the parameters to SQL Statement of Power Query. For example, I have a SQL Statement as follows:
EXEC [dbo].[spReportBuilder]
@Report = N'Revenue Summary',
@Year = N'2014',
@Period = N'11'
I would like to know if it is possible to pass the @Report, @Year, @Period values from cells in the workbook, preferably without vba.
Thanksrtisserand,
Here is the M code:
let
IDValue = Excel.CurrentWorkbook(){[Name="YearTable"]}[Content],
Source = Sql.Database("localhost", "AdventureWorks2012", [Query="EXEC [dbo].[spReportBuilder] @Report = N'Revenue Summary', @Year = N'" & Number.ToText(IDValue[ID]{0}) & "', @Period = N'11'"])
in
Source
Some notes:
You have to reference the excel query from another step in the query or you will get the following error:
Formula.Firewall: Query <>something<> references other queries or steps and so may not directly access a data source. Please rebuild this data combination.
I only did the parameter for one value.
Hope this helps.
Reeves
Denver, CO -
I have "my story" app on multiple ipas at our school. It now appears as though the app will only function on a few of the ipads. Is this because itunes pulled the app from the store?
For any iPad exhibiting this, try a reset: Simultaneously hold down the Home and On buttons until the device shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the device back on using the On button. In some cases it also helps to double click the Home button and close all apps from the tray before doing the reset.
Is this the app? https://itunes.apple.com/us/app/my-story-story-creator-for/id449232368?mt=8. It appears to be available. -
Is this possible: SQL Dataload with generic rule file?
Hello,
when loading a flat file into Essbase, one can define in the header the data load field names. In the data load, the dimension names are given and at the end the Data. In the rule file under Options > Data source properties > Header a reference to this line could be made. This works fine.
We want to load data with SQL in the same way. One load rule with a substitution variable for the view selection and we can use it for all data loads. We have specified the dimension names in the table column header. The data column was defined as "data" - without quotes.
The result so far is, it will not load.
The question is - does somebody tried this before and can help me on this?
Thanks in advance.
Regards,
Philip Hulsebosch
www.trexco.nlthe data column can be repersented in multiple ways, the way I typically do it is to define it to the member it belongs to. In my example where your substitution variable &currmth is "Jan" then "Jan" would be the column name. Next month when the sub var changes to Feb, it is Feb.
-
COM DLL tester,My plan is to invoke our DLL COM server functions with some tool.
Hello All,
Sorry for the inconvenience,but according to this link,there is plenty of tools that are available to test
DLL COM server's functionality.
We would like to call/test our COM server's functionality.
http://zone.ni.com/devzone/cda/tut/p/id/2981
I would need this kind of tool.
Any help will be appreciated.
Thanks for in advance.
SzabolcsWhat is it you are trying to test exactly?
Is it a pure COM server or does it have an Active X interface?
ActiveX is using COM as its binary interface but defines an additional interface description standard, so that other languages than C(++) can access it. LabVIEW supports accessing ActiveX interfaces but can't access COM interfaces directly as it does not understand the C(++) headers nor any possible IDL file, and that would be very hard anyhow.
If what you want to test is the actual COM interface of your server itself then I would recommend to really write a test framework in C++ as that is the best way to go about that. If it is some functionality in the COM server you have two options if you insist in using LabVIEW. You can add the necessary ActiveX definitions to your COM server and register them in your system so you can use the LabVIEW ActiveX nodes to access your server objects and their methods and properties. In that way you can create your LabVIEW VI library to do what you want.
Another less common method would be to create a sort wrapper DLL in C(++) that accesses your COM server directly and exports according standard C functions that you can invoke in LabVIEW through the Call Library Node.
Message Edited by rolfk on 03-17-2010 12:59 PM
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Sql functions with SQL*loader
For the testing purpose I created table
SQL> desc test
Name Null? Type
C1 VARCHAR2(20)
A file test.txt contains only one record:
12/13/2007-09/15/2008
control file contains:
load data
infile 'c:\grum\test\test.txt' "str '|'"
insert into table test
(c1 "substr(:c1,1,10)" )
After performing Load
SQL> select * from test;
C1
1
I am unable to understand the value in the table should be:12/13/2007
Can anybody help me pleaseTry:
(c1 position(1:10) ) -
Call pl-sql function with parameters All
I want to call a procedure inside Discoverer; i know how to do that. I have three page elements ; when i choose specific value for each one my function work properly.
When i choose <All> like a value for any page element ; funtion doesn't run properly. We decide to display the input value when i call function; when i choose <All> value i can't see the value of the parameter. I put nvl(P1,'ABC') and i can't see the value of the parameter.
In Discovere; when we choose <All> value what is the real value or character used to call function.
Thanks
Marcsee my function
FUNCTION "F_SSDW_TEMPS_NET_FONCT_MIN"("P_NO_CENTRE_DISTR" IN NUMBER,
"P_ID_QUART_TRAVAIL" IN NUMBER,
"P_CODE_EQUIPEMENT" IN VARCHAR2 ,
"P_DATE_TRANSACTION" IN DATE ) RETURN VARCHAR2 IS
CURSOR CRS_TEMPS_NET_FONCT_MIN IS
SELECT SUM(NVL(EFF_REMPL.TEMPS_NET_FONCT_MIN,0))
FROM SSDW_EFF_REMPL EFF_REMPL,
SSDW_EFF_REMPL_QUART_TRAVAIL EFF_QUART
WHERE EFF_REMPL.NO_CENTRE_DISTRIBUTION = P_NO_CENTRE_DISTR
and EFF_REMPL.id_quart_travail = EFF_QUART.ID_QUART_TRAVAIL_CENTRE_DISTR
and EFF_QUART.quart_travail = P_ID_QUART_TRAVAIL
AND EFF_REMPL.CODE_EQUIPEMENT = decode(UPPER(P_CODE_EQUIPEMENT),'TOUS',EFF_REMPL.CODE_EQUIPEMENT, P_CODE_EQUIPEMENT )
AND TRUNC(EFF_REMPL.DATE_TRANSACTION) = TRUNC(P_DATE_TRANSACTION);
V_TEMPS_NET_FONCT_MIN NUMBER;
BEGIN
OPEN CRS_TEMPS_NET_FONCT_MIN;
FETCH CRS_TEMPS_NET_FONCT_MIN INTO V_TEMPS_NET_FONCT_MIN;
CLOSE CRS_TEMPS_NET_FONCT_MIN;
RETURN ('ZZ'||to_char(P_CODE_EQUIPEMENT||'ZZ');
END;
I know how to use a function inside discoverer; my question is ; for my four input parameters ( each one correspond to a page-element )
My question is ; if i decide to choose to select the value <All> for equipement code; what will be the real value passed in parameter to my function.
Like you can see in my code ; i decide to return the parameter in value.
When i select <All> the output parameter equal nothing ; i see absoltely nothing in screen ; i don't see 'ZZ'
Thanks
Marc -
Ios6 "open in" function with some audios not working
In ios5.1.1 I could download a midi file with download all and then open in nanostudio and save it to nanostudio library, but with iOS 6.0.1 the midi does not get copied across to nanostudio any more ( nanostudio opens but the midi file can't be seen ).
Is there a fix for that or did apple somehow skip that feature in the new iOS?Hi Gerd,
I looked again at the WIKI link I posted earlier. My last post re syntax was not correct.
I think the correct syntax in your case should be:
...../webgui?~transaction=*CRMD_BUS2000126&20GV_OBJECT_ID=0000195123
The only difference from your original URL is the "*" in front of the transaction name.
("&20" is the blank space between transaction and input field value)
Regards,
Oisin -
Please help with some basic javascript syntax
Can anyone please help me with a "remove from favourites"
facility i'm working on.
I query to get all the favouites, then i output those
favourites down the page
each favourite has a "remove from favourites" link - i want
to make it so when a user clicks this link they get a javascript
confirm box pop up saying "are you sure you want to remove
#favourites name# from your favourites?"
so i have..
function remove(profile,name) {
if (confirm("Are you sure you want to remove #name# from
your favourites?")) {
window.location =
"remove_from_favourites.cfm?deleteFavID=#profile#&removedName=#name#"
and
<div
onClick="remove(#rs_favs.favouriteeID#,#rs_favs.firstName#)"
>Remove from favourites</div>
but it doesn't work - i think there are 2 problems..
problem 1 - i have used the CF # in the remove function as i
don't know what one does in javascript to "output" a variable (see
where it says "Are you sure you want to remove #name# from your
favourites") what should i use in place of the "#"?
problem 2 - i have tried to pass to variables to the function
>>
onClick="remove(#rs_favs.favouriteeID#,#rs_favs.firstName#)" and i
have separated them but a commer "," but i suspect that is
incorrect syntax
if anyone could please help me i'd be very grateful as, to be
honest, i love coldfusion - but javascript just hurts my head! :(
thanks very much indeed.
PS the way i've wrapped my "remove from favourites" text in a
div rather than making it an actual "a href" link - is that right
or is there a better way (ideally i'd like the text to look like
all my other links (ie they underline on mouse over)You can simply add CSS commands to define your div to look
like your links.
div#FavLink
color: blue;
text-decoration: underline;
cursor: pointer;
<div id="FavLink"
onClick="remove(#rs_favs.favouriteeID#,'#rs_favs.firstName#')"
Remove
from favourites</div>
That should get you started.
happysailingdude wrote:
> thanks CFDEBUG that sorted it - thanks very much
>
> just one last thing - more of a CSS issue i think but
maybe not.
>
> so now I have <div
>
onClick="remove(#rs_favs.favouriteeID#,'#rs_favs.firstName#')"
>Remove from
> favourites</div>
>
> which of course isnt a link so it just looks like my
standard text (as if i'd
> done <p>Remove from favourites</p>
>
> how do i make the "Remove from favourites" text look
like a link as if i'd
> done <a href="remove_from_favourites.cfm?....."
>Remove from favourites</a>
>
> i think ive seen links that when you hover over them it
says "javascript:void"
> or something at the bottom of the browser - is this the
answer and if so what
> is the correct syntax please? or do i need to do
something with my CSS file?
>
> thanks very much indeed for any further help anyone can
give me to get this
> page finshed off - thank you
> -
Executing if condition in a sql prompt with in a shell script
Hi all,
i need to write a shell script where i need to execute a sql statement. if the count from the above sql is greater than certain value i need to execute a another sql statement.After some time i need to check the count again using above sql and if the count is less than certain value i need to execute a different sql statement. One more time i need to check the count and then i need to get an email.
Could anyone help me in completing this script
Thanks,Could anyone help me in completing this scriptNot really because "shell script" is OS & Shell dependent & you decided to NOT share these details with us.
Just write a PL/SQL procedure & then you have an OS independent solution! -
How to execute SQL scripts with MaxDB ..?
Hi all,
i got some clue from another thread and i observed the command is like
sqlcli -d DBNAME -u SQLUSER,SQLPASS -i filename.sql -c <delimiter> is there,
when i use this the only first query is successfully executing,
this might be problem with delimiter.
can any body help how to use delimiter in the script file with an example.
thanks in advance.
--HariHi,
Sample Script
CREATE TABLE city
(zip CHAR (5) KEY CONSTRAINT zip BETWEEN '10000' AND '99999',
name CHAR(20) NOT NULL,
state CHAR(2) NOT NULL)
CREATE TABLE customer
(cno FIXED (4) KEY CONSTRAINT cno BETWEEN 1 AND 9999,
title CHAR (7) CONSTRAINT title IN ('Mr', 'Mrs', 'Company'),
firstname CHAR (10) ,
name CHAR (10) NOT NULL,
zip CHAR (5) CONSTRAINT zip BETWEEN '10000' AND '99999',
address CHAR (25) NOT NULL,
FOREIGN KEY (zip) REFERENCES city ON DELETE RESTRICT)
\dt customer
COMMIT
Regards
Ayyapparaj
Maybe you are looking for
-
Hello, My database contains invoices due in october 2010. When I run the aging report, the amount of the invoice is not in column 0-30 but in column 120+ When I run the dunning wizard, these invoice are not included. i tried to look all the parameter
-
I've only been using Premiere for a single project as my university specified we should use it, I'm not used to such a complex programme, or even video editing to be honest, so bear with me. (I'm following that guide on what information to add to que
-
How to check via report if a graphic exist in SE78.
How? Thanks for answers.
-
Intermediate Attributes in Test Script Specifications
It is great that we can now view the specification of a test script (i.e. input values and expected outcome values for each case) to accompany the test script report, which shows the success or failure of each outcome and case. Thanks Oracle! The spe
-
I seem to only have sound on my iPad 2 via headphones. I have tried turning it off completely (attached and detached to my charger); I've checked all volume options, including the mute switch, but to no avail. The only thing I have not yet tried is h