Difference between "print" statements and "select" statements , TSQL

 What is the difference between "print" statements and "select" statements when it omces to debugging and watching varibles in the stored procs .....

SELECT statement is part of the ANSI SQL language.
PRINT command is not part of the SQL language, it is used for debugging in T-SQL.
BOL:" Returns a user-defined message to the client.
A message string can be up to 8,000 characters long if it is a non-Unicode string, and 4,000 characters long if it is a Unicode string. Longer strings are truncated. The
varchar(max) and nvarchar(max) data types are truncated to data types that are no larger than
varchar(8000) and nvarchar(4000).
RAISERROR can also be used to return messages. RAISERROR has these advantages over PRINT:
RAISERROR supports substituting arguments into an error message string using a mechanism modeled on the printf function of the C language standard library.
RAISERROR can specify a unique error number, a severity, and a state code in addition to the text message.
RAISERROR can be used to return user-defined messages created using the sp_addmessage system stored procedure."
LINK: http://technet.microsoft.com/en-us/library/ms176047.aspx
The SSMS (client software) returns SELECT output to Results and PRINT output to Messages.
The SQLCMD -o (output file) option captures all outputs into one file mixed.
Kalman Toth Database & OLAP Architect
T-SQL Scripts at sqlusa.com
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Similar Messages

  • Difference between Print Immediately and Send to Spool for later print

    I'm having an issue in my R3 4.7 with printing.
    I have recently migrated to unicode, but I decided not to stick this into the Unicode section for now.
    The value of parameter rspo/host_spool/print is:
    /usr/local/bin/multiprint &P &F &C "&R" "&T" &c "&o" "&t" 2>&&1;
    This is the problem.
    If I have a print list and I decide to print it, I can send it the spooler for immediate print.
    That works fine, it comes off the printer.
    I see this in the dev trace file:
    COMMAND to execute is /usr/local/bin/multiprint cups_hwps01
    /usr/sap/<SID>/DVEBMGS00/data/000bC8f3.<SID>"MYUSERNAME" "" 1 "MYUSERNAME" ""
    Using Hostspool command: '/usr/local/bin/multiprint cups_hwps01
    /usr/sap/<SID>/DVEBMGS00/data/000bC8f3.<SID>1 "MYUSERNAME" "" 1 "MYUSERNAME"
    This is correct.
    Now, if I have a print list and select 'Send to SAP Spooler only for now' I can see it in SP01.
    However, if I try and print it from SP01 I see an error.
    There is an error in the STDERR2 file as follows:
    sh: -c: line 0: unexpected EOF while looking for matching `"'
    sh: -c: line 1: syntax error: unexpected end of file
    I see this in the dev trace file:
    COMMAND to execute is /usr/local/bin/multiprint cups_whps06
    /usr/sap/DTD/DVEBMGS00/data/000aocyn.DTD 1 "PH4417" "" 1 "PH4417" "
    Note the last ". It seems SAP is truncating the command it calls.
    I've logged it with SAP but wondered if anyone else had encountered it?

    Seems it was a Kernel bug.  Fixed.

  • What's the difference between flash storage and solid state drive in MacBook Pro?

    What's the difference between MacBook Pro with flash storage and MacBook Pro with solid state drive?

    A SSD is packaged like any other notebook drive. Flash storage uses a different design and layout that connects directly to the motherboard using PCIe. It is faster than a normal SSD.
    SSD vs HDD: What's the Difference? | PCMag.com
    what are the differences between solid state drive and flash storage ...

  • What is the difference between hidden field and view state??

    Both view state and hidden field are use to store page specific information then, what is the difference between both of them??

    The ViewState of a page is actually stored in a large hidden field and it contains information about the entire page whereas a single hidden field that you define yourself is used to store some single value that should not be displayed.
    Please refer to the following page for more information about ASP.NET View State:
    http://msdn.microsoft.com/en-us/library/ms972976.aspx
    But please post your ASP.NET and web related questions at
    http://forums.asp.net in the future.
    Also, please remember to mark any helpful posts as answer.

  • Difference  between image version and selection

    I am trying to write a script that aperture will execute when I import files.  When I run the script after passing it a selection the script runs perfectly. When I run the script using ImportActionsForVersions which supposedly passes in a list of image versions the script has an issue when I export what I thought is an image version. It seems that there is an issue in the datat type being passed in from aperture vs what I get when I select them myself when I run the code on its own.
    Anyone have any thoughts?

    Frank,
    You actually helped me out a while ago just to get the ImportActionForVersion to work - started small. 
    First let me start with experience - I am just starting out with Applescript, I have written a fair amount of software for numerical analyses over the past 30 years. Startedin FORTRAN and then moved to C.  I am somewhat familiar with OO coding but not nearly as familiar as FORTRAN and C.  Applescript appears to me to be something different as well. Powerful but I have no idea what really goes on inside a program like Aperture.
    I have read and continue to re-read the Aperture Applescript manual, as well as several other Applescript guides, web resources and books.  I suspect that something hasn't yet sunk in that needs to sink in.
    I have not tried the exact example because quite frankly it didn't seem to fit what I wanted to do and I assume it would work just fine, running it wouldn't tell me anyting helpful. Perhaps that is simple minded.  I am guessing that the repeat loop is stepping through individual versions passed in by aperture and the tell block is for each version changing the preset based on the exif tag.
    I am hoping that I can loop through image versions in a similar fashion and then for each image version that has a CRW, CR2 or NEF file suffix I can export the file, convert it into a DNG and then reimport the DNG as master. 
    The code may not yet be complete but that is the intent and it works reasonably well using "on run".  I'd like this to work so it does this automatically in the future.
    So my code is below. Following my code is a sample of the output I am getting in the log file I am writing.
    To test this I import a couple of files from a compact flash card into aperture which then calls this script - as the log files indicate the script runs and the statement immediately before export curImg to exportFolder metadata embedded appears to be the last statement executed. Again when I use essentially the same code in a script that starts with on run and is called after I select a couple of pictures in aperture it runs just fine.
    property p_dngPath : "/Applications/Adobe DNG Converter.app/Contents/MacOS/Adobe DNG Converter"
    property p_dngArgs : " -p1 -c "
    property p_rawSuffices : {"crw", "cr2", "nef", "CRW", "CR2", "NEF"}
    property doLog_importAction : true
    property doLog_checkSetup : false
    property firstLog : true
    -- ------------------------------------------------------- log_event -------------------------------------------------------------------------------
    on importActionForVersions(imageVersionList)
              set tempDir to path to temporary items folder
              set numProc to 0
              set numErr to 0
              set numIgnore to 0
              set numOffline to 0
              set numImage to 0
              set completedFiles to 0
              set theMessage to "Executing importActionForVersion"
      log_event(theMessage, doLog_importAction) of me
              tell application "System Events"
                        set exportFolder to tempDir
                        set theMessage to "exportFolder is " & exportFolder
      log_event(theMessage, doLog_importAction) of me
              end tell
              tell application "Aperture"
                        set numVersions to count of imageVersionList
                        set shouldProceed to checkSetup() of me
                        set theMessage to "-----Starting Convert: " & numVersions & " version(s) passed in and shouldProceed is " & shouldProceed
      log_event(theMessage, doLog_importAction) of me
                        if shouldProceed is true then
                                  set theMessage to "----------If shouldProceed: Beginning evaluation of selected images versions"
      log_event(theMessage, doLog_importAction) of me
                                  repeat with versionReference in imageVersionList
                                            set curImg to contents of versionReference
                                            set numImage to numImage + 1
                                            set theMessage to "---------------Repeat with: Operating on image version " & numImage & " of " & numVersions
      log_event(theMessage, doLog_importAction) of me
                                            set fileName to value of other tag "FileName" of curImg
                                            set theMessage to "---------------Repeat with: The file filename is " & fileName
      log_event(theMessage, doLog_importAction) of me
                                            set curImgonline to online of curImg
                                            set theMessage to "---------------Repeat with: curImg online " & curImgonline
      log_event(theMessage, doLog_importAction) of me
                                            if online of curImg is true then
                                                      set theMessage to "--------------------if online: curImg " & numImage & " of " & numVersions & " is online"
      log_event(theMessage, doLog_importAction) of me
                                                      set theSuffix to (rich text -3 thru -1 of fileName) as string
                                                      set theMessage to "--------------------if online: The file suffix is " & theSuffix
      log_event(theMessage, doLog_importAction) of me
      -- if the suffix identifies files as needing to be converted
                                                      if p_rawSuffices contains theSuffix then
                                                                set theMessage to "--------------------if p_rawSuffices: p_rawSuffices contains theSuffix " & theSuffix
      log_event(theMessage, doLog_importAction) of me
      -- --------------------------------------------------------------------- determine the image's containing Project
                                                                set srcProjPath to value of other tag "MasterLocation" of curImg
                                                                if srcProjPath contains ">" then
                                                                          tell AppleScript
                                                                                    set originalDelimiters to text item delimiters
                                                                                    set the text item delimiters to " > "
                                                                                    set p_list to text items of srcProjPath
                                                                                    set the text item delimiters to originalDelimiters
                                                                                    set srcProjName to (item -1 of p_list)
                                                                          end tell
                                                                else
                                                                          set srcProjName to srcProjPath
                                                                end if
                                                                set theProject to project srcProjName
                                                                set theMessage to "--------------------if p_rawSuffices: Source Project Path is " & srcProjPath & " and the project name is " & srcProjName
      log_event(theMessage, doLog_importAction) of me
                                                                set numProc to numProc + 1
                                                                set theMessage to "--------------------if p_rawSuffices: Number Processed is " & numProc
      log_event(theMessage, doLog_importAction) of me
                                                                set theMessage to "--------------------if p_rawSuffices: tempDir is " & tempDir
      log_event(theMessage, doLog_importAction) of me
                                                                set theMessage to "--------------------if p_rawSuffices: curImg is not empty"
      log_event(theMessage, doLog_importAction) of me
      export curImg to exportFolder metadata embedded
      --naming folders with folder naming policy "Project Name"
                                                                set theMessage to "--------------------if p_rawSuffices: curImg was exported"
      log_event(theMessage, doLog_importAction) of me
      --set theRAWs to export curImg to tempDir
                                                                set theMessage to "--------------------if p_rawSuffices: theRAWS have been set"
      log_event(theMessage, doLog_importAction) of me
                                                                set theRAW to item 1 of theRAWs
                                                                set theMessage to "--------------------if p_rawSuffices: theRaw is " & theRAW & "numProc is " & numProc
      log_event(theMessage, doLog_importAction) of me
                                            --          tell application "Finder" to reveal theRAW
                                            set RAWPOSIX to POSIX path of theRAW
                                            set theMessage to "Convert: RawPOSIX Path is " & RAWPOSIX
                                            log_event(theMessage, doLog_importAction) of me
                                            set s_script to ((quoted form of p_dngPath) & space & p_dngArgs & space & (quoted form of RAWPOSIX)) as string
                                            do shell script (s_script)
                                            set DNGPOSIX to ((rich text 1 thru -4 of (RAWPOSIX as string)) & "dng") as string
                                            set theMessage to "Convert: The DNG POSIX Path is " & DNGPOSIX
                                            log_event(theMessage, doLog_importAction) of me
                                            tell application "Finder"
                                                      set theDNG to (POSIX file DNGPOSIX) as alias
                                                      delete theRAW
                                            end tell
                                            set theNewMasters to import {theDNG} by moving into theProject
                                            set theNewMaster to (item 1 of theNewMasters)
                                            -- ---------------------------------------- Copy annotations from curImg to theNewMaster
                                            repeat with curTag in IPTC tags of curImg
                                                      set tagName to name of curTag
                                                      set tagValue to value of curTag
                                                      tell theNewMaster
                                                                try
                                                                          make new IPTC tag with properties {name:tagName, value:tagValue}
                                                                end try
                                                      end tell
                                            end repeat
                                            repeat with curTag in custom tags of curImg
                                                      set tagName to name of curTag
                                                      set tagValue to value of curTag
                                                      tell theNewMaster
                                                                try
                                                                          make new custom tag with properties {name:tagName, value:tagValue}
                                                                end try
                                                      end tell
                                            end repeat
                                                                set theMessage to "--------------------if p_rawSuffices: Finished processing item " & numProc
      log_event(theMessage, doLog_importAction) of me
                                                      else -- No conversion needed
                                                                set numIgnore to numIgnore + 1
                                                                set theMessage to "--------------------if NOT p_rawSuffices: p_rawSuffices DOES NOT contains theSuffix " & theSuffix & "numIgnore= " & numIgnore
      log_event(theMessage, doLog_importAction) of me
                                                      end if -- if Suffix
                                            else
                                                      set numOffline to numOffline + 1
                                                      set theMessage to "---------------if online: curImg " & numImage & " of " & numVersions & "is OFFLINE numOffline files =" & numOffline
      log_event(theMessage, doLog_importAction) of me
                                            end if -- ---------------------- image is online
                                            set completedFiles to completedFiles + 1
                                            set theMessage to "---------------Repeat with: completedFiles " & completedFiles
      log_event(theMessage, doLog_importAction) of me
                                  end repeat -- imageVersionList
                                  set theMessage to "-----ImportActionsForVersions: Just Finished imageVersionList repeat loop"
      log_event(theMessage, doLog_importAction) of me
                                  set theOut to ("Images selected:    " & numVersions & return)
                                  set theOut to (theOut & "                   Images ignored:     " & numIgnore & return)
                                  set theOut to (theOut & "                   Images processed: " & numProc & return)
                                  set theOut to (theOut & "                   Offline images:       " & numOffline & return)
                                  set theOut to (theOut & "                   Errors:                   " & numErr)
                                  set theMessage to theOut
      log_event(theMessage, doLog_run) of me
      -- display alert "Done!" message theOut
                        else
                                  display alert "Error on setup" message "There was an error with your setup. Please verify that you are running Mac OS X 10.5.2 or later and have the Adobe DNG Converter installed in your Applications folder."
                        end if -- ------------------------- shouldProceed
              end tell
    end importActionForVersions
    -- ------------------------------------------------------- checkSetup -------------------------------------------------------------------------------
    on checkSetup()
              set isOK to true
              set theMessage to "Entered checkSetup"
      log_event(theMessage, doLog_checkSetup)
      -- -------------------------------------- Check Mac OS X's version
              tell application "Finder"
                        set theMessage to "checkSetup-1 tell finder"
      log_event(theMessage, doLog_checkSetup) of me
                        set theVers to (get version)
                        considering numeric strings
                                  if theVers ≥ "10.5.2" then
                                            set isOK to true
                                  else
                                            set isOK to false
                                  end if
                        end considering
              end tell
              set theMessage to "checkSetup-1 theVers is " & theVers
      log_event(theMessage, doLog_checkSetup) of me
      -- -------------------------------------- Check for the DNG converter
              tell application "Finder"
                        set theMessage to "checkSetup: tell Finder"
      log_event(theMessage, doLog_checkSetup) of me
                        try
                                  set theMessage to "checkSetup: tell trying"
      log_event(theMessage, doLog_checkSetup) of me
                                  set theApp to item "Adobe DNG Converter" of folder "Applications" of startup disk
                                  set theMessage to "checkSetup: set theApp"
      log_event(theMessage, doLog_checkSetup) of me
                        on error
                                  set theMessage to "checkSetup: on error"
      log_event(theMessage, doLog_checkSetup) of me
                                  set isOK to false
                                  set theMessage to "checkSetup: set isOK" & isOK
      log_event(theMessage, doLog_checkSetup) of me
                        end try
              end tell
              set theMessage to "checkSetup-on exit isOK is " & isOK
      log_event(theMessage, doLog_checkSetup) of me
              return isOK
    end checkSetup
    -- ------------------------------------------------------- log_event -------------------------------------------------------------------------------
    on log_event(theMessage, yesDo)
              if yesDo then
                        set theLine to (do shell script ¬
                                  "date +'%Y-%m-%d %H:%M:%S'" as string) ¬
                                  & " " & theMessage
                        if firstLog then
                                  do shell script "echo " & quoted form of theLine & "> ~/Library/Logs/Aperture_Convert-events.log"
                                  set firstLog to false
                        else
                                  do shell script "echo " & quoted form of theLine & ">> ~/Library/Logs/Aperture_Convert-events.log"
                        end if
              end if
    end log_event
    -------- LOG FILE
    2012-08-13 20:38:41 Executing importActionForVersion
    2012-08-13 20:38:41 exportFolder is Macintosh HD:private:var:folders:rk:24mylhfd1h7dflbsg90x51100000gn:T:TemporaryItems:
    2012-08-13 20:38:48 -----Starting Convert: 2 version(s) passed in and shouldProceed is true
    2012-08-13 20:38:48 ----------If shouldProceed: Beginning evaluation of selected images versions
    2012-08-13 20:38:48 ---------------Repeat with: Operating on image version 1 of 2
    2012-08-13 20:38:49 ---------------Repeat with: The file filename is IMG_2025.JPG
    2012-08-13 20:38:49 ---------------Repeat with: curImg online true
    2012-08-13 20:38:49 --------------------if online: curImg 1 of 2 is online
    2012-08-13 20:38:49 --------------------if online: The file suffix is JPG
    2012-08-13 20:38:49 --------------------if NOT p_rawSuffices: p_rawSuffices DOES NOT contains theSuffix JPGnumIgnore= 1
    2012-08-13 20:38:49 ---------------Repeat with: completedFiles 1
    2012-08-13 20:38:50 ---------------Repeat with: Operating on image version 2 of 2
    2012-08-13 20:38:50 ---------------Repeat with: The file filename is CRW_2037.CRW
    2012-08-13 20:38:50 ---------------Repeat with: curImg online true
    2012-08-13 20:38:50 --------------------if online: curImg 2 of 2 is online
    2012-08-13 20:38:50 --------------------if online: The file suffix is CRW
    2012-08-13 20:38:50 --------------------if p_rawSuffices: p_rawSuffices contains theSuffix CRW
    2012-08-13 20:38:50 --------------------if p_rawSuffices: Source Project Path is Untitled Project and the project name is Untitled Project
    2012-08-13 20:38:51 --------------------if p_rawSuffices: Number Processed is 1
    2012-08-13 20:38:51 --------------------if p_rawSuffices: tempDir is Macintosh HD:private:var:folders:rk:24mylhfd1h7dflbsg90x51100000gn:T:TemporaryItems:
    2012-08-13 20:38:51 --------------------if p_rawSuffices: curImg is not empty

  • Difference between At new and on change statement?

    What is the difference between at new and on change statement? Please explain with an example.

    hi
    on change of differs from at new in the following respects:
    It can be used in any loop construct, not just loop at. For example, it can be used within select and endselect, do and enddo, or while and endwhile, as well as inside get events.
    A single on change of can be triggered by a change within one or more fields named after of and separated by or. These fields can be elementary fields or field strings. If you are within a loop, these fields do not have to belong to the loop.
    When used within a loop, a change in a field to the left of the control level does not trigger a control break.
    When used within a loop, fields to the right still contain their original values; they are not changed to contain zeros or asterisks.
    You can use else between on change of and endon.
    You can use it with loop at it where . . ..
    You can use sum with on change of. It sums all numeric fields except the one(s) named after of.
    Any values changed within on change of remain changed after endon. The contents of the header line are not restored as they are for at and endat.
    REGARDS
    PRASANTH

  • Please  tell me the difference between CREATE OBJECT & CREATE DATA ,statements in CRMTECHNICAL

    Please  tell me the difference between CREATE OBJECT & CREATE DATA ,statements in CRMTECHNICAL

    found it on my own . the best way to do this is use the RetriveLimitedHierTreeCommand  with a search on the taxonomy table.

  • Differences between PDF (Interactive) and PDF (Print)

    What are the main differences between PDF (Interactive) and PDF (Print)?
    Now it seems to me that PDF (Interactive) is limited version of PDF (Print).
    Any links to read about this topic?
    Thank you in advance,
    Mykolas

    There's actually quite a few differences between (Interactive) and (Print).
    Here's a list of pointers written by Michael Ninness (previous product manager of InDesign and now working at Lynda.com) http://www.lynda.com/michaelninness
    I just got premission from him to post this (Thanks Michael!):
    Here is some info for you regarding what choices are being made under the hood when you choose File > Export > Adobe PDF (Interactive).
    Things that just happen or are included, with no choice in the dialog box:
    Hyperlinks, Bookmarks, Fast Web view, Compress Text and Line Art, Crop Image Data to Frames.
    Things that are not included, with no choice in the dialog box:
    Visible Guides/Grids, Hidden and Non-Printing Layers, Hidden and Non-Printing Objects, Marks & Bleeds, No Ink Manager or Simulate Overprint options.
    Things that you can choose:
    Security Settings, Embed Page Thumbnails, Create Tagged PDF, Create Acrobat Layers, Initial View, Initial Layout, Open in Full Screen Mode, Page Transitions, Image compression and resolution.
    Other:
    Fonts: Subset 100%
    Color Conversion: Destination
    Destination: sRGB
    Profile Inclusion Policy: Include Destination Profile
    Transparency Flattener: No Flattening
    And lastly, Compatibility is set to Acrobat 9 (PDF 1.7). This last point is important, and largely explains the main reason we split Interactive PDF out as a separate export choice from Print PDF. When you export an interactive PDF from CS5, included media is now written out to the Rich Media Annotation Layer, which means this content is played back via the embedded Flash Player within Acrobat Pro 9 or Adobe Reader 9 or higher. In previous versions, this content was written out to the Screen Annotation Layer, which meant this content was played back via QuickTime. This has been a long-standing headache for end users as playback across platforms was often inconsistent, would frequently break when Apple updated QuickTime, etc.
    Lastly, if you want to include rich media in your interactive PDFs (SWFs, audio and video), the only formats supported if you want to target Adobe PDF (Interactive) are MP3 for audio and FLV for video. Other file formats will need to be converted to these formats before you export to Interactive PDF. For video files, you’ll be able to convert to FLV with Adobe Media Encoder. For audio files, you can use any number for free audio conversion tools, including iTunes.
    Harbs

  • What is the difference between scheduling agreement and delivery schedule

    Hi
    1. Can anyone explain me the difference between scheduling agreement output
        and scheduling agreement delivey schedule
        Will the both look same in T.code SP02 when seeing the output for a document.
        Can anyone send me T.codes for above ones in purchasing.
    2. when seeing the Detailed statement for rebate agreement,there is item number.
        In which table can we see the item number for rebate agreement

    Hi,
    If you have to deal with more complex situations, you can define a delivery cycle in the material master record in addition to the planning cycle. In so doing, you determine the days on whichthe vendor delivers his goods. The delivery cycle is entered in the material master record as a planning calendar in the Planning calendar field.
    You enter a delivery cycle if the delivery date (or the goods receipt date) depends on the day on which you order the goods. For example, you carry out the planning run and place your orders on Mondays and Tuesdays. If you place the order on Monday, the delivery is made on Wednesday, if you wait until Tuesday to place the order, the delivery is not made until Friday
    Where as Planning calander is Three character number (numeric or using letters) that specifically identifies a PPS-planning calendar. The difference between Planning calender and delivery cycle is If you have selected the MRP type "MRP" and have set a period lot-sizing procedure according to planning calendar, you enter here which planning calendar is to be used.
    If you selected the "time-phased planning" MRP type, the planning calendar that you specify here defines the delivery cycle. This specifies the days on which the vendor delivers the material. You can enter the planning cycle in addition to the delivery cycle

  • Difference between modal screen and normal screen

    Hi everyone,
      Now,I am developing a dypro. when I create a modal screen ,I found no difference between normal screen and modal screen.
      eg. If I use the statement "call screen" , whatever which type of screen you use, the results look like the same. The same to the statement "call screen start at end at".

    Hi
    Screen type for modal dialog box
    If you activate this attribute, the screen is used as a modal dialog box. In the program, you call the screen with
    CALL SCREEN  STARTING AT  <top left>
                 ENDING   AT  <bottom right>.
    Unlike normal pop-ups, a modal dialog box has its own pushbuttons and title. There is no menu bar and command field entries are not possible.
    Normal screen type
    If you activate this attribute, the screen is flagged as a normal screen. This is the default setting.
    Alternatively, it may have the following special functions:
    Subscreen
    Modal dialog box
    Selection screen
    Class screen
    In the Screen Painter, you can choose between normal, subscreen, and modal dialog box.
    Selection screen and class screen attributes are assigned by the system.

  • Question about main difference between Java bean and Java class in JSP

    Hi All,
    I am new to Java Bean and wonder what is the main difference to use a Bean or an Object in the jsp. I have search on the forum and find some post also asking the question but still answer my doubt. Indeed, what is the real advantage of using bean in jsp.
    Let me give an example to illustrate my question:
    <code>
    <%@ page errorPage="errorpage.jsp" %>
    <%@ page import="ShoppingCart" %>
    <!-- Instantiate the Counter bean with an id of "counter" -->
    <jsp:useBean id="cart" scope="session" class="ShoppingCart" />
    <html>
    <head><title>Shopping Cart</title></head>
    <body bgcolor="#FFFFFF">
    Your cart's ID is: <%=cart.getId()%>.
    </body>
    <html>
    </code>
    In the above code, I can also create a object of ShoppingCart by new operator then get the id at the following way.
    <code>
    <%
    ShoppingCart cart = new ShoppingCart();
    out.println(cart.getId());
    %>
    </code>
    Now my question is what is the difference between the two method? As in my mind, a normal class can also have it setter and getter methods for its properties. But someone may say that, there is a scope="session", which can be declared in an normal object. It may be a point but it can be easily solved but putting the object in session by "session.setAttribute("cart", cart)".
    I have been searching on this issue on the internet for a long time and most of them just say someting like "persistance of state", "bean follow some conventions of naming", "bean must implement ser" and so on. All of above can be solved by other means, for example, a normal class can also follow the convention. I am really get confused with it, and really want to know what is the main point(s) of using the java bean.
    Any help will be highly apprecaited. Thanks!!!
    Best Regards,
    Alex

    Hi All,
    I am new to Java Bean and wonder what is the main
    difference to use a Bean or an Object in the jsp. The first thing to realize is that JavaBeans are just Plain Old Java Objects (POJOs) that follow a specific set of semantics (get/set methods, etc...). So what is the difference between a Bean and an Object? Nothing.
    <jsp:useBean id="cart" scope="session" class="ShoppingCart" />
    In the above code, I can also create a object of
    ShoppingCart by new operator then get the id at the
    following way.
    ShoppingCart cart = new ShoppingCart();
    out.println(cart.getId());
    ...Sure you could. And if the Cart was in a package (it has to be) you also need to put an import statement in. Oh, and to make sure the object is accessable in the same scope, you have to put it into the PageContext scope. And to totally equal, you first check to see if that object already exists in scope. So to get the equivalant of this:
    <jsp:useBean id="cart" class="my.pack.ShoppingCart"/>Then your scriptlet looks like this:
    <%@ page import="my.pack.ShoppingCart %>
    <%
      ShoppingCart cart = pageContext.getAttribute("cart");
      if (cart == null) {
        cart = new ShoppingCart();
        pageContext.setAttribute("cart", cart);
    %>So it is a lot more work.
    As in my mind, a normal class can also
    have it setter and getter methods for its properties.True ... See below.
    But someone may say that, there is a scope="session",
    which can be declared in an normal object.As long as the object is serializeable, yes.
    It may be
    a point but it can be easily solved but putting the
    object in session by "session.setAttribute("cart",
    cart)".Possible, but if the object isn't serializable it can be unsafe. As the point I mentioned above, the useBean tag allows you to check if the bean exists already, and use that, or make a new one if it does not yet exist in one line. A lot easier than the code you need to use otherwise.
    I have been searching on this issue on the internet
    for a long time and most of them just say someting
    like "persistance of state", "bean follow some
    conventions of naming", "bean must implement ser" and
    so on. Right, that would go along the lines of the definition of what a JavaBean is.
    All of above can be solved by other means, for
    example, a normal class can also follow the
    convention. And if it does - then it is a JavaBean! A JavaBean is any Object whose class definition would include all of the following:
    1) A public, no-argument constructor
    2) Implements Serializeable
    3) Properties are revealed through public mutator methods (void return type, start with 'set' have a single Object parameter list) and public accessor methods (Object return type, void parameter list, begin with 'get').
    4) Contain any necessary event handling methods. Depending on the purpose of the bean, you may include event handlers for when the properties change.
    I am really get confused with it, and
    really want to know what is the main point(s) of
    using the java bean.JavaBeans are normal objects that follow these conventions. Because they do, then you can access them through simplified means. For example, One way of having an object in session that contains data I want to print our might be:
    <%@ page import="my.pack.ShoppingCart %>
    <%
      ShoppingCart cart = session.getAttribute("cart");
      if (cart == null) {
        cart = new ShoppingCart();
        session.setAttribute("cart", cart);
    %>Then later where I want to print a total:
    <% out.print(cart.getTotal() %>Or, if the cart is a JavaBean I could do this:
    <jsp:useBean id="cart" class="my.pack.ShoppingCart" scope="session"/>
    Then later on:
    <jsp:getProperty name="cart" property="total"/>
    Or perhaps I want to set some properties on the object that I get off of the URL's parameter group. I could do this:
    <%
      ShoppingCart cart = session.getAttribute("cart");
      if (cart == null) {
        cart = new ShoppingCart();
        cart.setCreditCard(request.getParameter("creditCard"));
        cart.setFirstName(request.getParameter("firstName"));
        cart.setLastName(request.getParameter("lastName"));
        cart.setBillingAddress1(request.getParameter("billingAddress1"));
        cart.setBillingAddress2(request.getParameter("billingAddress2"));
        cart.setZipCode(request.getParameter("zipCode"));
        cart.setRegion(request.getParameter("region"));
        cart.setCountry(request.getParameter("country"));
        pageContext.setAttribute("cart", cart);
        session.setAttribute("cart", cart);
      }Or you could use:
    <jsp:useBean id="cart" class="my.pack.ShoppingCart" scope="session">
      <jsp:setProperty name="cart" property="*"/>
    </jsp:useBean>The second seems easier to me.
    It also allows you to use your objects in more varied cases - for example, JSTL (the standard tag libraries) and EL (expression language) only work with JavaBeans (objects that follow the JavaBeans conventions) because they expect objects to have the no-arg constuctor, and properties accessed/changed via getXXX and setXXX methods.
    >
    Any help will be highly apprecaited. Thanks!!!
    Best Regards,
    Alex

  • DIFFERENCE BETWEEN THE FULL AND BULK-LOGGED RECOVERY MODEL

    DIFFERENCE  BETWEEN THE  FULL AND BULK-LOGGED  RECOVERY MODEL 

    In bulk logged recovery mode certain bulk operations are minimally logged. In FULL recovery mode these are fully logged. These bulk operations are as mentioned below
    1. SELECT INTO
    2. BULK IMport operations including BULK INSERT and BCP
    3. INSERT INTO SELECT command using the OPENROWSET(BULK) function
    4. Partial updates to columns having large value data type
    5. Using WRITE clause in UPDATE statements
    6. Index operations e.g CREATE INDEX, ALTER INDEX REBUILD , DROP INDEX
    In Bulk Logged Recovery Mode when you execute these operations SQL Server only logs the fact that these operation occured and information about space allocation. The actual change in the data is maintained in the BCM (Bulk
    Changed Map)
    Since the actual changes are not recorded in the log file, the log file size in the reletively less in size but this tradeoff comes with the price of increased backup time. This is so because during the log backup its not just the log being backup, but also
    the extents that are marked by the Bulk Changed Map as changed.
    SQLEnthusiast
    http://sqlsimplified.com/
    Please click the Mark as Answer button if a post solves your problem!

  • I want to know the difference between Days column and Day1 Column

    Hi All,
    I used this query:
    SELECT to_char(return_date_time,'dd/mon/yyyy hh24:mi:ss') Test,
    DECODE ('I', 'I', DECODE (1, NULL, NULL, 0, NULL, SYSDATE + 1)) Days,
    DECODE ('I', 'I', SYSDATE + 1) Day1
    FROM fm_curr_locn
    WHERE patient_id = 'DU00002765'
    output: 
    Test
    Days
    Day1
    26/oct/2013 00:00:00
    26-OCT-13
    10/26/2013 3:06:59 PM
    I want to know the difference between Days column and Day1 column and why the days column didnt show the time
    Please anyone help.....
    Regards
    Shagar M

    Pleiadian wrote:
    It is the decode statement that is doing this.
    The format of decode is:
    decode(expression, search1, result1, search2, result2, searchn, resultn, default)
    All result fields must be of the same datatype and will be of the datatype of the first result (result1 in this example)
    In your example (the decode for the field Days) the first result is a NULL. I suspect (gurus? anyone?) that Oracle will use the varchar2 overload of the decode statement, and the date field will be converted to varchar2 using your NLS_DATE_FORMAT settings.
    In the second decode statment (Day1) the first result is of datatype date, so the result of the decode statement will be a date field (and will be parsed as such by your sql development tool)
    I agree, as NULL is the first result returned the datatype is undetermined, so Oracle is picking VARCHAR2 over others, and causing an implicit datatype conversion on the resultant date value, whereas the other which is returned as a date will use the local settings of the client tool being used.
    I can replicate the 'issue' in Toad, and it's rectified if we cast the first returned value of the decode statement...
    SELECT DECODE ('I', 'I', DECODE (1, NULL, CAST(NULL AS DATE), 0, NULL, SYSDATE + 1)) Days,
           DECODE ('I', 'I', SYSDATE + 1) Day1
    FROM dual

  • Difference between Field symbols and field group

    Hi experts,
    Can you please advice me what is the difference between field symbols and field groups.
    Thanks in advance,
    Logu.

    Field symbols: are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field Groups:
    A field group is a user-defined grouping of characteristics and basic key figures from the EC-EIS or EC-BP field catalog.
    Use
    The field catalog contains the fields that are used in the aspects. As the number of fields grows, the field catalog becomes very large and unclear. To simplify maintenance of the aspects, you can group fields in a field group. You can group the fields as you wish, for example, by subject area or responsibility area. A field may be included in several field groups.
    When maintaining the data structure of an aspect, you can select the field group that contains the relevant characteristics and basic key figures. This way you limit the number of fields offered.
    A field group combines several existing fields together under one name
    like
    FIELD-GROUPS: fg.
    then you can use one insert statement to insert values in fields of field-group.
    INSERT f1 f2 ... INTO fg.
    Field symbols
    If u have experience with 'C', then understand this to be similar to a pointer.
    It is used to reference another variable dynamically. So this field symbol will simply point to some other variable. and this pointer can be changed at runtime.
    FIELD-SYMBOLS <FS>.
    DATA FIELD VALUE 'X'.
    ASSIGN FIELD TO <FS>.
    WRITE <FS>.
    Field symbols: are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field Groups:
    A field group is a user-defined grouping of characteristics and basic key figures from the EC-EIS or EC-BP field catalog.
    Use
    The field catalog contains the fields that are used in the aspects. As the number of fields grows, the field catalog becomes very large and unclear. To simplify maintenance of the aspects, you can group fields in a field group. You can group the fields as you wish, for example, by subject area or responsibility area. A field may be included in several field groups.
    When maintaining the data structure of an aspect, you can select the field group that contains the relevant characteristics and basic key figures. This way you limit the number of fields offered.
    example :
    DATA: BEGIN OF SPTAB OCCURS 0,
    line(1000), " or type string
    END OF SPTAB.
    DATA: IDX LIKE SY-INDEX.
    field-symbols <FS1>.
    split tb_sip AT ';' INTO table sptab.
    LOOP AT SPTAB.
    IDX = IDX + 1.
    ASSIGN COMPONENT IDX OF STRUCTURE tb_detsip TO <FS1>.
    If sy-subrc = 0.
    <FS1> = SPTAB-line.
    Endif.
    Endloop.
    append tb_detsip.
    clear idx.
    Field Groups / Extracts
    http://help.sap.com/saphelp_46c/helpdata/EN/9f/db9ede35c111d1829f0000e829fbfe/frameset.htm
    Field Symbols
    http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb387a358411d1829f0000e829fbfe/frameset.htm
    Reward points if useful.

  • Difference between Field symbols and Field groups

    <b>Hi Friends,
    can you tell me the differences between Field symbols and Field groups? with any examples preferably?
    Regards
    Dinesh</b>

    Hi Dinesh,
    A field group combines several existing fields together under one name
    like
    FIELD-GROUPS: fg.
    then you can use one insert statement to insert values in fields of field-group.
    INSERT f1 f2 ... INTO fg.
    <b>Field symbols</b>
    If u have experience with 'C', then understand this to be similar to a pointer.
    It is used to reference another variable dynamically. So this field symbol will simply point to some other variable. and this pointer can be changed at runtime.
    FIELD-SYMBOLS <FS>.
    DATA FIELD VALUE 'X'.
    ASSIGN FIELD TO <FS>.
    WRITE <FS>.
    Field symbols: are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field Groups:
    A field group is a user-defined grouping of characteristics and basic key figures from the EC-EIS or EC-BP field catalog.
    Use
    The field catalog contains the fields that are used in the aspects. As the number of fields grows, the field catalog becomes very large and unclear. To simplify maintenance of the aspects, you can group fields in a field group. You can group the fields as you wish, for example, by subject area or responsibility area. A field may be included in several field groups.
    When maintaining the data structure of an aspect, you can select the field group that contains the relevant characteristics and basic key figures. This way you limit the number of fields offered.
    Field Groups / Extracts
    http://help.sap.com/saphelp_46c/helpdata/EN/9f/db9ede35c111d1829f0000e829fbfe/frameset.htm
    Field Symbols
    http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb387a358411d1829f0000e829fbfe/frameset.htm
    Reward points if helpful.
    Regards,
    Hemant

Maybe you are looking for

  • How can I move my media from the Apple TV to ITunes?

    I have a lot of purchused content that did not download to my itunes on my computer and I do not want to lose it. What can I do?

  • Best practices for start with itunesu

    Hi people, I from Barcelona Spain, We start deploy itunesU for our university. We have a públic and private site, the públic site work with públic site manager. I looking for the best way for vídeos and feeds, I try Podcast Producer 2, feeder and pod

  • Erorr handling in Report triggers

    Hi all! I don't know if this is the right place to post this question, but I guess it goes as well here as anyplace else... I've got a problem with a report I'm building using Reports Developer 6i. In the after parameter form trigger I want to check

  • How to enable JCo logging

    I know I've seen this somewhere, but now that I need it, I can't find it.  I've spent two hours searching all the forums.  Can someone tell me how I enable JCo logging?  I have a JCO/Java program that works fine from the command line, but doesn't wor

  • Where can I get the latest patch for Forms 6.0?(Urgent)

    Please refer to my prevoius Question "Text Items and their Prompts......"