|
-
May 24th, 1999, 01:36 PM
#1
Opening database table with an SQL query
I have worked with databases with m_strFilter variable and it works nice, but now I need to open a database table, with a complete SQL query. I suppose I have to do this by passing the sql string in Open() function. Can somebody give a little code for this!
-
May 24th, 1999, 02:36 PM
#2
Re: Opening database table with an SQL query
If you're using SQL, the DBMS makes a difference. I'll assume you're using Oracle, and give you code for that. First you connect to the database with:
EXEC SQL CONNECT :hv_szUserId
IDENTIFIED BY :hv_szPasswd
USING :hv_szHostId;
Once you've got a connection to the database, perform whatever function you'd like. For example, to query the databse, you can select a first name where the last name is smith from the Names table.
SELECT firstName
FROM Names
WHERE lastName = 'Smith';
Is that what you were looking for?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|