Creating an empty column in a query

Is there a way to place an empty column in  a query? I would like to put acolumn with no information into the middle of a query. The reason is that the information that goes in that column is not available on any tables in my SQL databases.
SELECT
hier.dir_name 
,hier.am_name 
,hier.fm_name     INSERT BLANK COLUMN HERE
,hier.tech_name
hier.tech_id

Hi
"no information" in database is usually NULL value. Is this what you are looking for?
SELECT
hier.dir_name
,hier.am_name
,NULL as fm_name
--,hier.fm_name INSERT BLANK COLUMN HERE
,hier.tech_name
hier.tech_id
[Personal Site] [Blog] [Facebook]

Similar Messages

  • MII 12.1 Workbench - Empty Column List in Query editor

    Hi all,
    In my CE 7.2 I have deployed via JSPM MII 12.1
    Everything seems ok on the overall installation side.
    I have defined a DataServer (connector IDBC, Type SQL) connected to the local MaxDB instance.
    The status is "Running" and everything seems ok.
    I want to access tables created as result of DDic DC deploy.
    The tables are actually there as I can see from NWA SQL console.
    The error happens when I start the Workbench->new SQL Query->Fixed Query Details
    The table is there in the list, but when I click on any table the column list stays empty (even for system tables)
    I get the following errors in trace
    Enter a table name
    [EXCEPTION]
    com.sap.xmii.Illuminator.logging.LHException: Enter a table name
    at com.sap.xmii.Illuminator.logging.ErrorHandler.handleError(ErrorHandler.java:47)
    at com.sap.xmii.Illuminator.connectors.IDBC.ColumnList.getData(ColumnList.java:33)
    at com.sap.xmii.Illuminator.connectors.IDBC.DBMetaDataProcessor.getListData(DBMetaDataProcessor.java:115)
    at com.sap.xmii.Illuminator.connectors.IDBC.DBMetaDataProcessor.processRequest(DBMetaDataProcessor.java:25)
    at com.sap.xmii.Illuminator.connectors.IDBC.DataSource.doProcessRequest(DataSource.java:67)
    at com.sap.xmii.Illuminator.connectors.AbstractConnector.processRequest(AbstractConnector.java:97)
    at com.sap.xmii.Illuminator.server.QueryEngine.run(QueryEngine.java:39)
    and several like
    com.sap.security.api.NoSuchRoleException: Role with uniqueName super_admin_role not found!
    Can anyone please help?
    Thanks, regards
    Vincenzo

    Hi Diana,
    thanks again for your support, I have only tried to connect to local MaxDB no Oracle, No MSSql
    I am using the IDBC connection to local MaxDB instance, I have deployed the corresponding jdbc archive version.
    The connection seems to be ok if the test query is something like "CURDATE()", but if I use a real query involving the table I'm interested in, it cannot be accessed and I get the "Enter table name" error again.
    I believe you are right in that no SQL-enabled user exists after installation, only admin users exist
    I am now trying to create an SQL-enabled user to perform queries, but it seems a bit awkward from command line.
    If you have any suggestion other than looking at manuals (which I am already doing) feel free to suggest
    The datasource method did not work, even though it would be the best one IMHO.
    I tried to use the SAP/JPA_DEFAULT datasource with a different DataServer, but when loading the Table list in workbench I get: UnsupportedOperationException: unimplemented method isNull, which should be somehow related to jdbc driver
    Maybe this second error could be somehow related to the CE 7.2 version Michael was correctly pointing at, since the driver used is the builtin SAP driver.
    thanks for any suggestion
    Thanks, regards
    Vincenzo

  • How to Hide Empty Column In SAP Query (SQ01)

    I was crated a report in sq01 based on business requirements , but there are some fields without any content , in sq01 if you select one of output fields in the right side of the screen in the left side you can see  "List Fields" T in the list fields there is a check box , the name is "Only display field if <> 0 " , but when i check it, it doesn't work  , guys is there any one to help me to eliminate column without content , in the result of sap query (sq01) ??

    Please give reference (or hyperlink) to 10 Useful Tips on Infoset Queries (original document)
    Regards,
    Raymond

  • Query on MultiProvider by ignoring empty columns

    Hi Experts,
    I have a MultiProvider which contains 2 InfoCubes. InfoCube 1 (IC 1) contains Transport Request (TR) Status information, IC 2 contains Transport Request Object List information. Both ICs are related by the TR IDs. Not every TR has a Object List (better: Objects). Therefore, in IC 1 TRs exist that are not listed in IC 2.
    This leads to empty columns in the MultiProvider due to the union operation which is processed on both ICs. In particular the object related columns (object name, type, etc) are empty, if the TR does have a status information but at the same time without having any object listing, e. g. :
    TR ID - Status - Object Name - Object Type
    T123 - Successfull - # - #
    (# = Empty)
    When executing a query on this MultiProvider which counts the number of Objects I get the correct result, when NOT reporting on the TR ID level. However, if I execute a query which counts the number of Objects per Transport Request (TR ID), I get at least a "1" for EVERY transport request even if there does not exist ANY object within that TR ID (see example above).
    So my question: is there any way to ignore TR IDs when no object information exist for this Transport Request? Thus, the query would only report an object count > 0 if at least one object is associated to a certain TR ID.
    Many thanks for your help!
    Best regards
    Tobias

    I chose
    Exception Agg: Counter for All Detailed Values That Are Not Zero, NUll, or Error
    Ref Char: Object Name
    Activated Calc after Aggr.
    Did not change anything. I still get a table which shows the TR ID (eg T123), Object Name (Empty = #) and Object Count = 1
    I don't get why empty cells are part of the calculation even if the excep. aggr. is configured as described above...
    Any further ideas on that?
    Many thanks!

  • Create custom column in power query

    Hello All,
    I have a requirement to create report for the Analysis, my raw data looks like below which I'm extracting from multiple tables. I would like to extract project wise number count  based on status, my idea is to create custom columns to write the value
    if the value matches to the condition else blank. Example my status has multiple status value ( closed, on-hold,warranty,inprogress,etc) i need to know what formula will help me extract data in different columns so that i can get the count in pivot for each
    status)
    NUMBER         CATEGORY                                Internal SLA  
        EXTERNALSLA      DATE_ENTERED    STATUS
    C1000001    HEINEKEN                                    t             
                     t                  9/13/2014            CLOSED
    C1000002    Migration-BLACKROCK AppV                                                           
    2/11/2015    Terminated
    C1000004    Migration-BLACKROCK AppV                                                          
    10/24/2014    CLOSED
    C1000005    Migration-BLACKROCK AppV        t                                  t  
                  1/12/2015    On-Hold
    C1000006    Migration-BLACKROCK AppV                                                  
             11/5/2014    CLOSED
    C1000007    Migration-BLACKROCK AppV    t                                       
    t               9/12/2014    CLOSED
    C1000008    Migration-BLACKROCK AppV                                                              
    8/6/2014    On-Hold
    C1000009    BLACKROCK                                                                                      
    8/5/2014    In Progress
    C1000010    Migration-BLACKROCK AppV    t                                          t  
                  8/5/2014    On-Hold
    C1000011    Migration-BLACKROCK AppV                                                              
    10/25/2014    CLOSED
    C1000012    BLACKROCK                                                                                        
    9/24/2014    CLOSED
    C1000013    BLACKROCK                                                                                      
    10/16/2014    Terminated
    C1000015    BLACKROCK                                                                                        
    9/1/2014    In Progress

    Hi Imke,
    I have achieved what i wanted to... I did try the way you have suggested. But end result was not fruitful.
    I did following for status wise count.
    Step1: In power query I have created duplicate status column for each status available.( Example I have status {closed,open,initial... etc} I have created duplicate column for each status and replaced with null.For closed Except closed all i replaced in
    column with null).
    Step2: So every time my power query data refreshes it does that step each time so that i can get the count of each status column wise in my pivot table.
    I have attached the result,
    Harsha

  • Don't get result when I put empty column in addition

    Hi all !
    I've got some difficulty to get a total when I put empty column of a table in an addition in my sql query. All the data type are the same.
    Some one can help me with that please
    Thanks in advance
    Eric

    Thanks Richard.  My 5.1 mixdown type is Front+Rear+LFE.  I can see why I may not hear a center channel solo as my 5.1 amp does not have HDMI inputs and the MAtrox Mini Max only offers HDMI audio out or RCA 2 channel stereo out (which is what I have to use).
    However, with the meter levels showing plenty of audio in the center channel, I thought I'd at least hear it in the finished Blu Ray.  Could it be some setting in Surcode?  I basically get 4.1 with all speakers except the center giving sound.  If I put my ear up to the center channel I can hear slightly some sound.  My other home theatre system does the same.  I can find very little info on this from surcode manuals and they haven't responded to my emails.
    I have 6 stereo tracks I created from the original audio using Audition and imported them into Premiere and set the master to 5.1 with the 6 channels as standard.  The 5.1 mappings for channel assignments (device mappings for the Matrox player) match the rest of the sequence.
    Are you familiar with surcode?  Like I say I can hear the LS and RS, L&R, and LFE perfectly in the authored BD-RE (and it sounds wonderful even without the center channel), but I get nothing (or next to nothing) out of the center channel.  I have some future projects coming up where this would not be acceptable.
    I am a long time NLE editor going back to the 90s, but those were all DVDs and this is my first Blu-Ray and Surround sound project.
    Any more helpful suggestions?  It is much appreciated.
    Thanks
    Steve

  • How can I create an empty row on a #TempTable based on an input parameter

    So if my Line of Business is 'MC' or 'MG', I have to go over to Oracle and get its data accordingly. Then, when I create my final report result set, I think I'll want to UNION in that result set if my Parameter is 'MC' or 'MG'. I don't think I can UNION
    based on the value of the Parameter. So my thought process was to create an empty row on my #TempTable so when I UNION and my parameter is NOT 'MC' or 'MG' then it will have nothing to UNION in. My struggle is how do I create an empty row in my #TempTable
    if my parameter is NOT 'MC' or 'MG'
    If I am wwwaaayyy off here, please tell me so.
    This is my #TempTable Creation SQL...
    IF EXISTS
    (SELECT 1
    FROM [#TempTable_LineOfBusiness_Parameter]
    WHERE [#TempTable_LineOfBusiness_Parameter].[RESULT] IN ('MC','MG'))
    BEGIN
    SELECT *
    INTO [#TempTable_Market_Prominence_Member_Data]
    FROM OPENQUERY
    (RPDMHF,
    'SELECT HCFA_NAME_ORG.NAME_ID,
    HCFA_NAME_ORG.MEMBER_ID,
    HCFA_NAME_ORG.HIC_NUMBER,
    MEMBER.NAME_FIRST,
    MEMBER.NAME_LAST,
    HCFA_DATE.START_DATE,
    HCFA_DATE.END_DATE,
    HCFA_NAME_ORG.COUNTY_CODE,
    HCFA_NAME_ORG.PART_A_PAYMENT,
    HCFA_NAME_ORG.PART_B_PAYMENT,
    HCFA_NAME_ORG.STATUS,
    HCFA_NAME_ORG.ORG_ID,
    HCFA_NAME_ORG.PLAN,
    HCFA_NAME_ORG.ENROLL_DATE,
    HCFA_NAME_ORG.PBP_ID,
    HCFA_DATE.VALUE
    FROM SC_BASE.HCFA_DATE
    LEFT JOIN SC_BASE.HCFA_NAME_ORG
    ON HCFA_NAME_ORG.NAME_ID = HCFA_DATE.NAME_ID
    LEFT JOIN AMIOWN.MEMBER
    ON TRIM(MEMBER.MEMBER_NBR) = TRIM(HCFA_NAME_ORG.MEMBER_ID)
    WHERE HCFA_DATE.INDICATOR = ''plan''
    AND HCFA_DATE.START_DATE >= ''2015-01-01''
    END
    If I add an ELSE, it always comes back and tells me the #TempTable_Market_Prominence_Member_Data already exists. As if it's creating it regardless of the Top IF.
    Thanks for your review and am hopeful for a reply.

    Hi ITBobbyP,
    The error came back from your ELSE Statement most probably caused by the reason mentioned in Hoffmann's post.
    Regarding your requirement, I would suggest you CREATE the [#TempTable_Market_Prominence_Member_Data] explicitly.
    CREATE TABLE [#TempTable_Market_Prominence_Member_Data]
    NAME_ID INT,
    MEMBER_ID INT,
    HIC_NUMBER VARCHAR(99),
    NAME_FIRST VARCHAR(99),
    NAME_LAST VARCHAR(99),
    START_DATE DATE,
    END_DATE DATE,
    COUNTY_CODE VARCHAR(99),
    PART_A_PAYMENT MONEY,
    PART_B_PAYMENT MONEY,
    STATUS VARCHAR(99),
    ORG_ID INT,
    PALN VARCHAR(99),
    ENROLL_DATE VARCHAR(99),
    PBP_ID INT,
    VALUE INT
    IF EXISTS
    (SELECT 1
    FROM [#TempTable_LineOfBusiness_Parameter]
    WHERE [#TempTable_LineOfBusiness_Parameter].[RESULT] IN ('MC','MG'))
    BEGIN
    INSERT INTO [#TempTable_Market_Prominence_Member_Data]
    SELECT *
    FROM OPENQUERY
    (RPDMHF,
    'SELECT HCFA_NAME_ORG.NAME_ID,
    HCFA_NAME_ORG.MEMBER_ID,
    HCFA_NAME_ORG.HIC_NUMBER,
    MEMBER.NAME_FIRST,
    MEMBER.NAME_LAST,
    HCFA_DATE.START_DATE,
    HCFA_DATE.END_DATE,
    HCFA_NAME_ORG.COUNTY_CODE,
    HCFA_NAME_ORG.PART_A_PAYMENT,
    HCFA_NAME_ORG.PART_B_PAYMENT,
    HCFA_NAME_ORG.STATUS,
    HCFA_NAME_ORG.ORG_ID,
    HCFA_NAME_ORG.PLAN,
    HCFA_NAME_ORG.ENROLL_DATE,
    HCFA_NAME_ORG.PBP_ID,
    HCFA_DATE.VALUE
    FROM SC_BASE.HCFA_DATE
    LEFT JOIN SC_BASE.HCFA_NAME_ORG
    ON HCFA_NAME_ORG.NAME_ID = HCFA_DATE.NAME_ID
    LEFT JOIN AMIOWN.MEMBER
    ON TRIM(MEMBER.MEMBER_NBR) = TRIM(HCFA_NAME_ORG.MEMBER_ID)
    WHERE HCFA_DATE.INDICATOR = ''plan''
    AND HCFA_DATE.START_DATE >= ''2015-01-01''
    END
    Explicitly creating the temp table will offer below benefit in this case.
    The ELSE statement is no longer needed, if the no rows get inserted into that table, it has nothing to union an empty table.
    With the column datatype defined, you can avoid such conversion error
    SELECT NULL AS COL1,NULL AS COL2 INTO #T
    SELECT COL1,COL2 FROM #T
    UNION
    SELECT 1,'ABC'--Conversion failed when converting the varchar value 'ABC' to data type int.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • How to create an new column from ordered pairs

    Hi,
    Wondering if anyone can help this problem. I am analyzing network traffic between a PC and a Server. I can easily get a count of packets in each direction, PC1 to Server1 and the return path, Server 1 to PC1. But want I really want is a count
    of PC1 to OR from Server1, basically a count of packets by IP conversation.
    Each row is a packet with fields like: Time, Source, Destination.
    For example
    2:01:01, PC1, Server1
    2:01:01, Server1,  PC1 
    I would like to create a new column that represents a conversation. So new have columns: Time, Source, Destination, Conv. To get something like this:
    2:01:01, PC1, Server1, Conv1
    2:01:01, Server1,  PC1, Conv1
    2:01:01, PC2, Server1, Conv2
    2:01:01, Server1,  PC2, Conv2
    Thanks,
    Wes

    Wes, I just got around to revisiting your problem. The solution I came up with is twofold. The first part is the creation of a custom function that generates a conversation ID in the form PC1_Server1, PC2_Server1 etc. The second part uses a lookup table
    for each unique combination of PC and server to return a conversation number (Conv1, Conv2...).
    First of all, the "NetTraffic" table (your original table) generates the following script
    let
        Source = Excel.CurrentWorkbook(){[Name="Table8"]}[Content],
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Time", type time}}),
    in
        #"Changed Type"
    In the above, the type of the timestamp column is changed to time, but you can alternatively fix it as text.
    I've called the custom function "ConversationIdentifier." It takes four parameters, as described by the parameter names.
    (sourceList as list, sourceValue as text, destinationList as list, destinationValue as text) as text=>
    let
        SourceConversationList = List.Sort(List.Select(sourceList,each (_ = sourceValue or _ = destinationValue))),
        DestinationConversationList = List.Sort(List.Select(destinationList,each (_ = sourceValue or _ = destinationValue)),Order.Descending),
        ConversationID = SourceConversationList{0}&"_"&DestinationConversationList{0}
    in
        ConversationID
    Usage:
    As an added custom column in Power Query, the formula, based on the "NetTraffic" table would be:
    =ConversationIdentifier(#"Changed Type"[Source],[Source],#"Changed Type"[Destination],[Destination])
    As previously mentioned, the custom function generates combinations of PC and server, such that each combination represents a conversation.
    Next, I created a two-column "ConversationLookup" table in a worksheet, with entries like PC1_Server1|Conv1, PC2_Server1|Conv2, and so on.
    In the NetTraffic table, I did a merge with the ConversationLookup table, ensuring that the "Only Include Matching Rows" option is left unchecked (left join).
    Finally, I removed unwanted columns. Note: You don't need to use the lookup step if PC1_Server1, PC2_Server1 etc. serves your need for identifying a conversation.

  • How to create Implicit Fact column ?and how to use it ?

    Hi all,
    How to create Implicit Fact column ?
    and how to use it ?
    Thanks in advance

    When you create a request with only dimension columns, the Oracle BI engine has to choose a fact table to join the dimensions to each other. If you have multiple fact tables in your BMM layer, the Oracle BI engine will use the most economical fact table, depending on the number of dimensions of the fact table.
    In some cases you do not want to use this fact table, but you want to force the Oracle BI engine to use the fact table you want.
    In that case you should create a fact (or select an existing fact) of the fact table you want to use for the dimension only query. In the presentation catalog of the subject area you should select this fact as the implicit fact. This fact will always be used in the query, but it won't be visible in your report. An example of an implicit fact is the count of the primary key (id) of the fact table.

  • How to get two empty columns in reporting?

    Hi Experts,
    How to get Two empty columns in  a report, i have taken a formula and i have given '=0' in the formula box after executing the query that two columns containing zero's, but i don't want zero's, i want to display empty columns.
    pl help to do this,
    thanks & regards
    venakt

    Hi
    In the Query designer go to Properties and Select Active n Zero Supression
    also select Supress Zeros from the drop down.
    Regards
    M.A

  • Access Summary column in a query

    Hi All,
    I am new to oracle reports. I am using report builder 10.1.2.0.2.
    I have a summary column in my report. I would like to use this summary column in another query.
    if is use this column directly in the query, i am getting the below error:
    "Field 'F1' references column '<summary column name>' at a frequency below its group. "
    Both these fields are in the same frame. In the object navigator, both are displayed under the same group name.
    please let me know if there any way to access summary columns in another query.
    Thanks.

    You can use a field from one query in another query as parameter, i.e. preceded by colon. To do this first create link of "Group to Query" type between the first query's group where the summary column is, and the second query.

  • How to create custom BOL object for dynamic query in CRM 7.0

    Hi,
    Could anyone please explain me with steps that how to create the custom BOL object for dynamic query in CRM 7.0, I did it in previous version but its throwing exception when i try to create the object of my dynamic query class. I just defined the entry of my in crmv_obj_btil to create the dynamic query BOL object. do i need to do any other thing also to make it work?
    Regards,
    Kamesh Bathla
    Edited by: Kamesh Bathla on Jul 6, 2009 5:12 PM

    Hi Justin,
    First of thanks for your reply, and coming to my requirement, I need to report the list of items which are there in the dynamic select statement what am getting from the DB. The select statement number of columns may vary in my example for different countries the select item columns count is different. For US its '15', for UK it may be 10 ...like so, and some of the column value might be a combination or calculation part of other table columns (The select query contains more than one table in the from clause).
    In order to execute the dynamic select statement and return the result i choose to write a function which will parse the cursor for dynamic query and then iterate the values and construct a Type Object and append it to the pipe row.
    Am relatively very new for these sort of things, welcome in case of any suggestions to make it simple (Instead of the function what i thought to work with) also a sample narrating the new procedure will be appreciated.
    Thanks in Advance,
    mallikj2.

  • Hide a column in BW Query

    Hi Gurus!
    I'd like to hide a column for specifics users in a BW Query.
    I flagged the InfoObject as Auth. Rel. and created an analysis authorization. I ran the query but I got "No authorization", when I checked the log I saw that the query is asking for full authorization value to that InfoObject. I tried with : (semi colon) value but I got the same result.
    Is there any way to hide a column in a query (with authorization concept) avoiding to redisign a new query?
    Thanks in advance.
    Best regards,
    Pepe

      when I checked the log I saw that the query is asking for full authorization value to that InfoObject
    Is there any way to hide a column in a query (with authorization concept) avoiding to redisign a new query?
    For your existing query, above two are conflicting. So guess you have to move with redesign/new query.
    Regards,
    Arpan Paik

  • RPD - Cannot obtain number of columns for the query result :Working with MS SQL 2012 schema

    Hi All,
    I have created my warehouse in MS SQL 2012.
    For management purpose, I have created different schemas in SQL database
    In RPD, Physical layer, when i view data > I get error as
    [nQSError:16002] Cannot obtain number of columns for the query result.
    [nQSError:16001] ODBC error state : S0002 code : 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name 'tbl'..
    [nQSError:16001] ODBC error state : S0002 code : 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server] Statements could not be prepared..
    I have already browsed : OBIEE 11g Strange ODBC Driver Error with SQL Server : Total Business Intelligence ... did not help me
    please help!!!

    Hi All,
    After all R&D it is been found that Oracle business administrator( RPD) needs default dbo schema. It doesn't accept custom schema for pulling data.
    If anybody have other views please share.!!
    Thank you

  • Column in child query

    Hi,
    I have a master and a detail query.
    In my master query( with col a) I need to access column b from the child query.
    I need to calculate a-b in the master query. I'm getting an error trying to do that.
    Could someone pls help me.
    Thanks.

    Tim,
    You're probably getting some kind of frequency error, right? The problem is that Reports doesn't (and can't) know which value of the child query you mean.
    Let's take a dumb example using the famous emp and dept tables. Say that my master query is select * from dept, and my child query is select * from emp. I link these two queries on deptno.
    I then try and create a formula column in the dept group that does something like return(dept.deptno - emp.empno).
    This will fail because there may be more than one empno for that deptno - how would Reports choose which one to use?
    If you know that there's only going to be one child record return for each master record then you could create a summary column in the master group that does a First on the value in the child group, and then use this summary column in your formula.
    If you aren't sure that there will be only one child record returned for each master record, then you probably want to revisit your logic and determine what you're trying to calculate!
    Hope this helps,
    Danny

Maybe you are looking for

  • Network File sharing in SharePoint 2013 portal

    Hi Everyone I have a set of network folders(shared folder in some server) and want to make use of all this in SharePOint as a portal. So that i can eliminate the use of Network folder sharing concept. Bacially i need to know whether we have any OOB t

  • My Query takes too long ...

    Hi , Env   , DB 10G , O/S Linux Redhat , My DB size is about 80G My query takes too long ,  about 5 days to get results , can you please help to rewrite this query in a better way , declare x number; y date; START_DATE DATE; MDN VARCHAR2(12); TOPUP V

  • Translating ACCOUNT at Historical Rate

    Hi all, Can someone please help because there does not seem to be anything in the documentation regarding this or I must be missing it? I have several ACCOUNTs that need to be translated at historical rates.  In other words, users will enter the Loca

  • Why the PI Objects can't be renamed ?

    Hi, I am curious to know as to why the ESR or ID objects which we create, like data type, message type, mapping object etc., can't be renamed .  Please let me know. Regards Venkat.

  • LOG_BUFFER = 2MB or 3MB

    I am getting diffirent log buffer threshold greater than zero.... current LOG_BUFFER = 2097152. Total RAM= 16GB CPU = 4 ( Dual core) redo buffer allocation retries = 23 redo log space requests=22 redo log space wait time=118 log file sync = 3865 log