DECIMAL = HEX CONVERSION PACKAGE 생성 SCRIPT

제품 : SQL*PLUS
작성날짜 : 2002-04-12
DECIMAL <=> HEX CONVERSION PACKAGE 생성 SCRIPT
==============================================
Purpose
Oracle내에서는 여러가지 값을 HEX 값으로 보여주는 경우가 있다.
이런 경우 DB내에서 decimal 값으로 변환하기 위한 방법을 알아보자.
Explanation
다음은 decimal <=> hexa 의 conversion을 위한 package 생성문으로서
system user로 수행하여 사용한다.
create or replace package support as
function dectohex (a number) return varchar2;
pragma restrict_references
(dectohex, WNDS, WNPS, RNDS, RNPS);
function hextodec (a varchar2) return number;
pragma restrict_references
(hextodec, WNDS, WNPS, RNDS, RNPS);
end support;
create or replace package body support as
FUNCTION hextodec(a IN VARCHAR2) RETURN NUMBER IS
x NUMBER := 0;
y NUMBER;
z VARCHAR2(1);
BEGIN
IF length(a) > 8 THEN
RAISE invalid_number;
END IF;
FOR i IN 1..length(a) LOOP
z := upper(substr(a,i,1));
IF z = 'A' THEN
y := 10;
ELSIF z = 'B' THEN
y := 11;
ELSIF z = 'C' THEN
y := 12;
ELSIF z = 'D' THEN
y := 13;
ELSIF z = 'E' THEN
y := 14;
ELSIF z = 'F' THEN
y := 15;
ELSE
y := to_number(z,9);
END IF;
x := x * 16;
x := x + y;
END LOOP;
RETURN x;
END hextodec;
FUNCTION dectohex(a IN NUMBER) RETURN VARCHAR2 IS
x VARCHAR2(8) := '';
y VARCHAR2(1);
z NUMBER;
w NUMBER;
BEGIN
IF a > power(2,32) OR a < 0 THEN
RAISE invalid_number;
END IF;
w := a;
WHILE w > 0 LOOP
z := w mod 16;
IF z = 10 THEN
y := 'A';
ELSIF z = 11 THEN
y := 'B';
ELSIF z = 12 THEN
y := 'C';
ELSIF z = 13 THEN
y := 'D';
ELSIF z = 14 THEN
y := 'E';
ELSIF z = 15 THEN
y := 'F';
ELSE
y := to_char(z);
END IF;
w := trunc(w / 16);
x := concat(y,x);
END LOOP;
RETURN x;
END dectohex;
END support;
drop public synonym support;
create public synonym support for system.support;
grant execute on support to public;

FYI: The new xf86-video-intel (2.9) has just been released:
http://article.gmane.org/gmane.comp.fre … xorg/40733
According to the release announcement, the new driver fixes the backlight issue with KMS:
* Add support for BACKLIGHT property when using kernel modesetting
  (KMS). This allows backlight adjustment with programs such as
  "xbacklight -set <percentage>" or "xrandr --set BACKLIGHT <value>".

Similar Messages

  • Interger to hex conversion ???

    Hi
    Is there a easy way to make interger (unsigned 32 bit ) to HEX
    conversion ??

    Kristian,
    It depends on what you want to do with the hex conversion. To view a
    number in hex in a control, right click on the control, select Format &
    Precision. As long as the format is set to numeric, you can select
    between decimal, hex, octal and binary from the other drop-down list.
    If you want to change an unsigned 32-bit number to a hex value to be
    written to a file, you can use the String->Format Into String VI. Wire
    your U32 into input 1, and set the format string to %4x (which will show
    a 4 digit hex value). The output will be a string which contains the
    hex value.
    Hope that helped.
    Mark
    In article <[email protected]>,
    [email protected] wrote:
    >
    >
    > Hi
    >
    > Is there a easy way to make interger (unsigned 32 bit ) to H
    EX
    > conversion ??
    >
    Sent via Deja.com http://www.deja.com/
    Before you buy.

  • Adobe Reader 11.0.2 Installation freezes at package scripts

    I have been having issues updating my adobe reader from 10.1.4 to 11.0.2
    Each time automatic update tried to dowload it an error would say
    the "app has been altered from the original installation", or something of that sort.
    so I deleted Adobe Reader 10.1.4 hoping it would enable me to download and install
    a fresh copy of 11.0.2
    I have 2 users on my MacBook Pro using Lion 10.7.5
    and have tried installing with both users logged in, one user logged in, then with only
    the other user logged in. I have tried deleting the dmg file and redownloading using
    a different browser (Firefox and Safari were the two used)
    I deleted the dmg file from one user and tried installing it with the other, all with the
    same end result:
    Installation gets to a "less than a minute remaining" at the
    installation of package scripts, and it locks up.  The computer fan kicks into high gear
    and the "minute remaining" starts to climb.  I let it get to 1 hour and 25 minutes remaining
    on one attempt, and force quit.  I have had to force quit every time I attempt to install.
    Any help in this matter would be greatly appreciated. 
    Thanks,
    Chad

    I have since downloaded 10.1.4 again, it works, but I still gett an issue with updating as I did before. 
    Another thing I thought strange was that it was updating to 10.1.6
    How do I fix this?

  • Why won't my download go past the running package scripts ?

    My download won't go past the "running package scripts" stage.  Help!

    Not enough information. We need all details about what, where, how, the errors you see when, etc.
    Ben

  • Jar file containing: com.sap.aii.messaging.adapter.Conversion package??

    Hi! Gurus
    Can you please let me know the name of the Jar/library file containing com.sap.aii.messaging.adapter.Conversion package.
    Your help is greatly appreciated!!
    Thank you,
    Patrick

    > Can you please let me know the name of the Jar/library file containing com.sap.aii.messaging.adapter.Conversion package.
    aii_msg_runtime.jar
    http://wiki.sdn.sap.com/wiki/display/XI/WheretogetthelibrariesforXI+development

  • Character to hex conversion

    Hi,
    How can i convert character into hex string , for example if i have the data as "testing data", how can i get the hex coded output? Ive tried out using first string to number vi and thennumber to hex conversion vi but i get the answer as 0, can u help me in this?
    In short my data is " testing1234okokok" , i want a hex coded output which would be something as  "AD87BA......."
    Please help
    From Subhash

    What coercion dots? There are no coercion dots even without the loop:
    Message Edited by smercurio_fc on 02-13-2008 03:12 PM
    Attachments:
    Example_VI.png ‏1 KB

  • How can I get to install Microsoft Office 2011 in my Mac OS X 10.6.8 if when down to "writing package scripts" it fails ?, How can I get to install Microsoft Office 2011 in my Mac OS X 10.6.8 if when down to "writing package scripts" it fails ?

    How can I get to install Microsoft Office 2011 in my Mac OS X 10.6.8 if when down to "writing package scripts" it fails ?

    Contact Microsoft support and ask for help.  You've paid for the kit, so installation-time support is part of the expectations.  They'll probably suggest a Repair Permissions and a Verify Disk pass, both performed by booting the installation DVD and using Disk Utility from the Utilities menu item, and selecting those two repairs.

  • Snow Leopard XServe 10.6.3 upgrade frozen at "Running package scripts"?

    The Automatic update program for installing and updating Snow Leopard xServe appears to be frozen at the "Running package Scripts." It has been at this position for about 12 hours with the bar all the way to the right on the install process. What is the verdict; do I let it run some more or should I do a hard reset and do the stand alone download and install?

    I was having this problem and think I found the solution. I just got my computer new and was trying to install FCS 2. The installation would freeze at "Running Package Scripts." I tried many times, all with this result. Finally, I went to Activity Monitor to force quit the installer. I pulled up the CPU usage monitor and noticed that one of the threads was at a steady 100%. I quit the installer, but it was still at 100%. I checked the process list and noticed that there was a PowerPC process titled "translate" still running with 100% CPU usage.
    So, I tried the install again. This time, instead of force quitting the installer, I force quit the "translate" process. Immediately, the installer kicked back in to action and finished. Hope this helps.

  • Using the labview conversion package (776874-03) on a Mac?

    I just received the labview vi conversion package (from 2.x or 3.x). I am trying to convert vi's that were written in Labview 2.0. Every Mac I have tried to use (new or old) can't open the labview program in the Mac folders on the conversion CD. Are there additional drivers I need to use this?

    Are you runnning the code in classic mode? I am sure the old LV will not run on OSX.

  • HT1199 I have been trying to redownload  itunes.  The download seems stuck on the "Running Package Scripts" page.  It says "about one minute" remaining for the download but, that was 2 hours ago.  Anything I can do?

    I have been trying to re-download itunes.  This is in an effort to try to recover my new iphone 5s which after the latest update, was put into recovery mode.  When I connected to itunes, I was given the message that I couldn't recover the phone.  So, support suggested that I re-download itunes.  The installation seems stuck on the "Running Package Scripts" page.  It says it only has about a minute left to complete this process - however that was over 2 hours ago!  Help!  What can I do next?

    Disconnect the iPhone from your Mac.
    Shut down your Mac, wait about ten seconds then restart.
    Then try downloading iTunes >  Apple - iTunes - Download iTunes Now
    Do not reconnect the iPhone until iTunes is installed.
    If that didn't help, the startup disk may need repairing.
    Launch Disk Utility located in HD > Applications > Utillities
    Select the startup disk on the left then select the First Aid tab.
    Click:  Verify Disk  (not Verify Disk Permissions)
    If DU reports errors, start up from your Mac install disc to make repairs.
    Instructions here >  Mac OS X 10.6: Reinstalling Mac OS X

  • Adobe Reader XI is stuck "loading package scripts"

    Whenever I try to install adobe reader 11 it gets stuck loading package scripts. How do I successfully install the program?

    Adobe - Support

  • Have downloaded the new software for itunes but it seems to be stuck on "running package scripts" any ideas?!?!

    why is i stuck on "running package scripts"?

    I've checked the "More like this" section and seems to be mostly a PC problem? I'm using and Mac though. I've also unpluged the only other USB that was plugged. Can anyone help?

  • Final cut studio stall on running package scripts

    Final Cut Studio installer is hanging on "running package scripts."  Any thoughts?
    Ronan

    Nothing specific, but here's a user tip with best practices for installation
    https://discussions.apple.com/docs/DOC-2861
    and if you've previously had fcp installed on this system, as mentioned in the user tip, be sure and wipe all traces of the app using digital rebellions uninstaller, before reinstalling.

  • Software update freezes at running package scripts

    I have owned this mini for two months. When I first brought it home, it required a software update. That failed and the computer quit working. Had to return it to the dealer for repairs. 2 weeks.
    Today, I received the next software update message. Without thinking, I accepted it. Now the update has been stuck on "running package scripts" for 45 minutes.
    Unfortunately, I did not look to see what was being updated. I have no idea what or how big.
    I cannot find any information in the forums regarding what to do, but my only option is power off. To do the update, I logged out and did a restart. There is no way for me to kill this process and manually clean up the install directories.
    Two software updates and two failed updates. Last time it physically harmed my computer.
    Any suggestions?

    Just had the same problem. What I did to fix this was to log in with SSH and kill the Safari process. Looks as if having Safari running when starting the update (noticed the update was for Safari) prevents it from completing.

  • Problem with EPC URI to Hex conversion

    Hi Forum,
    I am getting strange EPC URI to hex conversion result in tx:/ain/http_test . Could you please confirm if this result is not expected.
    1.URI : urn:autoid:tag:sgtin-96:3.0066800.054321.70     
    hex is :  30740413C00000D431000000
    2.URI:  URN:AUTOID:TAG:SGTIN-96:3.0066800.054321.71
    hex is: 30740413C00000D431000000
    thus is both case HEX is same!!!
    i am using EPC_1.24  as active EPC version.
    could you please suggest some round about way.
    thanks in advance,
    regards,
    Ashit

    hi,
    i think problem is with EPC_1.24. i changed to
    EPC_1.27
    and it works fine.
    regards,
    Ashit

Maybe you are looking for

  • Share the Verizon Code of Conduct

    Verizon Wireless has developed a Code of Conduct that is probably lost in your interactions with Verizon Wireless Representatives. Here is the link to Verizon Wireless Code of Conduct that maybe helpful in all levels of company understanding the code

  • CREATING VIRTUAL DIRECTORY THROUGH jakarta-tomcat-4.1.10

    dear friend(s) how to create a virtual directory through tomcat jakarta-tomcat-4.1.10 please help me very very urgent mohd meraj

  • Query Run Issue

    Hi Gurus We have developed queries across areas like SD, FI, CO etc.... most of them are running fine...but a few of them get stuck...even when we open them in query designer and try to save the query into a new one, the saving activity goes into a l

  • Summing Track Stack not properly saving as a patch???

    Hey Guys, So... - I created a Yah-Yah talking bass with the FM setting on the Retro Synth - used a bitcrusher to create the formant effect by downsampling - Then I created a new track for a sub bass sound seperate from the Yah-Yah - I put both the Ya

  • Using CS3 and CS4 on the same computer

    I have CS3 and have used it for about two years completing many projects and I am considering upgrading to either CS4 or CS5.  When and if i do this will I have to delete CS3 and replace it with the newer version or can they both remain functional on