Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 23rd, 2003, 01:59 PM
sporb sporb is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 2 sporb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
newbie: can't select *

I've migrated a db over from Access; i can log in with isql and "show tables;" lists all tables including "foo"; when I look at the db from an admin tool I can see data in the tables, but when I try "select * from foo;" it tells me:

Statement failed, SQLCODE = -104

Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1 char xx
-foo

Where can I start to troubleshoot this?

Thanks for any help.

-Bill

Reply With Quote
  #2  
Old September 24th, 2003, 01:04 AM
goreXP's Avatar
goreXP goreXP is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Bucharest
Posts: 72 goreXP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 10 m 10 sec
Reputation Power: 6
Send a message via MSN to goreXP Send a message via Yahoo to goreXP
Exclamation

You must have SELECT privilege granted:
GRANT SELECT ON foo TO <user>,
or you have to login as SYSDBA user.

Reply With Quote
  #3  
Old September 24th, 2003, 09:36 AM
sporb sporb is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 2 sporb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
.An answer and one further question:

This db was created by a script generated by InterBase DataPump; because the table names were specified in quotes during the creation, it turns out that they must be referred to with quotes:

SELECT * from "foo";

BTW:

How would I do this on IB/Firebird:
GRANT SELECT ON * TO <user>; ? (grant privileges to all tables in a db)

atb
-s

Last edited by sporb : September 24th, 2003 at 12:10 PM.

Reply With Quote
  #4  
Old September 25th, 2003, 01:27 AM
goreXP's Avatar
goreXP goreXP is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Bucharest
Posts: 72 goreXP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 10 m 10 sec
Reputation Power: 6
Send a message via MSN to goreXP Send a message via Yahoo to goreXP
Lightbulb Re: .An answer and one further question:

Quote:
How would I do this on IB/Firebird:
GRANT SELECT ON * TO <user>; ? (grant privileges to all tables in a db)


1). you can create a stored procedure to grant all privileges (SIUDR) to an user on all tables/views in database:
CREATE PROCEDURE SP_GRANT_ALL (
M_USER CHAR(31))
AS
DECLARE VARIABLE M_TABLE CHAR(31);
begin
for select RDB$RELATION_NAME as myTable from rdb$relations WHERE SUBSTRING(RDB$RELATION_NAME from 1 for 4) <> 'RDB$' INTO :m_table
do begin execute statement 'grant all on ' || :m_table || ' to ' || :m_user; end
suspend;
end


(to execute SP_GRANT_ALL(<cUser>) you must have EXECUTE ON PROCEDURE privilege)

2).or GRANT ALL on <table> to PUBLIC;

* ALL = select + insert + update + delete + reference

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > newbie: can't select *


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway