How to dynamically convert the return datatype of a procedure
Hi ,
I want to write a procedure which will take two argument.
one will be string and another one will be a out variable having dynamic return type based on the data in first passing parameter.
Description:
let suppose i have one table which has 3 column
1.String_col1 varchar2 (it will contain String combination of alphabets,numbers)
2.number_col2 varchar2 (it will contain numbers only)
3.date_col3 varchar2 (it will contain DATE)
All columns are having varchar2 as their datatype.(in sort all are String).
now i want to write a procedure which will convert the datatype of all the three columns into their respective datatypes i.e.
1.String_col1 varchar2
2.number_col2 number
3.date_col3 date
Note:I am passing only 1 column in procedure as IN parameter.I dont want to convert 1 row in their respective datatype.
Please let me know if you want any more information from my side.
I'm pretty sure that isn't possible.
What you could do is write a function to determine the datatype of the input, and use the return value of that function in either a decode or case statement to determine which of 3 explicitly defined functions to use.
Carl
Similar Messages
-
Convert the money datatype to a 2 decimal point format.
Whats the best way to convert the money datatype to a 2 decimal point format in ms sql 2005 for use in my applications.
this?
CAST(tr.depositReceivedAmount AS decimal(10 , 2))I respectfully disagree with the notion that you should change the SQL column from a 'money' data-type to something else.
In most database servers, 'money' is a data type that is designed to provide very consistent behavior with regard to arithmetic accuracy. In Microsoft Access, the representation is a scaled-integer. In MS SQL Server, it is obviously similar. Ditto Oracle and all the others.
You want the money data-type in the database to have this accuracy, because "hell hath no fury like an accountant in search of one lousy penny." The database column storage-formats are designed to satisfy accountants, and that is a Good Thing.
Meanwhile, you also want to take care as to exactly how you deal with the values. There are several points where rounding could take place. You do not have at your disposal the strongest possible handling of floating data-types in ColdFusion. You are also somewhat at the mercy of whatever interface software may lie between you and whatever SQL server you may use. "It's okay to round values once, but not multiple times."
I suggest rounding the value right before display, and stipulating that the user's input must be two decimal places.
Then, you might have to do some things at the SQL server's end. For instance, when you update a value in the table, you may need to use server-side logic to explicitly truncate the value to two decimal-points, so that an update of "$34.56" explicitly updates the column to "$34.5600." (This sort of thing has to happen within the SQL server context.) You know that the user's input has exactly two significant digits, but maybe (maybe not...!) the SQL server might not know this. You want to ensure that the server's internally-stored value represents exactly two significant digits, when the value originates from a user-input.
Don't err on the side of "your convenience" or "what looks good on-screen." (If you do, get ready to get phone-calls from the accountants, always at inopportune hours of the night.) -
I need to convert PDF file to Word Document, so it can be edited. But the recognizing text options do not have the language that I need. How I can convert the file in the desired of me language?
The application Acrobat provides no language translation capability.
If you localize the language for OS, MS Office applications, Acrobat, etc to the desired language try again.
Alternative: transfer a copy of content into a web based translation service (Bing or Google provides a free service).
Transfer the output into a word processing program that is localized to the appropriate language.
Do cleanup.
Be well... -
How can we know the return code of BDC Program ?
Hi All,
Please tell me : How can we know the return code of BDC Program when being exceuted in Session or in Transaction mode.
In my program, we are uploading data from Excel sheet to SAP via BDC
The records that are not updated we want to create a log file.
Now to know whether a record is updated ot not, wat syst field shloud be used?
Its urgent....
<b>Reward Point will be there ....</b>
Thanks,
HarishHi harish,
try the logic in this code ...
i had attached input file in the end.
TYPES: begin of errmess,
msgnr type t100-msgnr,
text type t100-text,
end of errmess.
TABLES : t100.
DATA: BEGIN OF DD_VA01,
AUART TYPE VBAK-AUART,
KUNNR TYPE RV45A-KUNNR,
BSTKD TYPE VBKD-BSTKD,
MABNR TYPE RV45A-MABNR,
KWMENG(2) type C,
KBETR(2) type C,
END OF DD_VA01.
DATA:IT_VA01 Like TABLE OF DD_VA01,
WA_VA01 Like LINE OF IT_VA01,
WA_VA01_F Like LINE OF IT_VA01,
IT_BDCDATA TYPE TABLE OF BDCDATA,
WA_BDCDATA Like Line OF IT_BDCDATA,
W_FNAME TYPE STRING,
messtab like bdcmsgcoll occurs 0 with header line,
it_errmess type table of errmess,
wa_errmess like line of it_errmess,
err_message type string.
data: zf1 type i,
zc1 type c value '2',
fn(20) type c.
Main Code ************************************************************
PERFORM get_input using 'C:\Documents and Settings\ic881592\Desktop\Daran_bdc_VA01-e.txt'.
SORT IT_VA01 BY AUART KUNNR BSTKD.
LOOP AT IT_VA01 INTO WA_VA01.
if WA_VA01_F-AUART <> WA_VA01-AUART OR
WA_VA01_F-KUNNR <> WA_VA01-KUNNR OR
WA_VA01_F-BSTKD <> WA_VA01-BSTKD.
PERFORM set_header_flag.
PERFORM create_bdc_header_data.
endif.
PERFORM create_bdc_item_data.
ENDLOOP.
PERFORM call_transaction.
PERFORM errorlog.
Procedures ***********************************************************
form get_input using w_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = W_FNAME
HAS_FIELD_SEPARATOR = '#'
TABLES
DATA_TAB = IT_VA01.
endform.
form call_transaction.
PERFORM bdc_field using 'BDC_OKCODE' '/11'.
CALL TRANSACTION 'VA01' USING IT_BDCDATA MODE 'A' messages into messtab.
refresh it_bdcdata.
endform.
FORM set_header_flag.
WA_VA01_F-AUART = WA_VA01-AUART.
WA_VA01_F-KUNNR = WA_VA01-KUNNR.
WA_VA01_F-BSTKD = WA_VA01-BSTKD.
if zf1 = 1.
PERFORM call_transaction.
endif.
zf1 = 1.
endform. "set_header_flag.
form create_bdc_header_data.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'VBAK-AUART' WA_VA01-AUART.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'KUAGV-KUNNR' WA_VA01-KUNNR.
perform bdc_field using 'VBKD-BSTKD' WA_VA01-BSTKD.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR' '04/06'.
perform bdc_field using 'BDC_OKCODE' '=CHOO'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE' '=POAN'.
endform. "create_bdcdata
FORM create_bdc_item_data.
CONCATENATE 'RV45A-KWMENG(' zc1 ')' INTO FN.
perform bdc_field using 'BDC_CURSOR' FN.
perform bdc_field using FN WA_VA01-KWMENG.
CONCATENATE 'KOMV-KBETR(' zc1 ')' INTO FN.
perform bdc_field using FN WA_VA01-KBETR.
CONCATENATE 'RV45A-MABNR(' zc1 ')' INTO FN.
perform bdc_field using FN WA_VA01-MABNR.
perform bdc_dynpro using 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE' '=POAN'.
ENDFORM.
form errorlog.
LOOP AT MESSTAB .
if MESSTAB-MSGNR = '311' or MESSTAB-MSGTYP = 'E'.
SELECT SINGLE msgnr text FROM T100
into wa_errmess
WHERE SPRSL = MESSTAB-MSGSPRA
AND ARBGB = MESSTAB-MSGID
AND MSGNR = MESSTAB-MSGNR.
IF SY-SUBRC = 0.
err_message = wa_errmess-TEXT.
IF err_message CS '&1'.
REPLACE '&1' WITH MESSTAB-MSGV1 INTO err_message.
REPLACE '&2' WITH MESSTAB-MSGV2 INTO err_message.
REPLACE '&3' WITH MESSTAB-MSGV3 INTO err_message.
REPLACE '&4' WITH MESSTAB-MSGV4 INTO err_message.
ELSE.
REPLACE '&' WITH MESSTAB-MSGV1 INTO err_message.
REPLACE '&' WITH MESSTAB-MSGV2 INTO err_message.
REPLACE '&' WITH MESSTAB-MSGV3 INTO err_message.
REPLACE '&' WITH MESSTAB-MSGV4 INTO err_message.
ENDIF.
CONDENSE err_message.
WRITE: / MESSTAB-MSGTYP, err_message .
ELSE.
WRITE: / MESSTAB.
ENDIF.
endif.
ENDLOOP.
endform. "errorlog
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
WA_BDCDATA-PROGRAM = PROGRAM.
WA_BDCDATA-DYNPRO = DYNPRO.
WA_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_BDCDATA TO IT_BDCDATA.
CLEAR WA_BDCDATA.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
WA_BDCDATA-FNAM = FNAM.
WA_BDCDATA-FVAL = FVAL.
APPEND WA_BDCDATA TO IT_BDCDATA.
CLEAR WA_BDCDATA.
ENDFORM.
input file :
OR 2148 0001235 R-1162 8 17
OR 2148 0001235 R-1161 2 30
OR 2148 0001235 100-400 6 25
OR 2148 0001235 R-1162 4 12
OR 2148 0001236 R-1162 3 12
OR 2148 0001236 R-1161 2 30
OR 2148 0001236 100-400 1 25
OR 2148 0001236 R-1162 7 12
OR 2148 0001236 R-1161 8 30
OR 2148 0001236 100-400 10 25
OR 2148 0001235 R-1161 5 30
OR 2148 0001235 100-400 2 25
OR 2148 0001235 R-11621 3 12
OR 2148 0001235 R-1161 2 30
OR 2148 0001235 100-400 1 25
OR 2148 0001235 R-1162 7 12
OR 2148 0001235 R-1161 8 30
OR 2148 0001235 100-400 10 25
OR 2148 0001236 R-1162 8 17
OR 2148 0001236 R-1161 2 30
OR 2148 0001236 100-400 6 25
OR 2148 0001236 R-1162 4 12
OR 2148 0001236 R-1161 5 30
OR 2148 0001236 100-400 2 25 -
How can I convert the ringtone (m4r file) I made into an mp3 file on itunes?
How can I convert the ringtone (m4r file) that I made into an mp3 file on iTunes? I want to put it on a CD, but I can't figure out how to convert it. I didn't buy it, I made it by converting a YouTube video into an mp3 (I wanted to get the little song in the video for a ringtone.) I'm not sure what to do.
Hello ed2345,
Thanks for the help, but this is not the problem.
It's hard to describe the problem, but I'll try it again, this time with pictures.
I was left with the following folders in the iTunes Downloads folder.
http://www.picfront.org/d/7yb3
These TMP Folders have a download.m4a and a Info.plist file.
After moving the audio files in iTunes a bit I get this.
http://www.picfront.org/d/7yb2
As you can see no other Information for the download.m4a than the length.
That's how the .m4p file looks like
http://www.picfront.org/d/7yb1
And this is how the same .m4a file currently looks
http://www.picfront.org/d/7yb0
Like I said, I could edit all these download.m4a files by myself but that would leave some information out.
Note: Sorry, I hope the links do not spam you with annoying ads. I don't get any but I was told that there can be some annoying one. -
How can i convert the HTML information in XML form to a PDF?
Hi does any body know how can i convert the content of an HTML field in a XML Form in a regular text to include in a PDF in a Java program?
Hi ,
On the tool bar you have an option "Browser" which is next to "HTML Editor" .
You know that for using these elements wo have to map them with Data Schema.
Step by step
1. In data Model Under Data Schema Add a child and name it Read_More.
2. In the left hand corner ,click on tab Type and from the drop down select "rid"
3.Click on the "Browser" from the toolbar (as told earlier) and drag and drop it on the form.
4. Drag the Data schema which u have made(Read_more) and drop it on the browser on form. On right hand side u will se the mapping done.
5.Click on the "Browser" which is there in the form and on the right hand side of the form u will see the property window.
6.In property window change the value of action property to "Item Entry point"
7. Repeat step 3 and 4 in Render and show form but using "label" nad not browser.
Do not forget to add Save button in Edit Form.
This will solve your problem.
PS:Rewards Point Please.
Regards,
Naveen Gupta -
I am not a computer genius. Somehow, my Itunes files are now in MP4 format. How do I convert the whole library back to MP3 so I can download on a usb drive to play on the CD player? Help!!!
iTunes: How to convert a song to a different file format - http://support.apple.com/kb/HT1550 - including information about different formats and discussion about compression.
In iTunes11: File > Create New Version -
I have a 2 page (portaait format) PDF file how can I convert the PDF file into landscape format before I change it to XL?
Hi jsremick,
To change the page orientation of a PDF, you need to use Acrobat. (Reader allows you to rotate the page view, but not the pages themselves).
If you don't have Acrobat, feel free to give it a try. You can download the free 30-day trial from http://www.adobe.com/products/acrobat.html.
Best,
Sara -
How can I convert the volume directory into a single file installer?
How can I convert the volume directory into a single file installer? I would like to hide all the miscillaneous files that I don't care for and be able to have the installer double click a single file and have it automatically install.
On the second prompt screen when prompted 'What kind of self-extracting Zip file file do you want to make?'
Are you choosing the second option (self-extracting Zip file for software installation)?
I have a word file that I created to help me remember - is there anyway to email it to you? -
As I opened the places.sqlite with an sqlite-editor I found out that firefox saves the last_visit_date via a timestamp which is 16 digits long. I realized that the first 10 digits are similar to the corresponding unix-timestamp but not equal. So.. how can i convert the firefox-timestamp into a normal date? Or into the corresponding unix-timestamp?
Write a bash script or 'C' program to change the date format and then use the sql update function to receive the stdio output 'where date_field='embeded date value'.
-
How can I convert the ITHMB photo files to PC readable format like JPEG?
How can I convert the ITHMB photo files on my new Iphone 4s to a PC readable format like JPEG
Look at the link and follow instructions to convert the file taken from a different thread in this forum:
https://discussions.apple.com/thread/2640386?start=0&tstart=0 -
How can i convert the data from mutiple-table to the other database(MSSQL)?
Dears,
How can i convert the data from mutiple-table to the other database such as MS-SQL?
I have a third party system based on MS-SQL 2000.
Now we want to make a integration between SAP R/3(Oracle) and SQL server.
When my user releases the purchase order in R/3, the application we coded will convert the releated data to the temp database on the SQL server.
But i don't know which tools will help me reach the purpose. BAPI, LSMW, IDoc... ???
Would anybody tell me which way is better and how to do?
Thanks a lot!
Kevin WangHello Kevin,
The question to use which method depend on your detail requirements. If you use BAPI, you need to find which Bapi can provide the data you want. Bapi normally use as a function called by external system. So you need to develop an external program like VB/Java to call this Bapi and move it to SQL. LSMW is use when you want to upload data from an external system to SAP. So it does not serve your requirement. Idoc can be use to export data to an external system. Again like Bapi, you need to find what Idoc can provide the data you want. However, it does not any programming from the external system. If I were you, based on your requirements, I think writing an Abap program that read the data you want and download it to NT/SQL server will be faster and easier. -
How can I convert the variable expression stored as string back to variable expression
How can I convert the variable expression stored as string back to variable expression?
I am storing the expression enterd in the TSExpresssionEditControl as simple string and want to convert back to expression since I want to get the data type of that expression.pritam,
I'm not sure what you're trying to do exactly. If you are trying to get the value of a variable and you only have the name of value in a string, then you can use Evaluate() to get its value. If you want the data type, my advise is to use the GetPropertyObject() API method and just pass in the loop up string. Then you'll have a handle to the data object and then proceed from there.
Regards,
Song D
Application Engineer
National Instrument
Regards,
Song Du
Systems Software
National Instruments R&D -
How do I convert the ASCII character % ,which is 25h, to a hex number 25h. I've tried using the scan value VI but I get a zero in the value field.
You can use String to Byte Array for this.
-
How can i convert the quantity of one unit to other unit in BI 7?
Hi ,
I have developed an RFC function module in SAP BW (BI 7.0).
For this function module I have to populate material number and Quantity required and UNIT.Every thing working good. If the user forgets to enter unit or enters other unit where Quantity in ODS is not mentioned in terms of that unit.WE have to Convert the Quantity requested into the Qunantity that exist in ODS or DATA BASE based on the unit of measure .
Please suggest me how can I convert the UNIT of measure of quantity?
Thanks,
Suresh.I have to do this with conversion table /BIO/PMAT_UNIT.
IN THIS TABLE I DON'T KNOW HOW CAN I CONVERT?
REGARDS,
SURESH.
Maybe you are looking for
-
One of my main goals is to be able to run a Windows application on my iMac, purchased in July, 2012, with the Intel 2.5Ghz i5, 4GB RAM, 500GB hard drive. At first I installed Boot Camp and then Win 7, then the application I need to run, and I don't r
-
Intel processor bug causes Windows 2008r2 guest to blue screen
We recently purchased several B200-M3 blades with E5-2680v2 processors. Our UCS infrastructure and blade firmware is at 2.2(1d). ESXi hosts are at 5.5u1. From my reading of the Release Notes, this makes the new blades vulnerable to Caveat CSCuo3057
-
Help in inserting rows into a table
I have a table called acct_fact, I need to insert rows in the table using a script but the problem is there's a column called seq_nbr which has random seq nbr of 14character length like 'ZWX98MGD9MVAD6J','ZWX98MG67RVAD6J' etc., While inserting rows I
-
Multiple alternating row colours
I need to flag each row with different colours depending on the values in the columns. I believe you can do it in the definition of an alternating row report template but it only has entries for 4 conditions. How can I colour rows with more that 4 di
-
Recently my iPod doesn't send any sound to the left headphone unless I press and hold the headphone jack in place. When i say press, i have to apply quite a bit of pressure. When i let go it stops sending sound to the left headphone again. It's not t