cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

SqlServer commands

VladiSlav
17-Peridot

SqlServer commands

Hello everyone, how to execute sqlplus <db_user>/<db_user_pw>@<sid> command . If there is no Oracle, and there is SqlServer?
And what is @<sid> ?

9 REPLIES 9
BenLoosli
23-Emerald II
(To:VladiSlav)

db_user is the name of the WIndchill user who executes DB commands. Found in db.properties file under the load point.

db_pass is the password for the db_user account. it is encrypted, so you have to know it or find someone who does.

sid is the name of the database defined when the system was created. It cam also be found in db.properties, if you know the service name.

 

Once SQLplus is open, you can execute your SQL scripts and logged into the DB, you8 can run the scripts or enter commands line by line.

 

 

 

Thanks, , there is still a problem with sqlplus, how to change the command for SQLSERVER?

db.JPG

It is showing that sqlplus isn't a recognized command, meaning that it isn't installed, not that the syntax of the command is wrong.  The question is why are you trying to use sqlplus via command line and not using SQL Server Management Studio?

BrianToussaint, I can execute SQL commands inside SQL SERVER, I thought that it is necessary to do everything through Windchill Shell that there was a synchronization of files ?

@VladiSlav what are you trying to do?  I do remember when I was creating numbering sequences for new soft types that I created, that it was done through a Microsoft SQL Server Query File ".sql".  If you check out CS42301 on the PTC support page, it will tell you how to do the number sequencing.

 

I mainly use the manager to do queries.  A couple of times with tech support guidance I have actually had to manipulate data.


BrianToussaint, I'm trying to run an example from the documentation with cust_Windchill_src

 

13. Load schema for Pet.
a. Locate, under load point/db, Make_pkg_acme_Table.sql.
a. Oracle (single byte): db/sql/com/acme/Make_pkg_acme_Table.sql
b. Oracle (multi-byte): db/sql3/com/acme/Make_pkg_acme_Table.sql
c. SQLServer: db/sqlServer/com/acme/Make_pkg_acme_Table.sql
b. cd to the db/<xxx> directory from above (db/sql, db/sql3, or db/sqlServer)
c. Run the script
a. Oracle: sqlplus <database credentials> @com/acme/Make_pkg_acme_Table.sql
b. SQLServer: …
d. Repeat for @com/acme/Make_pkg_acme_Index.sql
 

https://support.ptc.com/help/windchill/wc111_hc/whc_en/index.html#page/Windchill_Help_Center%2FWCCG_Oview_GetStartCust_CreatePetClass.html%23

@VladiSlav  I sure hope you are on a test server. (I'm not responsible for you trying this and you might want to verify with tech support that is the command you need to use.)  I don't know why they put the .... after SQLServer in line b to run the script.  The command it tells you to use when creating a new sequence as shone in the CS article: https://www.ptc.com/en/support/article?n=CS42301&source=Bloop is as below....

 

 

SQL_execute.jpg

 

BrianToussaint, thank you. Yes this is a test server, I just started to learn, while even the first example does not work, looking for examples easier, but only harder were

Hello, there is a video of training for example from the documentation

https://www.youtube.com/watch?v=-14BSAwteVw&list=PLjm4gmbLQwoeqQSP7xUhCnInGknqTBAZV&index=2

Basic Customization Getting Started With Windchill Customization https://support.ptc.com/help/wnc/r11.2.0.0/en/index.html#page/Windchill_Help_Center%2FWCCG_Oview_GetStartCust_Intro.html%23
Top Tags