How to ensure result of null will default to datatype of column

I have a question
suppose i have two tables with customers and Sales transactions
create SalesTransactionTBL
customerID
,itemID
,itemQuanity
,itemPrice
,orderDateTime
create customerTbl
customerID
customerName
Some customers have bought something as found in SalesTransactionTBL,
some just registered and hand't brought anything and not found in SalesTransactionTBL
If I left join two tables based on customerID, i will get null on many of the fields from SalesTransactionTbl
select *
from customerTbl c
left join SalesTransactionTBL s
on c.CustomerID =s.CustomerID
what is the way to ensure the result of the null value will default to something based on the data type of the column?

What do you mean by ...
+what is the way to ensure the result of the null value will
default to something based on the data type of the column?+
Can you please describe / elaborate?
Why do you want to ensure this?
In Oracle, null value does not have a specific data type.
The data type of columns themself will (by default) will be based on data type of columns from base tables.
sudhakar@ORCL>drop table t1;
Table dropped.
sudhakar@ORCL>create table t1 (c1 int , s1 varchar2(20), d1 date);
Table created.
sudhakar@ORCL>drop table t2;
drop table t2
ERROR at line 1:
ORA-00942: table or view does not exist
sudhakar@ORCL>create table t2 (c2 int , s2 varchar2(20), d2 date);
Table created.
sudhakar@ORCL>
sudhakar@ORCL>insert into t1 values(1,'AAA',sysdate-3);
1 row created.
sudhakar@ORCL>insert into t1 values(2,'BBB',sysdate-2);
1 row created.
sudhakar@ORCL>commit;
Commit complete.
sudhakar@ORCL>select * from t1,t2
  2  where c1 = c2(+);
        C1 S1                   D1                C2 S2                   D2
         1 AAA                  06-MAY-10
         2 BBB                  07-MAY-10
sudhakar@ORCL>create view v1 as
  2  select * from t1,t2
  3  where c1 = c2(+);
View created.
sudhakar@ORCL>desc v1
Name                                                  Null?    Type
C1                                                             NUMBER(38)
S1                                                             VARCHAR2(20)
D1                                                             DATE
C2                                                             NUMBER(38)
S2                                                             VARCHAR2(20)
D2                                                             DATE
sudhakar@ORCL>

Similar Messages

  • How to Ensure that a Textbox Will Stay Alinged with a Matrix in SSRS 2008?

    Hello All,
    I am very frustrated with this situation that I have at the moment regarding a matrix.  My matrix is laid out and styled the way that I like and it works, however I need to add a title above it and i've chosen to do this with a separate textbox. 
    The problem I now have is that when I run the report, the textbox may or may not be the same length as the matrix. 
    What method can I use to ensure that my matrix will always line-up correctly with my textbox?
    In a very general way (screenshots are stupidly not allowed in this forum), here is what I am looking for:
                               WEEKLY SELL-OUT
    Row Group  Column title 1    Column title 2   Column title 3
    WEEKLY SELL-OUT is the title which I need.  I've put a rectangle around the matrix and tried aligning them, but each time the data is refreshed the matrix may or may not be aligned with the WEEKLY SELL-OUT textbox.
    I've also tried putting a title within the left corner texbox within the matrix itself, however this is ugly and not what I want.  I need it to be centered with the entire matrix and not just withing the textbox. Doing it this way does this to my matrix:
    WEEKLY SELL-OUT
    Row Group  Column title 1    Column title 2   Column title 3
    Again this is not what I want.  I want it to be centered and using the textboxes inside the matrix does not allow me to do that.  Also, i'm not able to merge cells within a row in a matrix, only within a column.
    Surely there MUST be a way to do this properly - can someone help?

    Seemed like a good idea -- to embed the matrix inside the lower cell of a 1-column, 2-row table -- but I couldn't get it to work.  When attempting preview, it resulted in an error -- "The tablix 'matrix1' has a detail member
    with inner members.  Detail members can only contain static inner members."  The matrix works fine outside of the table.  I'm not sure if properties of the matrix or table could be adjusted to remedy the error.  The 'CanGrow'
    property for the table is set to 'True'.
    UPDATE:  It is critical to put the matrix in the
    Header cell, not the
    Details cell.  Delete the Details row (cell).  Create a new header row above the existing Header that contains the matrix in order to add a title and center it.

  • How to get result of querry independet of a datatype?

    Hi All!
    I try to write a program, that calls stored procedures in a database independent of a name and arguments list. To get a result of a query I must call one of the functions getInt(), getString() etc. of CallableStatement. I'd like to write a wrap function, for instance getResult(), that get the result independent of the result's type. Has anybody any idea, how I can do it?
    Any help will be appreciate.
    Regards,
    Andrej.

    Hi Justin,
    Even we have been writing a kind of these generic methods to send a query to database, fetch the Resultset and then populate an ArrayList with the Resultset data.
    What do you get out of this ?
    -> Less code to maintain
    -> Single point of access to datasource
    -> JDBC Code reuse
    i agree that it might cost some cpu cycles in populating an ArrayList and then doing the casting again. But isn't it worth all the above credits.
    An example of such a method is
      public ArrayList execute( String query, ArrayList params )
                    throws SQLException {
        Connection con = null; // Database Connection object
        ArrayList rowset = new ArrayList();
        try {
          // Get the Database Connection
          con = connector.getConnection();
          // Use PreparedStatement object to execute the SQL Query
          PreparedStatement pst = con.prepareStatement( query );
          // Bind the columns values from the ArrayList object
          if( params != null ) {
            for( int i = 0; i < params.size(); i++ ) {
              pst.setObject( i + 1, params.get( i ) );
          // Execute the Query to get the ResultSet object
          ResultSet rst = pst.executeQuery();
          // Get column count from ResultSet Metadata
          int colCount = rsmtdt.getColumnCount();  // This may not be the correct syntax
          // Populate ArrayList
          while(rset.next()) {
            ArrayList row = new ArrayList();
         for(int i=1;i<=colCount;i++)
           row.add(rset.getObject(i);
         rowset.add(row);
          // Close the ResultSet and Statement
          rst.close();
          pst.close();
        } catch( SQLException ex ) {
          throw new DBException( "Unable to execute the SQL Query in execute "+
                                     "method of DBBroker class of given status " +
                                 " : " + ex.getMessage() );
        } catch( Exception ex ) {
          throw new DBException( "Exception thrown in execute() method of " +
                                 "DBBroker class of given status : " +
                                  ex.getMessage() );
        } finally {
          try {
            connector.releaseConnection( con ); // Releases the connection
          } catch( DBConException ex ) {
            throw new DBException( "Unable to release the connection of given " +
                                   "status : " + ex.getMessage() );
        return rowset;
      }Regards
    Elango.

  • HT4897 I created an alias precisely because I wanted to make it the new default name and then quickly realized it wasn't possible. How long after deleting the alias will it become available again so that I can create a new account with it?

    I created an alias precisely because I wanted to make it the new default name and then quickly realized it wasn't possible. How long after deleting the alias will it become available again so that I can create a new account with it?
    I'm trying to make iCloud mail my primary email but I'm concerned that I may have lost the perfect email address forever.

    I have the same problem. After our wedding I've created an alias ([email protected]) to my actual AppleID Account ([email protected]). Now I'd the idea to delete the alias and my actual AppleID to create a new AppleID with ([email protected]).
    Is there really no possibilty to do this?
    Thanks in advance for quick and positive feedback.

  • How do i Restore Preview as my default viewer when using Safari,seems adobe has hi jacked Safari,if i uninstall adobe safari will not open any pdf files.

    How do i restore Preview as my default viewer.
    Seems adobe has hi-jacked Safari and and opens using abobe not preview.
    Have uninstalled adobe but safari then will not display any pdf files.
    Preview still works fine to view existing downloaded files.

    Niac --
    What kind of files?  PDFs?  or Others as well?
    If you want Preview to open all PDFs, then find a PDF on your HD.
    Highlight it, and then press the Apple/Comand key along with th letter " i " key.
    When the window comes up, look down to the "Open with" line, and change it from Adobe to Preview.
    Then look slightly below, and select "Change All."
    Now, all PDFs should open with Preview.

  • When I load itunes it defaults to the store and then I get a Blue Screen.  Does anyone know how to change itunes so that it will default to My Music rather than store.  I need to be able to do this before I load itunes.

    When I load itunes it defaults to the store and then I get a Blue Screen.  Does anyone know how to change itunes so that it will default to My Music rather than store.  I need to be able to do this before I load itunes.

    I solved the problem with the assistance of apple support knowledgebase.  Refer to TS3441.

  • How do I get Google to be default when I open up-a-new-tab? Which Add-Ons will I need to install? Thank You, Alan

    How do I get Google to be default when I open up-a-new-tab? Which Add-Ons will I need to install? Thank You, Alan

    See: http://sogame.awardspace.com/newtaburl/
    <u>'''''Other Issues''''': to correct security/stability issues</u>
    <u>'''Update Java'''</u>: your ver. 1.5.0_06; current ver. 1.6.0.20 (<u>important security update 04-15-2010</u>)
    (Firefox 3.6 and above requires Java 1.6.0.10 and above; see: http://support.mozilla.com/en-US/kb/Java-related+issues#Java_does_not_work_in_Firefox_3_6)
    ''(Windows users: Do the manual update; very easy.)''
    See: '''[http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates Updating Java]'''
    Do the update with Firefox closed.

  • How can the query results include null if it's a required field on the front end?

    I executed a query that simply asked for all data points on a single table.
    I am trying to figure out why the query would report back as having all "Null" values in 3 of 10 columns. The information is required for the end user to enter before the system allows
    them save a record.

    You understand correctly.
    When you look up de service code do you get an description from table DDLValues?
    THIS IS CORRECT
    If the service code is in there, you should check why de ID is not correct.
    I dont know what this means. Check why the "ID" is not correct? What ID?
    The DDLvalues table has no objects on which it depends. It that normal?
    This is the code for the individual services
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[IndividualService](
    [ID] [bigint] IDENTITY(1,1) NOT NULL,
    [StudentID] [uniqueidentifier] NULL,
    [DateofService] [datetime] NULL,
    [ServiceCode] [int] NULL,
    [FocusCode] [int] NULL,
    [InterventionCode] [int] NULL,
    [ClinicianID] [uniqueidentifier] NULL,
    [Schoolid] [bigint] NULL,
    [Approved] [int] NULL CONSTRAINT [DF_IndividualService_Approved]  DEFAULT ((0)),
     CONSTRAINT [PK_IndividualService] PRIMARY KEY CLUSTERED 
    [ID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_aspnet_Users] FOREIGN KEY([StudentID])
    REFERENCES [dbo].[Students] ([StudentID])
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_aspnet_Users]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_aspnet_Users1] FOREIGN KEY([ClinicianID])
    REFERENCES [dbo].[aspnet_Users] ([UserId])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_aspnet_Users1]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_DDLValues] FOREIGN KEY([FocusCode])
    REFERENCES [dbo].[DDLValues] ([DDLValueID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_DDLValues1] FOREIGN KEY([InterventionCode])
    REFERENCES [dbo].[DDLValues] ([DDLValueID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues1]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_DDLValues2] FOREIGN KEY([ServiceCode])
    REFERENCES [dbo].[DDLValues] ([DDLValueID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues2]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_Schools] FOREIGN KEY([Schoolid])
    REFERENCES [dbo].[Schools] ([SchoolID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_Schools]
    GO

  • It says iCal will default events with no end time to one hour..and mine used to..but since I upgraded to Lion it doesn't.  Any suggestions as to how I can get it to default events to one hour?

    My iCal used to default to one hour when I posted an event with a start time and no end time.  The user guide says it will default to one hour.  Since I started using OS Lion, my calendar doesn't do that.  Can anyone suggest a way for me to get the calendar to default to one hour again?  Thanks.

    Dana,
    Here are some iCal data entry tips from iCal Help:
    Enter a name, date, and time duration for the event, and then press Return.
    For example, you can enter “Super Bowl Party Feb 5,” “Movie with Rebecca on Friday at 7pm,” “Soccer Game on Saturday from 11am-1pm,” or “Breakfast with Jon,” and then press Return.
    If you don’t enter a time duration for the event, iCal sets the event’s duration to 1 hour.
    If you don’t enter any time information for the event, iCal makes the event an all-day event.
    If you enter “breakfast” or “morning,” iCal sets the event to start at 9 a.m.
    If you enter “lunch “ or “noon,” iCal sets the event to start at 12 p.m.
    If you enter “dinner” or “night,” iCal sets the event to start at 8 p.m.

  • My iPod Touch won't turn on after it was plugged into my Xbox. The Xbox was off, I unplugged a wire to plug in my cable box, then there was a spark. I used my iPod and realized that it won't turn on. How do I know if it will still work?

    Anyone know how to fix it if it will still work? Also, it won't connect to iTunes, so don't tell me to restore it because it won't. Plus, it won't go into DFU mode either.

    Unable to contact the iOS software update server gs.apple.com
    Error 1004, 1013, 1638, 3014, 3194: These errors may be the result of the connection to gs.apple.com being redirected or blocked. Follow these steps to resolve these errors:
    Install the latest version of iTunes.
    Check security software and ensure that communication to gs.apple.com is allowed. Follow these stepsfor assistance with security software.
    Check the hosts file. The restore will fail if there is an active entry to redirect gs.apple.com. Follow theadvanced iTunes Store troubleshooting steps to edit the hosts file or revert to a default hosts file. See "Blocked by configuration: (Mac OS X/Windows) > Rebuild network information."
    Try to restore from another known-good computer and network.
    If the errors persist on another computer, the device may need service.

  • JDBC- RFC - JDBC    How to send result set to rfc  ?

    Hi Friends ,
                        I am working on scenario like .
              <b>          I have to read  data from a sql server using select statement and send same   data  to r3 ( using RFC  we are inserting the same as  a copy ) .
                        Then i have have get confirmation from R3 as data inserted succesfully  - Flag  .Then we have to come back to same table and update one field  flag as 'U'.</b>
                      For this I am using JDBC Sender Adapter and RFC Receiver Adapter .Will i use  as Synchronous  Interface ?
                      I think i have to use JDBC  Receiver Adapter    also to Complete the cycle .
                      Can you please clarify  the following....
                       1. how is that whole selected data will send to R3 . If i use Select statement in JDBC Sender Adapter  it will as resultset  .It will contain Multiple Rows right ?  Our RFC Will accept the parameter as string .
                        2. If we use the synchronous Interface will it send row by row from the result send Then  get back the result from R3 and come back again to JDBC ( Database ) and  update the required field ?
                        3. In JDBC Sender Adapter , the Update Parameter doing the Updation  Part  prior to get the status from R3. How to handle this ?
                       4. Do i need to configur teh separate JDBC Receiver adpater for this updation part ? Then We cann't use Synchronous Interface right ?
                     5 . Will JDCB Sender  Adapter get the result set (by select statement )  and send to r3 as row by row and get the confirmation message as inserted  ?
    Best Regards .,
    V.Rangarajan

    Hi Udo ,
                   Thanks for your reply . If i have used the synchronnous RFC Calls  , that RFC will return the flag as 'Y' or 'N'  , for  Either succesfully inserted or Not successful .
                      In this synchronous  how can i use the JDBC Receiver adapter ?
                     If 'Y'  or 'N' I have to update the<b> same table ,same row</b> which have sent to RFC .  My doubt , we are  wrirtng the  SQL  select query as  "  <b>select * from table  name where UpdateStatus is null</b> " .
                     So it will return multiple rows right ?   I have to uses the synchronous response form RFC to update the row of the  same table using JDBC Adapter right ?
                   Can you please explain me little bit more ? I am new to xi .
    Best Regards .,
    V.Rangarajan

  • IPhoto book - How to ensure if photo size is enough ?

    How to ensure if photo size is enough for the XL size I select? It appers good on the preview, does it confirm it will turn out to be same when printed out? Thanks!

    If you do not have am image size warning and you preview your book it will be fine -
    Before ordering your book preview it using this method - http://support.apple.com/kb/HT1040 - and save the resulting PDF for reference - the delivered book will match it.
    LN

  • How to find default value of a column ?

    hi , alok again,
    i have to find default value of a column.
    Acutally i have found , column's max width, its nullability, precision, scale, type, but NOT default value.
    I will have to use the default value and nullability while validating user's input.
    ResultSetMetaData doesnot contain any method any such method...
    Pls help,
    how can i do so.
    Any idea will be highly appreciated.
    Thanks in adv.
    Alok

    Hi,
    After you get the resultset from DatabaseMetaData.getColumns() as shown by sudha_mp you can use the following columns names to retrieve metadata information:
    Each column description has the following columns:
    TABLE_CAT String => table catalog (may be null)
    TABLE_SCHEM String => table schema (may be null)
    TABLE_NAME String => table name
    COLUMN_NAME String => column name
    DATA_TYPE int => SQL type from java.sql.Types
    TYPE_NAME String => Data source dependent type name, for a UDT the type name is fully qualified
    COLUMN_SIZE int => column size. For char or date types this is the maximum number of characters, for numeric or decimal types this is precision.
    BUFFER_LENGTH is not used.
    DECIMAL_DIGITS int => the number of fractional digits
    NUM_PREC_RADIX int => Radix (typically either 10 or 2)
    NULLABLE int => is NULL allowed.
    columnNoNulls - might not allow NULL values
    columnNullable - definitely allows NULL values
    columnNullableUnknown - nullability unknown
    REMARKS String => comment describing column (may be null)
    COLUMN_DEF String => default value (may be null)
    SQL_DATA_TYPE int => unused
    SQL_DATETIME_SUB int => unused
    CHAR_OCTET_LENGTH int => for char types the maximum number of bytes in the column
    ORDINAL_POSITION int => index of column in table (starting at 1)
    IS_NULLABLE String => "NO" means column definitely does not allow NULL values; "YES" means the column might allow NULL values. An empty string means nobody knows.
    SCOPE_CATLOG String => catalog of table that is the scope of a reference attribute (null if DATA_TYPE isn't REF)
    SCOPE_SCHEMA String => schema of table that is the scope of a reference attribute (null if the DATA_TYPE isn't REF)
    SCOPE_TABLE String => table name that this the scope of a reference attribure (null if the DATA_TYPE isn't REF)
    SOURCE_DATA_TYPE short => source type of a distinct type or user-generated Ref type, SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF)
    Regards,
    bazooka

  • How to refresh the grid so that default  values come on adding new row.

    Hi Experts,
    In alv grid while adding new row, i want some 2-3 column values to come by default from already existing row in grid.
    i am getting new row in internal table with 2-3 default values and rest columns blank on adding new row in alv grid
    but the entire row is coming blank, not able to get the default values in new row
    how can i refresh the grid so that default  values come on adding new row.
    thanks

    Hi Surabhi,
    Use this in Interactive section even if you are doing simple ALV.
    DATA:
    lv_ref_grid TYPE REF TO cl_gui_alv_grid.
    CLEAR : gv_tcode.
    *-- to ensure that only new processed data is displayed
    IF lv_ref_grid IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    e_grid = lv_ref_grid.
    ENDIF.
    IF NOT lv_ref_grid IS INITIAL.
    CALL METHOD lv_ref_grid->check_changed_data.
    ENDIF.
    THis will solve your problem.
    Regards,
    Vijay

  • How to ensure FundCenter selection = blank when running FM drilldown report

    How to ensure blank value in the "Funds Center" selection parameter when running FM drilldown report 2FMB40* (Assigned Funds Report)?
    We tried to save a report variant with protected blank value in the "&0FICTR" variable (hierarchy node), and we also used FMEV to turn-off default value for this variable.  However, during report execution it still takes value from the user parameter "FIS".
    To prevent the system from using "FIS", we can only save the report variant with Funds Center = * (or the top-most node).  Unfortunately, these would give different extraction results which we do not want.
    Any advice how to get round this?

    Referring SAP Note 390953, I don't know how to apply the solution of "using generic symbol # as an initial value"....
    (1)  I tried to save a report variant with # in the Funds Center field, but got error message "no matching funds center found" and couldn't proceed.
    (2)  I also tried tcode FMEV to set the variables &0FICTR, &0FICTRA ... with default value # (in table TKESV), yet still got no effect ... as user parameter "FIS" was adopted during report execution.
    Any further suggestion please?

Maybe you are looking for