| VB ODBC SQL advice [message #100799] | 
			Fri, 10 October 2003 19:24   | 
		 
		
			
				
				
				
					
						
						Ken Gardner
						 Messages: 1 Registered: October 2003 
						
					 | 
					Junior Member  | 
					 | 
		 
		 
	 | 
 
	
		Hi 
 
I am working on an _existing_ VB App connecting to an Oracle database (JBA) via ODBC and just wanted to be sure I understand the syntax. 
 
The SQL statement is executing is: 
 
SELECT OSLPDF3.MSWRKHDR.*, OSLD1F3.PARTS.* FROM ... 
... WHERE OSLPDF3.MSWRKHDR.CONO40 = 'D1' ... 
 
Is this just [[database]].[[table]].[[field]]? 
 
Do you need to reference the database if the tables are unique across the ODBC? 
 
Thanks 
Ken
		
		
		
 |  
	| 
		
	 | 
 
 
 | 
	
		
		
			| Re: VB ODBC SQL advice [message #100800 is a reply to message #100799] | 
			Sat, 11 October 2003 01:27   | 
		 
		
			
				
				
				
					
						
						Frank Naude
						 Messages: 4596 Registered: April 1998 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		Hi Ken,  
  
The syntax is [[Schema or DBUser Name]].[[Object  
Name]].[[Column Name]]  
  
You do not need to reference the Schema Name if the  
object (table in your case) is located in schema you've  
logged in to.   
  
If you do not want to specify the schema name, and the  
table names are unique, you can always create PUBLIC  
SYNONYMS on your database. For example:  
  
SQL> CREATE PUBLIC SYNONYM MSWRKHDR FOR  
OSLPDF3.MSWRKHDR;  
  
Best regards.  
  
Frank Naude
		
		
		
 |  
	| 
		
	 | 
 
 
 |