<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Generate a report of database schema and sample data from each table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712407#M89578</link>
    <description>&lt;OL&gt;
&lt;LI&gt;You are correct.&amp;nbsp;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;You use the term "database".&amp;nbsp; That is an ambiguous term.&amp;nbsp; Can you be more specific as to what you are referring.&amp;nbsp; Is it an a commercial database like Oracle or is it a collection of JMP tables stored on a remote file server, or something else?&lt;/LI&gt;
&lt;LI&gt;You need to take the time to start to learn programming and specifically JSL.&amp;nbsp; If you are going to be using JMP scripts, for your own security.&amp;nbsp; You need to be able to validate any JSL you receive.&amp;nbsp; Over time, you also need to become more self sufficient in using JMP and using JMP includes being able to write scripts.&amp;nbsp; The Community is here to help you with issues, but it is not here to write scripts on demand.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Get back to me on what the definition of "database" is in your environment, and I will try to point you in the direction to get them all open in JMP.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Dec 2023 03:10:26 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-12-25T03:10:26Z</dc:date>
    <item>
      <title>Generate a report of database schema and sample data from each table</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/709184#M89322</link>
      <description>&lt;P&gt;Is there a way I can generate a report that shows me all the tables in my database along with all of the columns of each table and the first 1-2 rows of each table (I may recognize the actual data better than the name of them column)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bonus&lt;/P&gt;&lt;P&gt;Because some tables have many columns and it is easier to scroll down and print down than sideways, is there a way to make this report such that the first 1-2 rows of each table are displayed as a column along with the columns name instead of rows (like a transpose but this couldn't (because data types would not be consistent) and need not generate an actual JMP table (just a displayed report)?&lt;/P&gt;&lt;P&gt;Lets use the Big Class sample data set as an example of one table. I would want to get a 5x2 or 5x3 matrix that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column Name, Row 1, Row 2;&lt;/P&gt;&lt;P&gt;Name, Katie, Louise;&lt;/P&gt;&lt;P&gt;Age, 12, 12;&lt;/P&gt;&lt;P&gt;Sex, F, F;&lt;/P&gt;&lt;P&gt;Height, 59, 61;&lt;/P&gt;&lt;P&gt;Weight, 95, 123;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 22:31:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/709184#M89322</guid>
      <dc:creator>Momentum</dc:creator>
      <dc:date>2023-12-13T22:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a report of database schema and sample data from each table</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/709201#M89325</link>
      <description>&lt;P&gt;I am not aware of a report like you have suggested.&amp;nbsp; However, here is a simple script that might give you a start on developing ove.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1702509336602.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/59667i6CA71A9661222C8F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1702509336602.png" alt="txnelson_0-1702509336602.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = New Table( "Table of Contents",
	New Column( "Table", character ),
	New Column( "Variable", character ),
	New Column( "Row 1", character ),
	New Column( "Row 2", character )
);

table = 1;
While( Try( Data Table( table ), "" ) != "",
	tableName = Data Table( table ) &amp;lt;&amp;lt; get name;
	colNames = Data Table( table ) &amp;lt;&amp;lt; get column names( string );
	If( tableName != "Table of Contents",
		For Each( {col}, colNames,
			dt &amp;lt;&amp;lt; add rows( 1 );
			dt:Table[N Rows( dt )] = tableName;
			dt:Variable[N Rows( dt )] = col;
			If( N Rows( Data Table( table ) ) &amp;gt;= 1,
				dt:Row 1[N Rows( dt )] = Char( Column( Data Table( table ), col )[1] )
			);
			If( N Rows( Data Table( table ) ) &amp;gt;= 2,
				dt:Row 2[N Rows( dt )] = Char( Column( Data Table( table ), col )[2] )
			);
		)
	);
	table++;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Dec 2023 23:16:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/709201#M89325</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-12-13T23:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a report of database schema and sample data from each table</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712400#M89577</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;, I have never scripted before. As such I cannot understand this script by reading it. However, when I paste it in and run it, I see that it gives me the summary table I wanted taking the data from every table I have currently open in JUMP. Is that correct?&amp;nbsp; If so, it is wonderful. All I need now is to open all the tables in my database. We only have 80 so it shouldn't be that bad. In sum, please answer:&lt;/P&gt;&lt;P&gt;1) Am I correct about what that script does, and&lt;/P&gt;&lt;P&gt;2) Do you know how to open all the tables in a database? If not, I can either find it in help or open another chat/ticket.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2023 23:17:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712400#M89577</guid>
      <dc:creator>Momentum</dc:creator>
      <dc:date>2023-12-24T23:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a report of database schema and sample data from each table</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712407#M89578</link>
      <description>&lt;OL&gt;
&lt;LI&gt;You are correct.&amp;nbsp;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;You use the term "database".&amp;nbsp; That is an ambiguous term.&amp;nbsp; Can you be more specific as to what you are referring.&amp;nbsp; Is it an a commercial database like Oracle or is it a collection of JMP tables stored on a remote file server, or something else?&lt;/LI&gt;
&lt;LI&gt;You need to take the time to start to learn programming and specifically JSL.&amp;nbsp; If you are going to be using JMP scripts, for your own security.&amp;nbsp; You need to be able to validate any JSL you receive.&amp;nbsp; Over time, you also need to become more self sufficient in using JMP and using JMP includes being able to write scripts.&amp;nbsp; The Community is here to help you with issues, but it is not here to write scripts on demand.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Get back to me on what the definition of "database" is in your environment, and I will try to point you in the direction to get them all open in JMP.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Dec 2023 03:10:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712407#M89578</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-12-25T03:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a report of database schema and sample data from each table</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712498#M89584</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;, Thanks for the heads up on using scripts without understanding them. That makes sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By database, I mean that our company has a postscript SQL database hosted on AWS. We have a part time developer who designed and maintains that database. I am able to access the tables and views inside of that database from JMP due to an ODBC driver that our IT person installed on my computer. I can even write SQL inside of JMP to query it, although I may prefer to use JMP's table level joins instead, but I digress as that is another topic of discussion.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2023 23:12:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712498#M89584</guid>
      <dc:creator>Momentum</dc:creator>
      <dc:date>2023-12-26T23:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a report of database schema and sample data from each table</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712515#M89587</link>
      <description>&lt;P&gt;Using SQL within JMP, you can query your database to return a list of all of the tables in the database.&amp;nbsp; Then using the returned data table, you can loop through the table, opening up each of the tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 02:55:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712515#M89587</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-12-27T02:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a report of database schema and sample data from each table</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712546#M89590</link>
      <description>&lt;P&gt;Thanks. This all sounds great. I cannot accept as solution until I try it, but it sounds like it is indeed the solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 05:25:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712546#M89590</guid>
      <dc:creator>Momentum</dc:creator>
      <dc:date>2023-12-27T05:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a report of database schema and sample data from each table</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712758#M89605</link>
      <description>&lt;P&gt;I suspect that you have a PostgreSQL database (not postscript).&amp;nbsp; A quick google search reveals this query to get all of the table names for the schema &lt;STRONG&gt;xxx&lt;/STRONG&gt;:&lt;/P&gt;
&lt;PRE class="lang-sql s-code-block"&gt;&lt;CODE class="hljs language-sql"&gt;&lt;SPAN class="hljs-keyword"&gt;SELECT&lt;/SPAN&gt; table_name &lt;SPAN class="hljs-keyword"&gt;FROM&lt;/SPAN&gt; information_schema.tables 
 &lt;SPAN class="hljs-keyword"&gt;WHERE&lt;/SPAN&gt; table_schema &lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;'xxx'&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;AND&lt;/SPAN&gt; table_type &lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;'BASE TABLE'&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 13:36:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-report-of-database-schema-and-sample-data-from-each/m-p/712758#M89605</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2023-12-28T13:36:00Z</dc:date>
    </item>
  </channel>
</rss>

