schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.62k stars 200 forks source link

schemacrawler routines options doesnot give any output #1158

Closed NarayanAher closed 1 year ago

NarayanAher commented 1 year ago

Description

schemacrawler \
connect --server=sqlserver --database=SchemaCrawler --schemas=SchemaCrawler.sales  --user=LoaderRC20 --password=<passwd> --info-level=standard --command=details --log-level=ALL  --routine-types=PROCEDURE  --routine="schemas=SchemaCrawler.sales.*\.(GET_|POST_).*" --output-format=text --output-file=/Users/narayanaher/SCHEMA102.txt --no-info=true  --title="YOUR SCHEMA TITLE - PROCEDURE"
 schemacrawler \
connect --server=sqlserver --database=SchemaCrawler --schemas=SchemaCrawler.sales  --user=LoaderRC20 --password=<passwd> --info-level=standard --command=details --log-level=ALL  --routine-types=PROCEDURE  --output-format=text --output-file=/Users/narayanaher/SCHEMA102.txt --no-info=true  --title="YOUR SCHEMA TITLE-PROCEDURE"

How to Reproduce

MS SqlServer 2019 database=SchemaCrawler User: LoaderRC20 / Password Schema: sales, production Use objects creation script to create object Use Procedure_Definition.txt to create procedure

Execute schemacrawler commands as stated in description by replacing password with combination routines=SchemaCrawler.sales & rountines=routine="schemas=SchemaCrawler.sales..(GET|POST)."

Both these commands doesnot list procedure as part of output.

Relevant log output

Refer file SchemaCrawler_procedure_Extract_Log_01.txt and SchemaCrawler_procedure_Extract_Log_02.txt with log-level=All

SchemaCrawler Version

16.19.10

Java Version

java version "1.8.0_341" Java(TM) SE Runtime Environment (build 1.8.0_341-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)

Operating System and Version

MacOS

Relational Database System and Version

SQLServer 2019

JDBC Driver and Version

java version "1.8.0_341" Java(TM) SE Runtime Environment (build 1.8.0_341-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)

sualeh commented 1 year ago

@NarayanAher - SQL Server reports procedure names in a strange way - by appending ";1" to them. SchemaCrawler treats the name as having unusual characters, and the result is something like SchemaCrawler.sales."GET_CUSTOMER_NAME;1" in your case. So you regular expressions will have to match the double-quotes in the name as well. So, try this, and notice the extra "." in the regular expression:

schemacrawler \
--server sqlserver \
--host sqlserver \
--database SchemaCrawler \
--schemas ".*\.(pr|sa).*" \
--user LoaderRC20 \
--password MSSwamiji#2206 \
--routines ".*.sales.*\..(GET_|POST_).*" \
--info-level minimum \
--no-info \
--command list
NarayanAher commented 1 year ago

Thanks Sualeh, this worked. thanks

NarayanAher commented 1 year ago

Thanks Sualeh, this worked. thanks

NarayanAher commented 1 year ago

Thanks Sualeh, this worked. thanks