Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Any SQL Gurus?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Any SQL Gurus?

    Hi all,
    I have an Oracle Database with around 20 tables with up to 100 columns in each. I am not allowed to link to it or copy it over and import the contents to Alpha. That's too easy!
    Is there a way - using SQL - of reading a table and finding out which columns have any data in them? I really do not care what data, just the fact that there is data present.

    To my simple mind,

    Get table
    Read column 1
    If any field in the column isn't blank write column name
    Read next column while more columns exist

    Should do it.

    I know it's a long shot and I'm trying to learn SQL but it seems a bit too superficial. Either that or I'm employing the wrong people!

    Ted
    Ted Giles
    Example Consulting - UK
    .

    sigpichttp://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  • #2
    Re: Any SQL Gurus?

    Ted,
    I am not that well versed in SQL but if you are not allowed to link to the SQL table then how are you going to be able to read the table or see anything at all? Not possible in my mind. I'm thinking that this might have been a slip-up in what you actually wanted to say....maybe a rephrase would help clarify.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


    • #3
      Re: Any SQL Gurus?

      Mike, I cannot link through Alpha, nor can I export the data from Oracle into Alpha.

      I can connect to the Oracle database through TOAD, so I'm after a SQL solution outside of the Alpha solution.

      The reason for posting the thread here is that I know a lot of the contributors have a whole ton of experience and might be able to help.
      Ted Giles
      Example Consulting - UK
      .

      sigpichttp://ec12.example-software.com//
      See our site for Alpha Support, Conversion and Upgrade.

      Comment


      • #4
        Re: Any SQL Gurus?

        Originally posted by Ted Giles View Post
        Mike, I cannot link through Alpha, nor can I export the data from Oracle into Alpha.

        I can connect to the Oracle database through TOAD, so I'm after a SQL solution outside of the Alpha solution.

        The reason for posting the thread here is that I know a lot of the contributors have a whole ton of experience and might be able to help.
        Do you have the ODBC driver installed for Oracle ? I believe TOAD has native support for Oracle built in. For Alpha, you will need to have an ODBC driver installed to access any databases within Oracle. See link below for the proper driver version.

        http://www.oracle.com/technology/sof...dbc/index.html

        Comment


        • #5
          Re: Any SQL Gurus?

          This probably should have read that I am not allowed to link through to the Oracle database, nor am I allowed to import the data from Oracle to Alpha.
          That is why I need the SQL to examine the Oracle tables.
          Last edited by Ted Giles; 12-10-2008, 11:50 AM. Reason: further info
          Ted Giles
          Example Consulting - UK
          .

          sigpichttp://ec12.example-software.com//
          See our site for Alpha Support, Conversion and Upgrade.

          Comment


          • #6
            Re: Any SQL Gurus?

            Originally posted by Ted Giles View Post
            This probably should have read that I am not allowed to link through to the Oracle database, nor am I allowed to import the data from Oracle to Alpha.
            That is why I need the SQL to examine the Oracle tables.
            If you are not allowed to use ODBC or OLE DB, etc., to access the Oracles tables, then it is impossible to use SQL to examine the tables. SQL relies on an established connection "link" to the database (BTW, TOAD "links" to the tables, just using a built-in driver.)

            ODBC links can be set-up as Read Only, if there are concerns about data corruption. They can also set up user credentials for you that only allow READ ACCESS....
            Last edited by sparkey; 12-10-2008, 12:11 PM.

            Comment


            • #7
              Re: Any SQL Gurus?

              Hi Ted,

              I don't know which TOAD version you are using, but latest versions usually allow to save Oracle tables contents to MS Excel files. If you are using late enough version you can save oracle tables contents as CSV files and then perform import to A5 database from them.

              Hope it can help.

              Regards,
              Olga

              Comment


              • #8
                Re: Any SQL Gurus?

                I have SQL and Toad for SQL
                if you can send a txt or xls file, we can import to a sql table to read.

                Comment


                • #9
                  Re: Any SQL Gurus?

                  Hi Ted,
                  I'm working on a script that might work for you, and will post it if I get it to work. First, are you running Oracle eBusiness Suite? Do you want to include system tables? Thanks.
                  Land of the Free, Because of the Brave
                  Support our US Military

                  Comment


                  • #10
                    Re: Any SQL Gurus?

                    Thanks for this.

                    Good luck. Glad you understand my problem.

                    To answer the other questions, from Sparkey, all I need is the SQL to do the job. I'll sort out the connection and running the SQL later. I really don't need assistance with the ODBC.
                    Ted Giles
                    Example Consulting - UK
                    .

                    sigpichttp://ec12.example-software.com//
                    See our site for Alpha Support, Conversion and Upgrade.

                    Comment


                    • #11
                      Re: Any SQL Gurus?

                      Originally posted by Ted Giles View Post
                      Thanks for this.

                      Good luck. Glad you understand my problem.

                      To answer the other questions, from Sparkey, all I need is the SQL to do the job. I'll sort out the connection and running the SQL later. I really don't need assistance with the ODBC.
                      I guess I didn't read your question completely. I see you are looking for a solution outside of Alpha. My bad.

                      Check out http://www.w3schools.com/sql/default.asp

                      SELECT * FROM Customer
                      WHERE LastName IS NULL


                      Look for the SQL Nulls menu item under advanced SQL for what I believe you will need.
                      Last edited by sparkey; 12-10-2008, 05:44 PM.

                      Comment


                      • #12
                        Re: Any SQL Gurus?

                        That will take awhile, especially if they're running EBS, since it has about 70,000 tables!
                        Land of the Free, Because of the Brave
                        Support our US Military

                        Comment


                        • #13
                          Re: Any SQL Gurus?

                          Since this is an Oracle-specific issue and has nothing to do with Alpha, you need to try and google some Oracle and pl/SQL tutorials. There may well be ways of getting listings the way you need but you'd be much better off searching resources related to Oracle.

                          Comment


                          • #14
                            Re: Any SQL Gurus?

                            I'm not sure I understand Ted's question, but if the question is, how to use SQL to see if a table is empty or has any data, then one solution is

                            SELECT count(*) from tablename;

                            which will return 0 if the table is empty, or the number of rows if the table has data.
                            Is that the question?

                            An alternative that might work faster is
                            SELECT * from tablename WHERE rownum=1;

                            which will also return nothing if the table is empty, or the first row of data if the table has anything in it. I don't have Oracle to test against so I don't know how quickly Oracle does a count(*).
                            Last edited by Peter.Wayne; 12-11-2008, 08:11 AM.

                            Comment

                            Working...
                            X