Problem in the External Function returned data RAW
Hi,
I have a problem, I would want to create an external function in Oracle 10g, than given in input a data RAW it gives back in output the value in format raw.
I have realized such function through language C.
these are the prototypes of the function
ORACLE side:
CREATE OR REPLACE FUNCTION F_RETURN_RAW (inputText IN RAW)
RETURN RAW -- I do not know to return RAW !!!
AS LANGUAGE C
NAME "f_Return_Raw"
LIBRARY C_Library_DAN
PARAMETERS
(inputText RAW,
inputText INDICATOR,
inputText LENGTH);
C side:
???? f_Return_Raw(CK_BYTE_PTR in_Text,
short *in_TextInd,
int *in_TextLen)
I do not know what to put in place of ????
someone can help me with some example?
thanks to all!
Regards
Daniele
Hello I had already seen the package UTL_RAW,
in particular is CAST_TO_VARCHAR2 that CAST_TO_RAW,
but these me are useful Oracle side,
my problem are to give back to Oracle, from side C, one RAW.
Perhaps it is not possible to give back a RAW directly?
or I have more probably not understood your suggestion!
I would want to create a function that he concurred me to make that
insert into table_example values(f_Return_Raw(RAW_INPUT))
that the function gives back RAW directly
Regards
Daniele
Similar Messages
-
Problem with the round function using Date
Hi,
I have a problem with round function for Date. The input is the four digit year which was picked out from say SYSDATE.
In these scenarios the original value should be rounded up and should get the output as shown under rounded column.
Scenario1
Original Rounded
2020 ---> 2020
2021 ---> 2020
2022 ---> 2020
2023 ---> 2020
2024 ---> 2020
2025 ---> 2025
2026 ---> 2025
Scenario2
Original Rounded
2020 ---> 2020
2021 ---> 2025
2022 ---> 2025
2023 ---> 2025
2024 ---> 2025
2025 ---> 2030
2026 ---> 2030
Scenario3
Original Rounded
2020 ---> 2020
2021 ---> 2020
2022 ---> 2020
2023 ---> 2025
2024 ---> 2025
2025 ---> 2025
2026 ---> 2025
Can anyone help with this....Urgent Please
Thanx for your time1.
SQL> select n,n-mod(n,5) rnd from test;
N RND
2020 2020
2021 2020
2022 2020
2023 2020
2024 2020
2025 2025
2026 2025
2.
SQL> select n,n+(case when mod(n,10) = 0 then 0
2 when mod(n,10) < 5 then 5-mod(n,5)
3 else 10-mod(n,10)
4 end) rnd
5 from test;
N RND
2020 2020
2021 2025
2022 2025
2023 2025
2024 2025
2025 2030
2026 2030
7 rows selected.
3.
SQL> select n,n+(case when mod(n,10) < 3 then mod(n,10)*-1
2 when mod(n,10) < 8 then 5-mod(n,10)
3 else 10-mod(n,10)
4 end) rnd
5 from test;
N RND
2020 2020
2021 2020
2022 2020
2023 2025
2024 2025
2025 2025
2026 2025
2027 2025
2028 2030
2029 2030
2030 2030
11 rows selected. -
My early 2011 MBP laptop (OS Yosemite 10.2.2) recently started logging itself out. I narrowed the problem to the external monitor which is connected with a Thunderbolt adapter. I installed Thunderbolt firmware update 1.2, that did not correct the problem. When I disconnect the external monitor, the problem went away. Is there something I can do to be able to use the external monitor again?
Try Function F1
-
The scroll function on my mousepad is disabled when viewing a pdf file in firefox version 5.0. The scroll works on the pdf, but not on the other tabs. When the pdf is closed, the scroll function returns to normal. Any ideas?!
Hey thanx for the help, it worked like a charm.
I think firefox changed the application lay out, as I used to be able to choose my PDF opener from the list at " Adobe Acrobat Forms Document' where I could choose Nitro-PDF reader, but it has now moved all the way to the bottom like you suggested to the obvious place of "Portable Document Format" section.
If someone didn't tell me , I wouldn't have scrolled all the way down to be able to find it... it really should be with all its cousins up the top...
Cheers again.. -
I 've a problem with the print function of Itunes
helo , i 've a problem with the print function of Itunes.
When i'm trying to create a pdf file of my entire library, i've got a partial file of it.
instead of the entire library (37000 songs - 209GByte) the pdf file contains only 18000 songs (1GB - pdf file).
Is there any problem with the pdf creation in Itunes ?
best regards
Marco
i mac 20" Mac OS X (10.4.9)Please read https://forums.adobe.com/thread/1499014
-try some steps such as changing browsers and turning off your firewall
-also flush your browser cache so you are starting with a fresh browser
http://myleniumerrors.com/installation-and-licensing-problems/creative-cloud-error-codes-w ip/
http://helpx.adobe.com/creative-cloud/kb/failed-install-creative-cloud-desktop.html
or
A chat session where an agent may remotely look inside your computer may help
Creative Cloud chat support (all Creative Cloud customer service issues)
http://helpx.adobe.com/x-productkb/global/service-ccm.html -
I have a problem with the external sound of my iPod, when I take the headphones the music keeps playing and the ipod recognizes still have a headset connected. how do I get external sound out?
- Try insering and removing the headphone plug a dozen times or so.
- Try cleaning out the headphone jack in the iPod.
- Resett he iPod. Nothing is lost
Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- Restore from backup
- Restoe to factory defaults/new iPod
If yu still have the problem that indicates a hardware problem, likely a bad headphone jack. Yu can make an appointment at the Genius Bar of an Apple store to confirm.
If not underwarranty Apple will only exchange your iPod for a refurbished one for:
Apple - Support - iPod - Repair pricing
A third-party place like the following is less expensive. Here is one. Google for more.
iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens -
Why does the InitVXIlibrary function return -32768 ?
Why does the InitVXIlibrary function return -32768 ?
Hello,
It would be extremely helpful to see a log of what is happening "behind the scenes" with the driver. To do this, you can use a utility called NI-Spy which can be launched from Start >> Programs >> National Instruments >> NI Spy or from the Measurement & Automation Explorer (MAX) utility.
NI Spy is a Win32 application that monitors, records, and displays National Instruments API calls made by applications. Use NI Spy to quickly locate and analyze any erroneous National Instruments API calls that your application makes, and to verify that the communication with your instrument is correct.
You can turn the log to file feature on via the Spy >> Options menu in the program. Please attach this log file to this Developer Zone post
so that we may further help you.
Best Regards,
Justin Britten
Applications Engineer
National Instruments -
Problems trying to SUM after returning date on first row in all rows
Hi,
I'm having problems with a calculation in a table report.
We've built a Discoverer report that looks at long term absence of an employee. The long-term absence period must be worked out based on a 2-year rolling period from the start date of the employee's most recent sickness. For example, if i'm off sick and have been since 01-Mar-2009 the report will look at all absences i've had since 01-Mar-2007 and sum the days.
I have built a calculation that always returns the latest absence start date for every row of absence a person has had. This has been achieved by using a LEAD Function and ROW_NUMBER, see below:
LEAD(Absence Start Date,ROW_NUMBER() OVER(PARTITION BY Employee Number ORDER BY Absence Start Date DESC)-1) OVER(PARTITION BY Employee Number ORDER BY Absence Start Date DESC)
The problem I have is that I cannot SUM the Absence Days of the person and bring in one row per person in the report. I think the cause is the use of the ROW_NUMBER. It ends up returning a Row for every absence the person has had.
Is there any way I can achieve returning the latest absence start date of a person against all absence rows (in order to use a condition to restrict the report to all absences that started after 2 years prior to that date) that they've had and sum up the absence days so that only one row per person is returned? I cannot use row generators and cannot register PL/SQL functions. I would need to get IT to help me which is min 3 month turnaround, so I'm trying to resolve this quickly.
Hope you can help.
Many Thanks,
LloydHi Michael,
Thanks a lot for this. The calculation you provided fixes the issue. However, The partition part of it seems to cause another.
In order to calculate total absence days the following calculation is used:
SUM(CASE WHEN NVL2("Absence (Employee) - Historic"."Date End",( CASE WHEN Absence Finish >= Absence Start THEN "Absence (Employee) - Historic".Absence Days END ),CASE WHEN "Absence (Employee) - Historic".Date Start < Period Start Date THEN WORKING_DAYS_BETWEEN(Period Start Date,Absence Finish) WHEN Absence Finish >= Absence Start THEN WORKING_DAYS_BETWEEN(Absence Start,Absence Finish) END) = 0 THEN DAYS_BETWEEN(Absence Start,Absence Finish) ELSE NVL2("Absence (Employee) - Historic"."Date End",( CASE WHEN Absence Finish >= Absence Start THEN "Absence (Employee) - Historic".Absence Days END ),CASE WHEN Absence Finish >= Absence Start THEN WORKING_DAYS_BETWEEN(Absence Start,Absence Finish) END) END) OVER(PARTITION BY "Person Assignment Information (Person) - Historic".Employee Number ORDER BY "Person Assignment Information (Person) - Historic".Employee Number )
Here is a little Key:
Absence Start
GREATEST("Absence (Employee) - Historic".Date Start,ADD_MONTHS(TRUNC(SYSDATE),-24))
Absence Finish
LEAST(NVL("Absence (Employee) - Historic".Date End,TRUNC(SYSDATE)),TRUNC(SYSDATE))
Period Start Date
ADD_MONTHS(MAX("Absence (Employee) - Historic".Date Start) OVER(PARTITION BY "Absence (Employee) - Historic".Employee Number ORDER BY "Absence (Employee) - Historic".Date Start DESC ),-24)
The item Absence Days is the number of days input against the absence by the user. This is only correct for end-dated absences. For people who have open-ended absence or those whose absence start before the period start date (Michael's date) we must work the days out. A function called WORKING_DAYS_BETWEEN achieves this. There is also another function called DAYS_BETWEEN which is all days between two days (weekends included).
The item Date Start is the absence Start Date, Date End is the Absence End date.
The whole lot is then summed by Employee number partition.
The report has lots of indicators that using mathemical equations based ont Total Absence Days. In order to use Total Absence Days in another mathematical calc I have to create a duplicate calculation except without the partition (Total_Absence_Days in this case). If don't and simply insert the name of the calc into another calculation I get this error when running the report.
Image: !http://www.aerographicsuk.com/Invalid%20Identifier.jpg!
When creating another mathematical calc I then have to do the Sum partition around it. This makes the report run really slow because i'm typing lots of large formulae every time i build a calc that refers to Total Absence Days.
Is there a way I can create the total absence days calculation with out causing this error? I have thought about breaking it up into several calculations but am wondering if i'll get the same error message.
Below is an example of a calculation that tries to use Total Absence Days:
GREATEST("Full Pay Entitlement (Days)"-SUM(Total_Absence_Days) OVER(PARTITION BY "Absence (Employee) - Historic".Employee Number ORDER BY "Absence (Employee) - Historic".Employee Number ),0)
Kranthi, I can only paste in the Oracle SQL, which isn't real SQL. There are lots of other calcs though, so they'll probably be a lot there. Please let me know if you'd like to see it.
Many Thanks for your help with this,
Lloyd -
The ways to return data from a stored procedure.
Hi, I know there are three ways to pass out a value from a Microsoft SQL stored procedure, but I have no clear idea what Oracle SP can do, I know Oracle doesn't support multi-recordset(v8), can not return a recordset by a inner select query, but I do know there is a cursor object, which doesn't like its counterpart in Microsoft SQL server, is a choice under most situation. Here I wonder anyone who is good at Oracle can give a list of all ways to return data from a SP, including example is more better, thanks.
Here is a way to get return a record from a function and a procedure. You need to be familiar with Oracle packages as well as stored procedures and functions:
CREATE OR REPLACE PACKAGE EmpPkg AS
cursor cEmp(pEmpno in number) is
select empno, ename, job, hiredate, sal
from emp
where empno = pEmpno;
FUNCTION GetEmployee(pnEmpNo in number) RETURN cEmp%rowtype;
PROCEDURE GetEmployee(pnEmpNo in number, prEmp out cEmp%rowtype);
END;
CREATE OR REPLACE PACKAGE BODY EmpPkg AS
FUNCTION GetEmployee(pnEmpNo in number) RETURN cEmp%rowtype IS
rEmp cEmp%rowtype;
BEGIN
open cEmp(pnEmpNo);
fetch cEmp into rEmp;
close cEmp;
return rEmp;
END;
PROCEDURE GetEmployee(pnEmpNo in number, prEmp out cEmp%rowtype) IS
BEGIN
open cEmp(pnEmpNo);
fetch cEmp into prEmp;
close cEmp;
END;
END;
Here's how you use the package:
DECLARE
rEmp EmpPkg.cEmp%rowtype;
BEGIN
rEmp := EmpPkg.GetEmployee(7782);
dbms_output.put_line(rEmp.ename);
EmpPkg.GetEmployee(7902, rEmp);
dbms_output.put_line(rEmp.ename);
END;
Note that you can return any Oracle data type from a function. Likewise, you can specify any Oracle data type as an out parameter in a procedure. Also, you can make a parameter both an in and an out datatype like this:
PROCEDURE GetEmployee(pnEmpNo in out number);
I hope this puts you in the right direction.
null -
ODBC problem caused by SQLGetInfoW function's data type abnormally output
Background:We have designde a set of ODBC(Unicode) driver.We use Access2013x64 for data import operation according to the ODBC driver, which is called the
SQLGetInfoW function.Because of the third parameter in SQLGetinfoW function outputing 8 bytes data in error,Access abnormally stop.While using Access2010x64,the same operation, the SQLGetInfoW funtion has also output 8 bytes of data and Access is normally
end.
Questions:
We want to know for the operation of the third parameter'outputing data of SQLGetinfoW funtion,is there a difference between Access2013 and Access2010 ? And what
is the specific difference?
In addition, we also want to know the development on the ODBC what kind of standards should we followed? In other words,in the SQLGetInfoW function, the second
parameter InfoType and the third parameter InfoValuePtr existence of the corresponding relationship in theory.
We saw about the second parameter InfoType and the third parameter InfoValuePtr with the definition and the range of instructions in MSDN ODBC API Reference.
We want to know the relation about the value of InfoType and the third parameter InfoValuePtr should return data's type.
The function SQLGetInfoW statement as follows:
SQLRETURN SQLGetInfoW(
SQLHDBC ConnectionHandle,
SQLUSMALLINT InfoType,
SQLPOINTER InfoValuePtr,
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLengthPtr);
looking forward to your answer...I think this is a very difficult question, but I really need to know the answer.I hope someone can help me.
-
New ABAP editor: problems with the paste function
Hi all,
for a few weeks, I am working with the new frontend editor now. It is great - however, there is a thing I don't understand using the paste function. Let's make an example:
i put the following lines into clipboard by highlighting the entire lines and pressing CTRL+C
select * from ztmk
where kunnr in s_kunnr.
after pasting (CTRL+C) it shows up like this:
select * from ztmk
where kunnr in s_kunnr.
Is it a bug or a feature?
Jörg Krause, GEZE GmbH, GermanyHi Rich,
sorry, I actually upgraded my GUI to 23, but the problem is not solved. Look at this code:
SELECT * FROM ztmk INTO TABLE lt_ztmk
WHERE messe IN s_messe AND
kunnr_berater IN s_kunnr AND
status IN s_statu AND
ersda IN s_ersda AND
NOT namecpl = space AND
country IN s_count AND
kontaktid IN s_kntid AND
lvorm in s_lvorm.
SELECT * FROM ztmk INTO TABLE lt_ztmk
WHERE messe IN s_messe AND
kunnr_berater IN s_kunnr AND
status IN s_statu AND
ersda IN s_ersda AND
NOT namecpl = space AND
COUNTRY IN s_count AND
kontaktid IN s_kntid AND
lvorm IN s_lvorm.
the lower select-statement has been pasted from the upper one
Thanks for answering!
Jörg -
Some problems with the count function
Hi Guys,
I am trying to return following:
2009 GUESTS NIGHTS between 1 and 5 = 80 guests
2009 GIESTS NIGHTS between 5 and 10 = 100 guest
Whe I use the combine with a similar report option (union), I issue the following query:
SELECT saw_0 saw_0, saw_1 saw_1, saw_2 saw_2, saw_3 saw_3 FROM ((SELECT Resort.Resort saw_0, Time."Year" saw_1, "Non Revenue Facts".Nights saw_2, count(Guests."Guest Name") saw_3 FROM GUEST WHERE "Non Revenue Facts".Nights BETWEEN 1 AND 5 GROUP BY saw_1, saw_2, saw_0) UNION (SELECT Resort.Resort saw_0, Time."Year" saw_1, "Non Revenue Facts".Nights saw_2, count(Guests."Guest Name") saw_3 FROM GUEST WHERE "Non Revenue Facts".Nights BETWEEN 1 AND 5)) t1 GROUP BY saw_1, saw_2, saw_0 , saw_3 ORDER BY saw_0
The query return just the results for nights between 1 and 5.
I need two columns showing the count of the guests with nights till 5 and one other column showing the count of the guests with nights from 5 to 10.
Any help would be really appreciated.
Regards
GiulianoSorry I did not get this.
I should still use the union statement and than build the below function in the nights fields?
What I am trying to achieve is simply how many guests do i have with at least 1 night and max 5 nights
and how many guests i have with at least 5 nights and a max of 10 nights.
I should have 2 columns:
1 label Nights between 1 and 5
2 label Nights beween 5 and 10
the count(guests) column should than show how many guests in the first range and how many in the second.
Regards
G. -
No problem with the PAT FUNCTION
:biggthumbsup:Hi everybody
Someone said that the PAT option is disabled when the FSB of the cpu exceeds the 210 Mhz. This is not true.!!!!
I purchased my MSI 875 NEO FISR2 2 DAY AGO, and when launching the benchmarks with Sandra 2004 pro sp1, the PAT OPTION was disabled!!!
I never use overclocking because i want my PC to be stable because the applications that i use are very demanding( VIDEO EDITING, HUGE FILES ETC)
Before returning the mainboard back to the shop i purchaced it, i set the option Seargent[/COLOR] in bios section, and the bus comes automatically to 206 Mhz. Or you can do it directly from the bios by selecting the specified option about loading the turbo function
After that, i noticed in windows, that the temperature is stable at a very low level, and the most important thing is that, PAT is now enabled. the memory's voltage is 2.6v and the AGP'S voltage if i remember well about 0.05 v higher. No crashes everything seems to be ok
I hope my advice to be usefull to everyone that needs to know about that
BYE!!!For some reason PAT on the MSI motherboards switches off after 218FSB, anywhere else (ASUS,ABIT), PAT stays on all the way up... so why did MSI choose to turn PAT off at this FSB........Some say that PAT is only effective to this FSB after this the benefits disapear, i'm not so sure..... h'mmmmm.
-
Problem with the "Wait" function in dialing a number with an extension.
I inserted a "wait" into phone number, followed by an extension. When I tap the number, it dials the call. Next to the "End" button, there is a button that shows "Dial..." and the extension. HOWEVER, the next calls for other numbers will always show the same "Dial..." and the extension until IOS restart. Any solution?
Hello,
Plese see below the correct syntax for the SUM function
The following examples are applicable to both Basic and Crystal syntax:
Sum({file.QTY})
Calculates the sum of all values in the QTY field.
Sum({orders.AMOUNT}, {orders.CUSTOMER ID})
Sums (totals) the orders in each group of orders in the Amount field. The orders are separated into groups whenever the value in the Customer ID field changes.
Sum({orders.AMOUNT}, {orders.DATE}, "monthly") % Sum({orders.AMOUNT })
Groups values in the Amount field by month, and calculates the sum of the values for each month group as a percentage of the sum of the values for the entire report.
Sum([{file.AMOUNT}, {file.PRICE}, {file.COST}])
Sum of values in the Amount, Price, and Cost fields. -
WLC (Foreign-Anchor), problem with the external web auth -- ISE
hello guys
I am currently designing a platform for a guest network, which must be isolated from the local network, the following equipment:
ISE 1.2 (Cisco SNS- 3415-K9)
WLC 7.0.230.0 (Cisco controller 5508)---> wlc Foreign
WLC 7.0.230.0 (Cisco controller 5508)---> wlc Anchor.
The EoIP tunnel between wlc is performed successfully.
The wireless client gets IP address of the anchor wlc (DHCP server).
Test 1:
I configure the WLC ANCHOR with local web authentication (internal), the wireless client is authenticated by WLC and navigate successfully.
Test 2:
Configure the WLC to anchor external web authentication (ISE). configure a user in ISE guest portal.
The wireless client gets IP address of the anchor wlc (DHCP server), attempting to navigate not display the guest portal.
Debug a wireless client trying to connect to the guest network is attached.Thanks for your help Scott...
Now I presents another problem with the guest portal page. The wireless client obtains IP address and managed to reach the guest portal page, then enter the username and password page tells me it was successful. When I try to browse again brings me to the portal visitor page and asks me to enter user name and password.
test 1:
the username and password created for away was verified.
Scoot will have some implementation details with the same scenario I am developing? I think I'm missing some details in the ISE does not allow me to navigate the entrance for visitors to be successful.
Maybe you are looking for
-
Which recovery dvd to get for my HP 2000 laptop with Windows 8
Hello again. I recently posted re: an HP 2000 laptop that is really bad off. It appears to be full of viruses, and is missing so much that I cannot even do a refresh. If I try it states unable to complete, etc. as files missing. Also, the progra
-
Open/read a txt file on the client side in a Form server architecture
We are moving our software from client-server to Web architecture but we have problems with all the forms that use GET_FILE_NAME and TEXT_IO built-in functions. This commands, in fact, work on the application-server side and not on the client (browse
-
Why wrong dates in Mail and how to fix it?
The strangest thing happened when we started up a new MacBook Air and made new accounts in Mail. IMAP-accounts that already was in use on the older MacBook. When we got the accounts up and running, all mails in the inbox list had been updated to 2014
-
TS3676 Why does MacBookPro screen stay grey while gear disc keeps spinning endlessly?
MacBook Pro would not shut down using the shut down mode. Had to do it manually. When I tried to boot it up again, the screen stays grey with Apple icon displyed while gear disc keeps spinning endlessly. Have had to shut it down manually and then tri
-
Hello Experts I have Created a Profit And Loss Report Containing all the GL Accounts ,Now I need to filter this report According to Date(Posting date) i.e I have to specify the date range (From Date to To Date) How can i cre