How to convert data type while using @variable function

Hi Gurus,
I have a query.
i have created a Derived Table and the statement is given below.
select 1 as SENSITIVITY_LEVEL,1 as SUBSENSITIVITY,@variable('US_T') as NITEMS, ...........
here  in @variable('US_T') "US_T" is hard coded value. I want to change to data type of hard coded value as numeric or integer
i am using sap BI 4.0 universe design tool.
Thanks in Advance.
Regards,
Jeet

Hi Jeet,
Since it is text you can't convert into number.
Can you please let mw know the exact requriement of yours?
why you need this
Thanks,
Swapnil

Similar Messages

  • How to convert Date type

    I have a JSP to read the date value and use it to update the corresponding column in the table. In the JSP, the data type returned from request.getParameter("hiredate") is java.util.Date. Unfortunately, the CachedRowSet requires the java.sql.Date type. How can I convert the java.util.Date type to java.sql.Date type? Please advise,thanks.
    SK

    SK,
    This is how I do it:
    java.util.Date utilDate = new java.util.Date();
    long millis = utilDate.getTime();
    java.sql.Date sqlDate = new java.sql.Date(millis);Good Luck,
    Avi.

  • How to Convert Data types here

    Hi All,
    My stored proc is as below,
    create or replace procedure proc_sec_synch (
    Begin
    FOR sec_Update in (
    Select
    SsM_ID ,
    CYCLE_DATE ,
    TARGET_TABLE ,
    COLUMN_NAME ,
    NEW_DATA  ,
    COLUMN_TYPE from PM_OWN.test_synch order by target_table
    Loop
    *'Update' || sec_Update.target_table ||' dest SET dest.' ||sec_Update.column_name||' =*
    *(select src.new_data from pm_own.test_synch src where src.ssm_id = '||sec_Update.target_table||'.ssm_id)'*
    END Loop;
    END proc_sec_synch;
    actually I'm updating different tables using one table. the one table consists all the data like target table name and column name and the values also.
    in the above query, the data type of value what I'm retreiving from pm_own.test_synch is different from target table column datatype.
    so how could I change the type of retreiving value to the destination table column data type.
    help me.

    Here is the answer...
    Actuallly I have two databases which I need to synch 2nd database using first database, synch in the not entore database but only few tables and only few columns and that too on specific where condotions. so I made so many queries and retreiving data into temp tables and then updating into target tables,
    instead of above what I'm trying is I have created a stagiing table where I'll update the data (by using all above seelect queries) and update the target tables in one shot withoput using temp tables.
    Bottom line is:
    I need to get the report for the data that is getting updated daily before updating.
    and before updating I should have previllage to decide whether to update or not..?
    Cheers,
    Naresh

  • How to Convert Data type from CLOB to  LONG

    Hi all
    We changed one Long Data type column to CLOB
    We need to revert back to Long Data type,
    we changed the Data type from Long to CLOB
    Can we change back to Long Again
    we use oracle 10g Rel 2 on Hp-Unix
    thanks all in Advance
    Edited by: jrDba - atm on Apr 6, 2009 4:45 AM

    Hi Satish
    thanks a alot for the Info'
    Can you please provide the
    Notes MOS note 437021.1 for this purpose
    thanks a lot

  • How to add warning message while using 'print' function in Adobe LiveCycle Designer

    I am trying to make pdf document for my company which requires adding a warning message while anyone use 'print' function from the page...
    Does anyone know how to add warning message on LiveCycle Designer
    Also my supervisor mentioned something using 'nag' if that rings any bell

    No you shoudl never go into the XML source unless uinstricted to do so.
    You can open the script editor (under the window menu). It will appear above the drawing area but below the toolbars. You can resize it if there is not enough room. When you click on an object in the form you can choose an event to script against in the Show dropdown. In your case you will want to choose the prePrint event. A line will show up that indicates the object that is associated with the script as well as the event and other information. Add your script below this line. Once that is done you are finished and your form is ready for testing.
    Paul

  • How to convert columns into rows using  transpose function

    Hi
    anybody tell me how to convert columns values into rows using transpose function.

    Since BluShadow went to all the trouble to put it together, someone should use it.
    See the post titled How do I convert rows to columns? here SQL and PL/SQL FAQ
    John

  • How to find exception occured while using LOGON function in oracle 10g

    Hi,
    I am using LOGON function to login with a different user name in oracle 10g forms.
    LOGON ( User, Pass@tns, FALSE)
    The third parameter is passed as 'FALSE' to avoid the login screen to be opened. If any of the other parameter ( User Name, Password, TNS) is passed wrong, connection is not established but no exception is occurred. The value for 'FORM_FAILURE' is set to 'TRUE'.
    What i need is the ORA error for connection failure. The error message related to user name/password (ORA-01017) or connection identifier (ORA-12155).
    How i can get this error code if connection is failed. Is there any other way to login in oracle forms other than 'LOGON'.
    Habib

    Habib Ahmad wrote:
    Hi,
    I am using LOGON function to login with a different user name in oracle 10g forms.
    LOGON ( User, Pass@tns, FALSE)
    The third parameter is passed as 'FALSE' to avoid the login screen to be opened. If any of the other parameter ( User Name, Password, TNS) is passed wrong, connection is not established but no exception is occurred. The value for 'FORM_FAILURE' is set to 'TRUE'.
    What i need is the ORA error for connection failure. The error message related to user name/password (ORA-01017) or connection identifier (ORA-12155).
    How i can get this error code if connection is failed. Is there any other way to login in oracle forms other than 'LOGON'.As salamu alikum, Habib
    If you pass FALSE in login you can't catch anything. Want to catch the error ?
    Then change
    LOGON ( User, Pass@tns, FALSE)
    to
    LOGON ( User, Pass@tns, TRUE) Now Create On-Error trigger at form level
    and try the following code
    if error_code=01017 then
         message('invalid user name or password');
         message('invalid user name or password');
         raise form_trigger_failure;
    elsif error_code=12154 or error_code=1215 then
         message('invalid connection string');
         message('invalid connection string');
         raise form_trigger_failure;
    end if;Hopes this helps
    If someone's response is helpful or correct, please mark it accordingly.

  • Error in data template while using database function

    Hi,
    I have created a datatemplate in BI Publisher with the following code.
    <dataTemplate name = "AuditReport" dataSourceRef = "pg">
    <dataQuery>
    <sqlStatement>
    SELECT b.*,s.audit_table_name,s.audit_operation,s.AUDIT_TIME_STAMP
    FROM bi_audit_records b,sys_audit s
    where b.AUDIT_ID=s.AUDIT_ID
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReport" source="fn_audit_data(to_date('2010-04-01','yyyy-mm-dd'),to_date('2010-04-02','yyyy-mm-dd'),'ADMIN')"/>
    </dataTemplate>
    But when I try to view this, I am getting the following error.
    A name was started with an invalid character.
    Error processing resource 'http://<system name>:9704/xmlpserver/servlet/xdo'. ...

    Hi,
    This issue is related Oracle database issue, check with Basis/Dba team. Oce they resolved you can run the report with selections.
    If you know the table name you can check in SE14 (Data base Utility) and adjust the table. Some times it will work out.
    Hope it helps you.
    Riyez

  • Saving result from sp_executesql into a variable and using dynamic column name - getting error "Error converting data type varchar to numeric"

    Im getting an error when running a procedure that includes this code.
    I need to select from a dynamic column name and save the result in a variable, but seem to be having trouble with the values being fed to sp_executesql
    DECLARE @retval AS DECIMAL(12,2)
    DECLARE @MonthVal VARCHAR(20), @SpreadKeyVal INT
    DECLARE @sqlcmd AS NVARCHAR(150)
    DECLARE @paramdef NVARCHAR(150)
    SET @MonthVal = 'Month' + CAST(@MonthNumber AS VARCHAR(2) );
    SET @SpreadKeyVal = @SpreadKey; --CAST(@SpreadKey AS VARCHAR(10) );
    SET @sqlcmd = N' SELECT @retvalout = @MonthVal FROM dbo.CourseSpread WHERE CourseSpreadId = @SpreadKeyVal';
    SET @paramdef = N'@MonthVal VARCHAR(20), @SpreadKeyVal INT, @retvalout DECIMAL(12,2) OUTPUT'
    --default
    SET @retval = 0.0;
    EXECUTE sys.sp_executesql @sqlcmd,@paramdef, @MonthVal = 'Month4',@SpreadKeyVal = 1, @retvalout = @retval OUTPUT;
    SELECT @retval
    DECLARE @return_value DECIMAL(12,2)
    EXEC @return_value = [dbo].[GetSpreadValueByMonthNumber]
    @SpreadKey = 1,
    @MonthNumber = 4
    SELECT 'Return Value' = @return_value
    Msg 8114, Level 16, State 5, Line 1
    Error converting data type varchar to numeric.

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you need to read and download the PDF for: 
    https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
    >> I need to select from a dynamic column name and save the result in a variable, but seem to be having trouble with the values being fed to sp_executesql <<
    This is so very, very wrong! A column is an attribute of an entity. The idea that you are so screwed up that you have no idea if you want
    the shoe size, the phone number or something else at run time of this entity. 
    In Software Engineering we have a principle called cohesion that says a model should do one and only one task, have one and only one entry point, and one and only one exit point. 
    Hey, on a scale from 1 to 10, what color is your favorite letter of the alphabet? Yes, your mindset is that level of sillyity and absurdity. 
    Do you know that SQL is a declarative language? This family of languages does not use local variables! 
    Now think about “month_val” and what it means. A month is a temporal unit of measurement, so this is as silly as saying “liter_val” in your code. Why did you use “sp_” on a procedure? It has special meaning in T-SQL.  
    Think about how silly this is: 
     SET @month_val = 'Month' + CAST(@month_nbr AS VARCHAR(2));
    We do not do display formatting in a query. This is a violation of at the tiered architecture principle. We have a presentation layer. But more than that, the INTERVAL temporal data type is a {year-month} and never just a month. This is fundamental. 
    We need to see the DDL so we can re-write this mess. Want to fix it or not?
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • How to get data type of variable in program..

    Hi ABAP Guru.
    I need to know how to get data type of variable or any structure field.. because I got short dump when use command REPLACE ALL OCCURANCE ... with variable/structure field that has data type I or P, I think it should be used with data type CHAR only, So I need to check the data type first.
    Please give me your advice
    Thank you all.
    Nattapash C.

    data : v_value type i,
             v_char(10) type c.
    v_value = 10.
    move v_value to v_char.
    REPLACE ALL OCCURRENCES of '#' from v_char....
    Best regards,
    Prashant

  • How to convert DATE variable to CHAR variable

    dear all,
    How to convert DATE variable to CHAR variable
    thanq

    Depending on your final goal here are 2 options.
    DATA: datein        TYPE d.
    DATA: dateout(10)   TYPE c.
    DATA: dateout2(8)   TYPE c.
    datein = sy-datum.
    WRITE datein TO dateout MM/DD/YYYY.
    dateout2 = datein.
    WRITE:/ datein, dateout, dateout2.
    and the output
    05022008 05/02/2008 20080502    

  • How to know the data type of a variable?

    Hi,
       Can anyone tell me which function can return the name data type of a variable?
        Thanks!
    Message was edited by: Long Zheng

    Hi long,
    1. I don't know whether this will serve your purpose.
    2.
    REPORT abc.
    DATA : components     LIKE     rstrucinfo OCCURS 0 WITH HEADER LINE.
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    CALL FUNCTION 'GET_COMPONENT_LIST'
      EXPORTING
        program    = sy-repid
        fieldname  = 'T001'
      TABLES
        components = components.
    LOOP AT components.
      WRITE :/ components-compname , components-type.
    ENDLOOP.
    regards,
    amit m.

  • Any idea what this errorr means? the data type of the reference does not match the data type of the variable

    I am using Veristand 2014, Scan Engine and EtherCat Custom Device.  I have not had this error before, but I was trying to deploy my System Definition File (run) to the Target (cRio 9024 with 6 modules) and it failed. It wouldn't even try to communicate with the target. I get the 'connection refused' error.  
    I created a new Veristand project
    I added the Scan Engine and EtherCat custom device.
    I changed the IP address and auto-detected my modules
    i noticed tat Veristand didn't find one of my modules that was there earlier. (this week)
     So, i went to NiMax to make sure software was installed and even reinstalled Scan Engine and Veristand just to make sure.
    Now, it finds the module, but when i go to deploy it getsto the last step of deploying the code to the target, and then it fails.
    Any thoughts?
    Start Date: 4/10/2015 11:48 AM
    • Loading System Definition file: C:\Users\Public\Documents\National Instruments\NI VeriStand 2014\Projects\testChassis\testChassis.nivssdf
    • Initializing TCP subsystem...
    • Starting TCP Loops...
    • Connection established with target Controller.
    • Preparing to synchronize with targets...
    • Querying the active System Definition file from the targets...
    • Stopping TCP loops.
    Waiting for TCP loops to shut down...
    • TCP loops shut down successfully.
    • Unloading System Definition file...
    • Connection with target Controller has been lost.
    • Start Date: 4/10/2015 11:48 AM
    • Loading System Definition file: C:\Users\Public\Documents\National Instruments\NI VeriStand 2014\Projects\testChassis\testChassis.nivssdf
    • Preparing to deploy the System Definition to the targets...
    • Compiling the System Definition file...
    • Initializing TCP subsystem...
    • Starting TCP Loops...
    • Connection established with target Controller.
    • Sending reset command to all targets...
    • Preparing to deploy files to the targets...
    • Starting download for target Controller...
    • Opening FTP session to IP 10.12.0.48...
    • Processing Action on Deploy VIs...
    • Setting target scan rate to 10000 (uSec)... Done.
    • Gathering target dependency files...
    • Downloading testChassis.nivssdf [92 kB] (file 1 of 4)
    • Downloading testChassis_Controller.nivsdat [204 kB] (file 2 of 4)
    • Downloading CalibrationData.nivscal [0 kB] (file 3 of 4)
    • Downloading testChassis_Controller.nivsparam [0 kB] (file 4 of 4)
    • Closing FTP session...
    • Files successfully deployed to the targets.
    • Starting deployment group 1...
    The VeriStand Gateway encountered an error while deploying the System Definition file.
    Details:
    Error -66212 occurred at Project Window.lvlibroject Window.vi >> Project Window.lvlib:Command Loop.vi >> NI_VS Workspace ExecutionAPI.lvlib:NI VeriStand - Connect to System.vi
    Possible reason(s):
    LabVIEW: The data type of the reference does not match the data type of the variable.
    =========================
    NI VeriStand: NI VeriStand Engine.lvlib:VeriStand Engine Wrapper (RT).vi >> NI VeriStand Engine.lvlib:VeriStand Engine.vi >> NI VeriStand Engine.lvlib:VeriStand Engine State Machine.vi >> NI VeriStand Engine.lvlib:Initialize Inline Custom Devices.vi >> Custom Devices Storage.lvlib:Initialize Device (HW Interface).vi
    • Sending reset command to all targets...
    • Stopping TCP loops.
    Waiting for TCP loops to shut down...
    • TCP loops shut down successfully.
    • Unloading System Definition file...
    • Connection with target Controller has been lost.

    Can you deploy if you only have the two 9401 modules in the chassis (no other modules) and in the sysdef?  I meant to ask if you could attach your system definition file to the forum post so we can see it as well (sorry for the confusion).  
    Are you using any of the specialty configurations for the 9401 modules? (ex: counter, PWM, quadrature, etc)
    You will probably want to post this on the support page for the Scan Engine/EtherCAT Custom Device: https://decibel.ni.com/content/thread/8671  
    Custom devices aren't officially supported by NI, so technical questions and issues are handled on the above page.
    Kevin W.
    Applications Engineer
    National Instruments

  • Error converting data type nvarchar to numeric 'witholding tax' (OWHT)

    Hi Guys.
    After I have upgraded my clients 2007 PL 30 database to 8.81 PL05, and running a repair to fix inconsistincies, I am receiveing some error when opening any sales documents.
    It takes place when I open a sales document, or browse previous docs. When browsing previous docs, it onlly happens on some of them.
    I also receive a different error when viewing sales orders: Error converting data type nvarchar to numeric (CRD2).
    Any ideas how to fix it?
    It does not limit me from processing and using the rest of the functionality. All calculations with queries in the docs are still working.
    Thanks.

    Hi,
    Please check Note No. : 1402855 and see if the same applied to the issue mentioned by you.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • SQL types over PLSQL types while using Oracle Applications adapter in BPEL

    Use SQL types over PL/SQL types while using Oracle Applications adapter
    in BPEL/ ESB
    This document will be focusing on Oracle Applications adapter. However Database adapter is much like OA adapter (even OA adapter uses DB Adapter), so the readers who are interested to explore DB adapters, can relate things with this document and go further as well.
    Some Guidelines for writing PL/SQL APIs for OA Adapter
    As we know when we create a partner link from the OA adapter wizard it sometimes writes some wrapper script supportive to the OA Adapter WSDL which contains below
    * Object type for PL/SQL RECORD
    * Nested table of the given type for PL/SQL TABLE. For example, the nested table of NUMBER.
    * INTEGER substituted for PL/SQL BOOLEAN
    * Wrapper Script for converting above three set of data types . (PLSQL to SQL and SQL to PLSQL conversion functions)
    In runtime this wrapper script for converting PL/SQL to SQL and SQL to PL/SQL is an extra overhead.
    So the first advice would be to avoid the use of the below as parameters of PLSQL API being called by OA Adapter.
    * PL/SQL RECORD
    * PL/SQL TABLE. For example, the nested table of NUMBER.
    * PL/SQL BOOLEAN
    In other way we can say we should try to use only SQL data types in arguments if we are planning to call any PL/SQL API from the OA Adapter.
    If the requirement is to use a table or record uses the Object type. In place of BOOLEAN better to use VARCHAR or INTEGER what ever fulfills your requirement. Following this guideline we can reduce a huge number of Line of codes to be run each time the adapter being called.
    Generally, Oracle E-Biz standard APIs use PL/SQL record types and table types so when there is a requirement to call these API’s from OA Adapter (this is a common requirement in development), and if we directly browse the API in OA Adapter Configuration Wizard and create the partner link, again a huge number of code is written by the wizard in the wrapper script (a number of extra mapping of fields which are not being used in the interface).
    In this case better would be to create an Object type with only the required fields which are being used in that call and use them as parameters for the PLSQL API.

    Find the complete document
    http://www.4shared.com/file/167171882/29525116/Use_SQL_types_over_PLSQL_types.html

Maybe you are looking for