SQL query works in the SQLPlus, but fires parse error after being cut and pasted into

One of our client has a SQL query like this:
SQL> SELECT LNAME,
2 QUOTA/12,
3 (SELECT SUM(CAMT) FROM CONSULTING WHERE CONSULTANT = P.EMPLOYEE
4 AND ACTIVITYCODE = 'C'AND
5 CDATE BETWEEN '01-JAN-2001' AND '31-JAN-2001') AS SUM,
6 (SELECT SUM(CAMT) FROM CONSULTING WHERE CONSULTANT = P.EMPLOYEE
7 AND ACTIVITYCODE = 'C'AND
8 CDATE BETWEEN '01-JAN-2001' AND '31-JAN-2001') -
QUOTA/12 AS PL
9 FROM PERSONNEL P
10 ORDER BY LNAME;
Running the above query in the SQLPlus returns appropriate resultsets to the
user. After the same SQL being cut and pasted into a portal report
component, running the report component fires the following error:
Failed to parse query
Error:ORA-00911: invalid character (WWV-11230)
Failed to parse as XXX - SELECT LNAME, QUOTA/12, (SELECT SUM(CAMT) FROM
CONSULTING WHERE CONSULTANT = P.EMPLOYEE AND ACTIVITYCODE = 'C'AND CDATE
BETWEEN '01-JAN-2001' AND '31-JAN-2001') AS SUM, (SELECT SUM(CAMT) FROM
CONSULTING WHERE CONSULTANT = P.EMPLOYEE AND ACTIVITYCODE = 'C'AND CDATE
BETWEEN '01-JAN-2001' AND '31-JAN-2001') - QUOTA/12 AS PL FROM PERSONNEL P
ORDER BY LNAME; (WWV-08300)
Cursor is not open
Is this because of the multi-table queries, or something else? Is there any
way around this? Any information regarding this will be highly appreciated.
Thanks.
null

Sunny,
From the error message that you posted it seems that you are putting a semicolon ";" at the end of your query. I checked the query that you have posted. It is working fine for me. (I am using 3.0.8) but I feel it will work in your version also. I tried the query without a ";" at the end --It worked.
I tried with ";" at the end -- It gave the error that you have posted. So remove the ";" at the end and it should work. If you are still getting the same error then pls write down the version you are using. I will check in that version.
Thanx,
Chetan.

Similar Messages

  • The MacBook Pro will not allow me to cut-and-paste to and from or to click-and-drag to the external drive. I can copy-and-paste, but then I must send the original to the trash, which doubles the time and effort. Is there any way to cut-and-paste?

    I have recently switched from a PC to a MacBook Pro.
    I have a large number of documents and photographs on a multiterrabite external drive, backed up on a second multiterrabite external drive.
    Both external drives are formatted for MacIntosh. This has been verified by agents at an Apple store and also at Best Buy in two different cities.
    This is the problem:
    The MacBook Pro will not allow me to cut-and-paste to and from or to click-and-drag to the external drive. I can copy-and-paste, but then I must send the original to the trash, which doubles the time and effort. Is there any way to cut-and-paste?
    Also, the MacBook Pro will not allow me to rename multiple documents or photographs. I can click-and-rename a single one, but this is impossibly time consuming. I can batch-rename in iPhoto, but when I transfer the photographs to the external drive, the rename does not transfer.
    I’m reduced to using my wife’s Toshiba to cut-and-past, rename, and transfer documents. It works perfectly. Is there any way to do this on the MacBook Pro?
    Thanks!
    Roderick Guerry
    [email protected]

    Roderick Guerry wrote:
    The MacBook Pro will not allow me to cut-and-paste to and from or to click-and-drag to the external drive. I can copy-and-paste, but then I must send the original to the trash, which doubles the time and effort. Is there any way to cut-and-paste?
    No, this is a philosophical difference between Apple and Microsoft. Apple believes that it's dangerous to cut a file in case the user never pastes it; in that case the file is lost. Microsoft seems to not have this problem (if I remember Windows correctly) because they don't delete the originating file if it's cut but never pasted.
    Even though Macs have a lot of keyboard shortcuts, philosophically Macs have traditionally been mouse-first. This applies to file copy operations. In your case, what a Mac user would do is open the source window, open the destination window (on your second drive), and then Command-drag the selected files from the source to destination window. This is because a normal drag would leave the originals behind, while adding the Command modifier key tells OS X that this is a Move, not a Copy, so don't leave the originals behind.
    (In addition there are different rules for drag-copying within the same volume or between different volumes. If you drag between two folders on the same volume, the files are moved. If you drag between different volumes, the files are copied unless you hold down Command to delete the copies on the source volume.)
    Roderick Guerry wrote:
    Also, the MacBook Pro will not allow me to rename multiple documents or photographs. I can click-and-rename a single one, but this is impossibly time consuming. I can batch-rename in iPhoto, but when I transfer the photographs to the external drive, the rename does not transfer.
    Two problems in this case. First, batch file renaming is not built into OS X unless you build something with Automator. However, there are many utilities that can do batch file renaming which you can find at macupdate.com or on the App Store. Since I work with media I often batch rename using one of the media managers I have lying around like Media Pro or Adobe Bridge (comes with Photoshop).
    iPhoto is a database front end designed to shield the file system from the consumer and let them concentrate on creativity and sharing. As such it is often a poor choice for managing files directly. When you "transferred the photographs" chances are you moved the originals, not the ones iPhoto edited which are stored in a hidden folder.
    Roderick Guerry wrote:
    I’m reduced to using my wife’s Toshiba to cut-and-past, rename, and transfer documents. It works perfectly. Is there any way to do this on the MacBook Pro?
    There will not be a way to do it exactly like Windows. As described above, there are ways to do it "the Mac way." If it is possible to remove judgment on which way is "better" you might find the Mac way to be acceptable, but of course sometimes we simply prefer what we're used to.

  • Query working fine in 9i but throwing an error in Oracle 10g

    Hi All,
    I am having a query which contains large number of When clauses inside a case statement.
    The Same SQL is working fine in 9i, but not working in 10G.
    If we try to remove one of the When clause in the query, its working fine else it is giving the error ORA-00939 Too many arguments for functions.
    Can any one tell me the solution for this and what is the maximum number of when clauses allowed inside case statemen in oracle 10g.
    Thanks in advance
    Regards
    Karthik

    it should not have worked in 9iR2... it is correct according to the doc to return an error message when using more than 255 expressions...
    SQL> select version from v$instance;
    VERSION
    9.2.0.7.0
    SQL> select case 1
      2  when 2 then 3
      3  when 4 then 5
      4  when 6 then 7
      5  when 8 then 9
      6  when 10 then 11
      7  when 12 then 13
      8  when 14 then 15
      9  when 16 then 17
    10  when 18 then 19
    11  when 20 then 21
    12  when 22 then 23
    13  when 24 then 25
    14  when 26 then 27
    15  when 28 then 29
    16  when 30 then 31
    17  when 32 then 33
    18  when 34 then 35
    19  when 36 then 37
    20  when 38 then 39
    21  when 40 then 41
    22  when 42 then 43
    23  when 44 then 45
    24  when 46 then 47
    25  when 48 then 49
    26  when 50 then 51
    27  when 52 then 53
    28  when 54 then 55
    29  when 56 then 57
    30  when 58 then 59
    31  when 60 then 61
    32  when 62 then 63
    33  when 64 then 65
    34  when 66 then 67
    35  when 68 then 69
    36  when 70 then 71
    37  when 72 then 73
    38  when 74 then 75
    39  when 76 then 77
    40  when 78 then 79
    41  when 80 then 81
    42  when 82 then 83
    43  when 84 then 85
    44  when 86 then 87
    45  when 88 then 89
    46  when 90 then 91
    47  when 92 then 93
    48  when 94 then 95
    49  when 96 then 97
    50  when 98 then 99
    51  when 100 then 101
    52  when 102 then 103
    53  when 104 then 105
    54  when 106 then 107
    55  when 108 then 109
    56  when 110 then 111
    57  when 112 then 113
    58  when 114 then 115
    59  when 116 then 117
    60  when 118 then 119
    61  when 120 then 121
    62  when 122 then 123
    63  when 124 then 125
    64  when 126 then 127
    65  when 128 then 129
    66  when 130 then 131
    67  when 132 then 133
    68  when 134 then 135
    69  when 136 then 137
    70  when 138 then 139
    71  when 140 then 141
    72  when 142 then 143
    73  when 144 then 145
    74  when 146 then 147
    75  when 148 then 149
    76  when 150 then 151
    77  when 152 then 153
    78  when 154 then 155
    79  when 156 then 157
    80  when 158 then 159
    81  when 160 then 161
    82  when 162 then 163
    83  when 164 then 165
    84  when 166 then 167
    85  when 168 then 169
    86  when 170 then 171
    87  when 172 then 173
    88  when 174 then 175
    89  when 176 then 177
    90  when 178 then 179
    91  when 180 then 181
    92  when 182 then 183
    93  when 184 then 185
    94  when 186 then 187
    95  when 188 then 189
    96  when 190 then 191
    97  when 192 then 193
    98  when 194 then 195
    99  when 196 then 197
    100  when 198 then 199
    101  when 200 then 201
    102  when 202 then 203
    103  when 204 then 205
    104  when 206 then 207
    105  when 208 then 209
    106  when 210 then 211
    107  when 212 then 213
    108  when 214 then 215
    109  when 216 then 217
    110  when 218 then 219
    111  when 220 then 221
    112  when 222 then 223
    113  when 224 then 225
    114  when 226 then 227
    115  when 228 then 229
    116  when 230 then 231
    117  when 232 then 233
    118  when 234 then 235
    119  when 236 then 237
    120  when 238 then 239
    121  when 240 then 241
    122  when 242 then 243
    123  when 244 then 245
    124  when 246 then 247
    125  when 248 then 249
    126  when 250 then 251
    127  when 252 then 253
    128  when 254 then 255
    129  when 256 then 257
    130  end x from dual;
             X
    SQL> select version from v$instance;
    VERSION
    10.2.0.2.0
    SQL> select case 1
      2  when 2 then 3
      3  when 4 then 5
      4  when 6 then 7
      5  when 8 then 9
      6  when 10 then 11
      7  when 12 then 13
      8  when 14 then 15
      9  when 16 then 17
    10  when 18 then 19
    11  when 20 then 21
    12  when 22 then 23
    13  when 24 then 25
    14  when 26 then 27
    15  when 28 then 29
    16  when 30 then 31
    17  when 32 then 33
    18  when 34 then 35
    19  when 36 then 37
    20  when 38 then 39
    21  when 40 then 41
    22  when 42 then 43
    23  when 44 then 45
    24  when 46 then 47
    25  when 48 then 49
    26  when 50 then 51
    27  when 52 then 53
    28  when 54 then 55
    29  when 56 then 57
    30  when 58 then 59
    31  when 60 then 61
    32  when 62 then 63
    33  when 64 then 65
    34  when 66 then 67
    35  when 68 then 69
    36  when 70 then 71
    37  when 72 then 73
    38  when 74 then 75
    39  when 76 then 77
    40  when 78 then 79
    41  when 80 then 81
    42  when 82 then 83
    43  when 84 then 85
    44  when 86 then 87
    45  when 88 then 89
    46  when 90 then 91
    47  when 92 then 93
    48  when 94 then 95
    49  when 96 then 97
    50  when 98 then 99
    51  when 100 then 101
    52  when 102 then 103
    53  when 104 then 105
    54  when 106 then 107
    55  when 108 then 109
    56  when 110 then 111
    57  when 112 then 113
    58  when 114 then 115
    59  when 116 then 117
    60  when 118 then 119
    61  when 120 then 121
    62  when 122 then 123
    63  when 124 then 125
    64  when 126 then 127
    65  when 128 then 129
    66  when 130 then 131
    67  when 132 then 133
    68  when 134 then 135
    69  when 136 then 137
    70  when 138 then 139
    71  when 140 then 141
    72  when 142 then 143
    73  when 144 then 145
    74  when 146 then 147
    75  when 148 then 149
    76  when 150 then 151
    77  when 152 then 153
    78  when 154 then 155
    79  when 156 then 157
    80  when 158 then 159
    81  when 160 then 161
    82  when 162 then 163
    83  when 164 then 165
    84  when 166 then 167
    85  when 168 then 169
    86  when 170 then 171
    87  when 172 then 173
    88  when 174 then 175
    89  when 176 then 177
    90  when 178 then 179
    91  when 180 then 181
    92  when 182 then 183
    93  when 184 then 185
    94  when 186 then 187
    95  when 188 then 189
    96  when 190 then 191
    97  when 192 then 193
    98  when 194 then 195
    99  when 196 then 197
    100  when 198 then 199
    101  when 200 then 201
    102  when 202 then 203
    103  when 204 then 205
    104  when 206 then 207
    105  when 208 then 209
    106  when 210 then 211
    107  when 212 then 213
    108  when 214 then 215
    109  when 216 then 217
    110  when 218 then 219
    111  when 220 then 221
    112  when 222 then 223
    113  when 224 then 225
    114  when 226 then 227
    115  when 228 then 229
    116  when 230 then 231
    117  when 232 then 233
    118  when 234 then 235
    119  when 236 then 237
    120  when 238 then 239
    121  when 240 then 241
    122  when 242 then 243
    123  when 244 then 245
    124  when 246 then 247
    125  when 248 then 249
    126  when 250 then 251
    127  when 252 then 253
    128  when 254 then 255
    129  when 256 then 257
    130  end x from dual;
    when 16 then 17
    ERROR at line 9:
    ORA-00939: too many arguments for function
    SQL> del 129
    SQL> /
             X
    ----------

  • SQL query works in access 2000 but not through JDBC

    Hello to all as my first posted message, I have a bit of a pickle on my hands. I have a query which is critical to for my application to function.
    In Access 2000
    SELECT sb.SeatName
    FROM SeatBooking sb, Movie m, MovieSession ms, Booking b
    WHERE m.MovieId = ms.MovieId
    AND ms.MovieSessionId = b.MovieSessionId
    AND b.BookingId = sb.BookingId
    AND ms.DateOfSession = #2003/04/16 07:15:00 PM#;
    This query works fine. When I insert it into my code
    String query = "SELECT sb.SeatName \n" +
    "FROM SeatBooking sb, Movie m, MovieSession ms, Booking b \n" +
    "WHERE m.MovieId = ms.MovieId \n" +
    "AND ms.MovieSessionId = b.MovieSessionId \n" +
    "AND b.BookingId = sb.BookingId \n" +
    "AND ms.DateOfSession = #" +
    cp.getMovieSessionAt(i).getTrueTimeOfSession() + "#;";
    The last line of code returns #2003/04/16 07:15:00 PM#; Which is the exact same as in Access.
    To rule out some possibilities
    - there are other less complicated queries which access the same database but work fine. so my code seems to be ok
    - I have tried to use Format() on ms.DateOfSession to match the return value of the java statement (Which is a general date in Access in the format of 16/04/2003 7:15:00 PM)
    Any suggestions would be appreciated!

    Hi Simon,
    On my Windows XP system with J2SE SDK version 1.4.1_02 and Micro$oft Access 2002, I have the following table:
    column name    column type
    id             Number
    name           Text
    updated        Date/TimeUsing the JDBC-ODBC bridge driver (that is part of the J2SE distribution), the following code uses the JDBC "escape" syntax -- and it works.
    import java.sql.*;
    public class JdbcOdbc {
      public static void main(String[] args) {
        Connection dbConn = null;
        ResultSet rs = null;
        Statement stmt = null;
        String sql =
          "SELECT * FROM Table1 WHERE updated = {ts '2003-04-13 07:53:23'}";
        try {
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          dbConn = DriverManager.getConnection("jdbc:odbc:db1");
          stmt = dbConn.createStatement();
          rs = stmt.executeQuery(sql);
          if (rs.next()) {
            System.out.println("id      = " + rs.getInt(1));
            System.out.println("name    = " + rs.getString(2));
            System.out.println("updated = " + rs.getTimestamp(3));
        catch (SQLException sqlEx) {
          System.err.println("Database operation failed.");
          sqlEx.printStackTrace();
        catch (ClassNotFoundException cnfEx) {
          System.err.println("JDBC driver class not found");
          cnfEx.printStackTrace();
        finally {
          if (rs != null) {
            try {
              rs.close();
            catch (SQLException sqlEx) {
              System.err.println("ERROR: Failed to close result set");
              sqlEx.printStackTrace();
          if (stmt != null) {
            try {
              stmt.close();
            catch (SQLException sqlEx) {
              System.err.println("ERROR: Failed to close statement");
              sqlEx.printStackTrace();
          if (dbConn != null) {
            try {
              dbConn.close();
            catch (SQLException sqlEx) {
              System.err.println("ERROR: Failed to close DB connection");
              sqlEx.printStackTrace();
    }More details about the JDBC escape syntax are available here:
    http://java.sun.com/j2se/1.4.1/docs/guide/jdbc/getstart/statement.html#999472
    Hope this helps you.
    Good Luck,
    Avi.

  • SQL Query works in Simulator VC but not in flash deploy

    Hi:
    This is the select that works in VC's simulator:
    SELECT
    "t1"."VUELO", "t1"."HORA SALIDA", "t1"."DURACION", "t1"."ORIGEN", "t1"."DESTINO", "t1"."DIAS"
    FROM
    "RPADMIN"."VUELOS_SEMANAL_EPN_VIRGO" "t1"
    WHERE
    "t1"."DIAS" LIKE <b>'%1%'</b>
    ORDER BY "t1"."HORA SALIDA" ASC
    The big problem seems to be the LIKE clause, I need to find all records that have the number one.
    If I select the Simulator tab the data is bring on but If I perform a flash deploy a null message is display at app's execution. The system is well define and If I change the LIKE clause for LIKE <b>'1'</b> the flash app brings data (not all the records that contains the number 1).
    Thanks a lot for the time on this thread.
    RLS

    Thanks Prakash Darj.
    I read that PDF before starting the thread but I can't make it work...I read it once again and no luck...
    My app is a basic one: start point with a link to a SQL statement linked to a result table
    <b>The SQL sentences that work at the simulator don't work for a flex app, Did you know the reason?</b>
    Often I get this error when deploying as flash app:
    Error in executing a process for Flex compilation, Error 1103: There is no property with the name 'NEUQUEN'.
          (D:\usr\sap\PD0\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\ModelName_20931\FLEX_COMPILATION_FOLEDR\AAD1W1.mxml:205)
    Failed to compile AAD1W1.mxml
    Is it that my VC is not working fine?
    I want to know the reason for what the Simulator display the data and not the flex app...is the same app....
    any Idea?
    Thanks so much for the time on this thread and for your answer.
    RLS

  • Since I have updated to 9.0.1 I cannot cut and paste into my forum. (Im Admin so you can see this is big trouble for me).. cant do it in my geek forum either yet it works fine in Gmail

    I have managed to 'fool' it a few times by pasting into a gmail then going direct to my forum and repeating the process, but if its a cut n paste from a news site, forget it. It will not accept anything into a quote box or img's.
    I work in a news room.. please help.

    I have managed to 'fool' it a few times by pasting into a gmail then going direct to my forum and repeating the process, but if its a cut n paste from a news site, forget it. It will not accept anything into a quote box or img's.
    I work in a news room.. please help.

  • How can I re-order the pages in my document with having to cut and paste everything?

    Hello, I have a larger sized document and I need to reorder the sections of my document. However there are many images so cut-paste seems to screw up my formatting since pages like to move text around automatically but not images (like if I hit backspace until the text goes back to the previous page, the images will stay on the same page without moving back).
    On the previous version of pages (pages' 09 I believe) I could simply click and drag the page thumbnails around. However I cannot seem to be able to do this in Pages'13... Am I missing something here?
    Thanks!

    Hi dd,
    Pages '09 offered two types of documents.
    Word processing documents included a text layer, and consisted of sections made up of multiple pages. If no section breaks were inserted, a fifty page document could consist of a single section. Text could be placed directly into the text layer, and Objects could be placed on the page as Floating Objects, independent of the text, and able to make text flow around themselves, or could be placed as Inline Objects, inserted into the line of text running from beginning to end of the document, and moving with the text as it was edited.
    In a Page Layout document, each page was a single section. There was no text layer, so only objects could be placed on the page. Any text had to be contained in a Text box or in a Shape. Unless grouped, each object was independent of the others.
    Changing your images from Floating to Inline objects may be the key to your document rearranging issues. They can be changed back to Floating after being moved to theor new locations.
    Regards,
    Barry

  • I unchecked "Check spelling as you type" but Firefox still underlines words in cut-and-pasted text in some web apps. How can I stop it from doing this?

    I'm using an online web mapping application that has input boxes for descriptive text and stuff like that. Sometimes I copy blocks of text from a word processing app into these input boxes because I can format the text in the wp. When I paste the text blocks, Firefox does the wiggly red underline on words it doesn't know. I've already turned off "check spelling as you type" but this doesn't make a difference. I don't want Firefox to check spelling on these text blocks that I copy and paste. Sometimes I need to capture screen images of these text blocks in the mapping application and I want them to look clean. Thanks.

    Does "Check Spelling" in the right-click context menu has a tick when this happens?
    You can consider to disable the spell check underline by setting the ui.SpellCheckerUnderlineStyle pref to 0 (zero) on the <b>about:config</b> page.
    *http://kb.mozillazine.org/ui.SpellCheckerUnderlineStyle

  • SQL Query works in MS Access but caused SQL exception

    Hi all,
    I've got this query that works if I run it in MS Access but caused an SQL Exception if I run in my Java programme.
    The query
    SELECT Count(*) AS countPlayerMax FROM (SELECT Count(*) AS countSent, sent.mobileno FROM sent WHERE (((sent.date_sent) Between #2002-3-1# And #2002-3-8#)) GROUP BY sent.mobileno HAVING (((Count(*))>100)))
    The exception is
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
    I've done nested queries before but this one doesn't work. Any ides why??
    thanks

    Thanks for your suggestion
    I tried it but it still gives the same error, now the SQL looks like this
    SELECT Count(*) AS countPlayerMax FROM (SELECT Count(*) AS countSent, sent.mobileno FROM sent WHERE sent.date_sent Between #2002-3-1# And #2002-3-8# GROUP BY sent.mobileno HAVING Count(*)>100)
    the exception is the same
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.

  • May seem silly, but I can't seem to cut and paste from delta computer services (land role) to google docs

    How can I cut and paste from Delta Computer Systems (land roles) to Google Docs using my new MacBook Pro?

    How can I cut and paste from Delta Computer Systems (land roles) to Google Docs using my new MacBook Pro?

  • With emails when I send a link it cannot be opened but has to be cut and pasted by the recipient - how can I avoid this

    When I send a link to a page or website via email (Hotmail or Yahoo) it cannot be opened by the recipient. Instead it needs to be cut and pasted into their browser bar for them to open it.
    This problem only started after loading Firefox on my computer and I wonder if you can help in any way.

    Just above the textarea that you use to enter the message text there is usually a button bar with buttons to add text formatting like Bold and Italic.<br />
    That toolbar may also have a button to turn a text link into a clickable hyperlink (look for a chain like button).<br />
    You can select the text and click that button to turn the link into a clickable hyperlink.<br />
    If you can't find the button then hover them all to check the tooltip of each.<br />
    * Make Link - https://addons.mozilla.org/firefox/addon/make-link/

  • Since I downloaded the free upadted version,I cannot cut and paste

    I know that my mouse is working. but this happened since Friday.
    I tried to change the setting on the mouse but I still am unablea to cut and pasteed

    There are other things that need attention:
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    # Shockwave Flash 10.0 r32
    # Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    Update the [[Java]] plugin to the latest version.
    *http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)

  • SQL Query to get the # of files in folders in a library

    Anyone has the SQL query to list the number of files in each folders in a SharePoint library?

    Technically it's a grey area of support as MS don't mind you doing it but won't help you if you encounter problems, the script is much better though.
    Scratch that, the script isn't that good. It's using .items which won't work on large lists and is slow. The version below is untested but should be significantly faster and work on large lists.
    $starttime = Get-Date
    #Creating new site object
    $siteurl = Read-Host "Enter the name of your site and press enter"
    $site = New-Object Microsoft.SharePoint.SPSite($siteurl)
    #Assigning all webs (sites) to $webs
    $webs = $site.Allwebs
    #System Libraries defined so they won't be touched##
    $systemlibs =@("Converted Forms", "Customized Reports", "Documents", "Form Templates",
    "Images", "List Template Gallery", "Master Page Gallery", "Pages",
    "Reporting Templates", "Site Assets", "Site Collection Documents",
    "Site Collection Images", "Site Pages", "Solution Gallery",
    "Style Library", "Theme Gallery", "Web Part Gallery", "wfpub")
    Write-Host "Total number of webs that will be traversed: " $webs.count
    $DocLibsCount = 0
    $DocLibwItems = 0
    $totalitems = 0
    $subfolderitems = 0
    foreach($web in $webs)
    $listcoll = $web.lists
    foreach($list in $listcoll)
    if($list -eq $null)
    Write-Host
    else
    $base = $list.GetType()
    if($base.name -eq "SPDocumentLibrary")
    if ($systemlibs -contains $list)
    { continue}
    else
    $DocLibsCount += 1
    $totalitems += $List.itemcount
    $name = $list.Title
    $folders = $web.GetFolder($name).SubFolders
    for($etr = 0;$etr -lt $folders.count; $etr++)
    if($folders[$etr].Name -ne "Forms")
    Write-Host "Processing SubFolder ItemCount" -ForegroundColor Red
    $tempcount = $folders[$etr].ItemCount
    $subfolderitems += $tempcount
    Write-Host
    Write-Host
    Write-Host "Total # of Document Libraries: " $DocLibsCount -ForegroundColor Green
    Write-Host "Total # of Document Libraries that contain items: " $DocLibwItems -ForegroundColor Green
    Write-Host "Total # of items: " $totalitems -ForegroundColor Green
    Write-Host "Total # of items in DocLib\Subfolders: " $subfolderitems -ForegroundColor Green
    $finishtime = Get-Date
    Write-Host
    Write-Host “Script Duration” –ForegroundColor Yellow
    Write-Host “Started: “ $starttime –ForegroundColor Yellow
    Write-Host “Finished: “ $finishtime –ForegroundColor Yellow
    Stop-SPAssignment -Global

  • SQL Query To Select The 5th Element

    In the report I am currently working on, I am using an Add Command custom SQL query to pull the data that I need. The structure is a Call and a list of associated Activities. In this particular scenario, there are 8 activity notes for a type of call and I want to return the 5th one. The activity notes are a specific sequence of captured actions and I need the note from the 5th step in the sequence.
    This is what I have come up with:
    SELECT CALL.call_id,
         (select top 1 from (select top 5 CONVERT(char(8000),ACTIVITY.activity_note) from ACTIVITY
          where CALL.call_id = ACTIVITY.call_id
          order by ACTIVITY.creat_date desc))
         as activity_tx
    FROM CALL
    The intent of the Top 5 was to get the first 5 activity notes, of which the 5th note would be the last, then reverse sort them so I could take the Top 1 (which would be the 5th of 8). But I am getting a vague syntax error between "from" and "order by". Any suggestions would be appreciated.
    Thanks!
    Fuskie
    Who thought he had a solution but is flummoxed he can't bring it home...

    Hello,
    Let me explain that Crystal assumes the user knows how to write SQL. We only report on the data provided by the SQL you write.
    I did a quick search using Microsofts new search engine - www.bing.com and it returned this as well as lots more:
    http://forums.devshed.com/php-development-5/how-to-access-a-certain-element-in-the-results-of-606217.html
    Try searching in MSSQL's site also for more info on how to get the results you are looking for.
    Thank you
    Don

  • Function used in SQL query not showing the desired results

    I have created a function that gives me the client id but when i am using the function in the query its not giving me any result i.e. 0 rows but if I execute the function sepreatly and put the result of that function in the qurey it is giving me the desired result please have a look on the following and please reply with you expert opinion:
    FUNCTION CODE:
    create or replace function j2
    (usid in varchar2)
    return varchar2
    is
    cidn_in varchar2(4000) := '';
    ls_sep varchar2(1) := ',';
    cursor predicate_cidn
    is
    select
    logical_schema_id
    from
    CLIENT_REGISTRY cr,
    MEMBER_ROLE_CLIENT_ASSIGNMENT mrca,
    MEMBER m
    where
    mrca.base_client_id = cr.base_client_id and
    mrca.member_id = m.member_id and
    cr.schema_in_use_in = '1' and
    m.active_status_id = 'A' and
    upper(mrca.member_id) = upper(usid);
    BEGIN
    for GET_CIDN in predicate_cidn
    loop
    cidn_in := cidn_in || ls_sep || '''' || GET_CIDN.logical_schema_id || '''';
    end loop;
    cidn_in := substr(cidn_in, 2);
    cidn_in := '('||cidn_in||')';
    --dbms_output.put_line(cidn_in);
    return cidn_in;
    END ;
    SQL> select j2('qaa@adp') from dual;
    J2('QAA@ADP')
    ('BASE18','SDK1TEST','SEETHA1CONFIG','BASE09','KAREN2','SIVACONFIG','BASE19','SD
    K1CTEST','VASU1','KAREN5','EVENTS1CTEST','SDK1','ADA1CONFIG','BASE10','VRB1CONFI
    G','CRU2CONFIG','BASE20','SIVATEST','PCOMCONFIG','KP1CONFIG','KAREN4CONFIG','EVE
    NTS1TEST','SUZ3CONFIG','DONG2CONFIG','ED2CONFIG','SIVACTEST','APDCONFIG','EVENTS
    1CONFIG','ESSCONFIG','SIVA','SDK2CONFIG','ED3CONFIG','RAJ4CONFIG','CBRCONFIG','N
    AMRATA2CONFIG','EMIL1','NAMRATA1CONFIG','SDK2CTEST','BVT2CONFIG','MURUGAN1CONFIG
    ','COB1CONFIG','GABY1TEST','CHR1CONFIG','ED4CONFIG','USE1CONFIG','SDK2TEST','DEM
    O1CONFIG','BERNIE1CONFIG','XA1','CAR2TEST','SDK2','ED5CONFIG','PAY1TEST','PAYXCO
    NFIG','KP1TEST','SEAN1CONFIG','CAR2CTEST','VASU1CONFIG','SEAN2CONFIG','KP1CTEST'
    ,'MAU1CONFIG','CONWCONFIG','PAN1CONFIG','MERAJ2','PRA3CONFIG','SEAN5CONFIG','KP1
    ','PRA4CONFIG','CAR2CONFIG','PRA2CONFIG','SEAN6CONFIG','PRA3TEST','RPT','GABY1CT
    EST','SDK3CONFIG','PRA2TEST','SEAN9CONFIG','CAR2','LV1CONFIG','PRA3CTEST','DONG1
    CONFIG','TE1CONFIG','MERAJ2CONFIG','VIV1CONFIG','GABY1','SEAN2','PRA2CTEST','PRA
    3','RPTCONFIG','PRA4CTEST','SEAN3','MITA1CONFIG','PRA2','RPTCTEST','PCOM1CONFIG'
    ,'SS2CONFIG','PAY1CONFIG','SEAN7','ANNCONFIG','BASE11','BASE02','LV2CONFIG','RPT
    TEST','IMPECONFIG','SUR1CONFIG','SREEK2CONFIG','BASE03','SRINU3CONFIG','BDCONFIG
    ','JAY1CONFIG','AMMAN1','PRA1TEST','WPGCONFIG','BASE12','MP5CONFIG','MERAJ1','SR
    INU2CONFIG','XA1CONFIG','RAJ1CONFIG','WPGCTEST','BASE04','CHRIS','RAJSCONFIG','P
    ANKAJ','BASE13','WPGTEST','RAJ3CONFIG','WPG','BASE14','VASU2CONFIG','SRINU1CONFI
    G','BASE05','PRA4TEST','VASU1TEST','PRA5CONFIG','NISH1CONFIG','CHRISCONFIG','SDK
    3TEST','RAJ3TEST','KP2CONFIG','BASE06','DEFPCONFIG','NISH2CONFIG','CHRISCTEST','
    WPSCONFIG','VASU2TEST','BASE15','GABY1CONFIG','PRA5TEST','MITA2CONFIG','BASE07',
    'VASU1CTEST','KP2TEST','VASU2CTEST','LAURA3CONFIG','BASE16','CHRISTEST','WPSTEST
    ','VASU2','KP2CTEST','EVENTS1','BASE17','RAJ2CONFIG','WPSCTEST','BASE08','SREEK1
    CONFIG','ADVE','PRA4','SDK1CONFIG','KP2','KAREN1','CRU1CONFIG','WPS')
    Now if i put the results (cut and paste )in the query it gives me the results
    SQL> select count(*) from baseclient.address_detail where cidn in ('BASE18','SDK1TEST','SEETHA1CONFIG','BASE09','KAREN2','SIVACONFIG','BASE19','SD
    2 K1CTEST','VASU1','KAREN5','EVENTS1CTEST','SDK1','ADA1CONFIG','BASE10','VRB1CONFI
    3 G','CRU2CONFIG','BASE20','SIVATEST','PCOMCONFIG','KP1CONFIG','KAREN4CONFIG','EVE
    4 NTS1TEST','SUZ3CONFIG','DONG2CONFIG','ED2CONFIG','SIVACTEST','APDCONFIG','EVENTS
    5 1CONFIG','ESSCONFIG','SIVA','SDK2CONFIG','ED3CONFIG','RAJ4CONFIG','CBRCONFIG','N
    6 AMRATA2CONFIG','EMIL1','NAMRATA1CONFIG','SDK2CTEST','BVT2CONFIG','MURUGAN1CONFIG
    7 ','COB1CONFIG','GABY1TEST','CHR1CONFIG','ED4CONFIG','USE1CONFIG','SDK2TEST','DEM
    O1CONFIG','BERNIE1CONFIG','XA1','CAR2TEST','SDK2','ED5CONFIG','PAY1TEST','PAYXCO
    8 9 NFIG','KP1TEST','SEAN1CONFIG','CAR2CTEST','VASU1CONFIG','SEAN2CONFIG','KP1CTEST'
    10 ,'MAU1CONFIG','CONWCONFIG','PAN1CONFIG','MERAJ2','PRA3CONFIG','SEAN5CONFIG','KP1
    11 ','PRA4CONFIG','CAR2CONFIG','PRA2CONFIG','SEAN6CONFIG','PRA3TEST','RPT','GABY1CT
    12 EST','SDK3CONFIG','PRA2TEST','SEAN9CONFIG','CAR2','LV1CONFIG','PRA3CTEST','DONG1
    13 CONFIG','TE1CONFIG','MERAJ2CONFIG','VIV1CONFIG','GABY1','SEAN2','PRA2CTEST','PRA
    14 3','RPTCONFIG','PRA4CTEST','SEAN3','MITA1CONFIG','PRA2','RPTCTEST','PCOM1CONFIG'
    15 ,'SS2CONFIG','PAY1CONFIG','SEAN7','ANNCONFIG','BASE11','BASE02','LV2CONFIG','RPT
    16 TEST','IMPECONFIG','SUR1CONFIG','SREEK2CONFIG','BASE03','SRINU3CONFIG','BDCONFIG
    17 ','JAY1CONFIG','AMMAN1','PRA1TEST','WPGCONFIG','BASE12','MP5CONFIG','MERAJ1','SR
    18 INU2CONFIG','XA1CONFIG','RAJ1CONFIG','WPGCTEST','BASE04','CHRIS','RAJSCONFIG','P
    19 ANKAJ','BASE13','WPGTEST','RAJ3CONFIG','WPG','BASE14','VASU2CONFIG','SRINU1CONFI
    20 G','BASE05','PRA4TEST','VASU1TEST','PRA5CONFIG','NISH1CONFIG','CHRISCONFIG','SDK
    21 3TEST','RAJ3TEST','KP2CONFIG','BASE06','DEFPCONFIG','NISH2CONFIG','CHRISCTEST','
    22 WPSCONFIG','VASU2TEST','BASE15','GABY1CONFIG','PRA5TEST','MITA2CONFIG','BASE07',
    23 'VASU1CTEST','KP2TEST','VASU2CTEST','LAURA3CONFIG','BASE16','CHRISTEST','WPSTEST
    24 ','VASU2','KP2CTEST','EVENTS1','BASE17','RAJ2CONFIG','WPSCTEST','BASE08','SREEK1
    25 CONFIG','ADVE','PRA4','SDK1CONFIG','KP2','KAREN1','CRU1CONFIG','WPS');
    COUNT(*)
    228
    BUT if I user the function it gives me no results
    0 rows selected and its taking a loon time to reurn

    This appears to be a duplicate of the question in this thread
    Re: VPD issue Need Assistance ASAP
    where I wrote
    "Your function returns a single string that happens to have a bunch of commas and quotes in it. An IN list generally requires a list of strings, which your function doesn't return.
    You could rewrite the function to be a pipelined table function and then do
    select count(*)
    from baseclient.address_detail
    where cidn in (SELECT cidn
    FROM TABLE(<<your pipelined table function>>))
    However, I would expect it to be easier not to wrap all this into a function and just have your IN clause be the logic in your predicate_cidn cursor.
    Justin
    "

Maybe you are looking for

  • How can i use "View State" Concept in sharepoint sandbox soltuions??

    I need to do video player in sharepoint sandbox solutions..I used following code in form solution the same code i need to use sandbox solution..In this code i am using "viewstate" asp control..i don't know how to use in sandbox solutions..how to use?

  • How to reduce folio file size

    This is a quote from the Adobe support pages: Default Image Format Choose a default option for the folio. Individual articles can have different Image Format settings. Choose Automatic if you want to let InDesign determine whether to export the pages

  • Account 640001 requires an assignment to a CO object

    Hi,    While i am using this GL 640001, the following error is coming " . This GL is assigned in OKB9 with Profit Center is mandatory (3)  & cost center also assinged for this GL with several profit center. suppose if i assigned any cost center in KA

  • Costing data from Tables of Process Order Confirmation.

    Dear Friends, In which table is the Costing relevent data for process order confirmation stored. We are developing a report for which we require  material specific- Target quantity / Actual quantity Target costs / Actual costs Thanks in advance. Rega

  • Download PDF file stated (SECURE). How to remove?

    I have downloaded my bank statement and saved it to my computer. The file name has the word (SECURED). I can open the the saved statement without a problem. But since the statement is saved to my computer, I would like password protect the statement